Repository: MaskingTechnology/jitar (ts)

Issue:
Add support for dynamic imports to the reflection
Currently we support static imports:

```ts
import x, {y, a as z } from 'module';
```

And need to add support for dynamic imports:

```ts
const { z } = await import('module');
```

Pull request description:
feat(reflection): dynamic import support
Fixes #198

Changes proposed in this pull request:
- Added support for dynamic imports

@MaskingTechnology/jitar


Patch:
diff --git a/packages/jitar-reflection/src/parser/Parser.ts b/packages/jitar-reflection/src/parser/Parser.ts
index 448f8dc..4509db0 100644
--- a/packages/jitar-reflection/src/parser/Parser.ts
+++ b/packages/jitar-reflection/src/parser/Parser.ts
@@ -278,6 +278,16 @@ export default class Parser
         {
             return new ReflectionImport(members, token.value);
         }
+        else if (token.hasValue(Group.OPEN))
+        {
+            token = tokenList.step(); // Read away the open group
+
+            const from = token.value;
+
+            tokenList.step(2); // Read away the from value and scope close
+
+            return new ReflectionImport(members, from);
+        }
 
         if (token.hasValue(Scope.OPEN) === false)
         {


Test patch:
diff --git a/packages/jitar-reflection/test/_fixtures/parser/Parser.fixture.ts b/packages/jitar-reflection/test/_fixtures/parser/Parser.fixture.ts
index 89c70d8..d721d87 100644
--- a/packages/jitar-reflection/test/_fixtures/parser/Parser.fixture.ts
+++ b/packages/jitar-reflection/test/_fixtures/parser/Parser.fixture.ts
@@ -19,6 +19,7 @@ const IMPORTS =
     IMPORT_DEFAULT_MEMBER: "import name, { member } from 'module'",
     IMPORT_DEFAULT_MEMBER_AS: "import name, { member as alias } from 'module'",
     IMPORT_MULTIPLE_MEMBERS_AS: "import { name, member as alias } from 'module'",
+    IMPORT_DYNAMIC: "import('module')",
 }
 
 const EXPORTS =
diff --git a/packages/jitar-reflection/test/parser/Parser.spec.ts b/packages/jitar-reflection/test/parser/Parser.spec.ts
index d5e16e9..7967c21 100644
--- a/packages/jitar-reflection/test/parser/Parser.spec.ts
+++ b/packages/jitar-reflection/test/parser/Parser.spec.ts
@@ -156,6 +156,13 @@ describe('parser/Parser', () =>
             expect(second.name).toBe('member');
             expect(second.as).toBe('alias');
         });
+
+        it('should parse importing modules dynamically', () =>
+        {
+            const imported = parser.parseImport(IMPORTS.IMPORT_DYNAMIC);
+            expect(imported.members.length).toBe(0);
+            expect(imported.from).toBe("'module'");
+        });
     });
 
     describe('.parseExport(code)', () =>