@gi-tcg/gts-transpiler 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +363 -183
- package/package.json +4 -3
- package/src/config.ts +2 -2
- package/src/index.ts +8 -2
- package/src/parse/gts_plugin.ts +19 -12
- package/src/parse/index.ts +15 -5
- package/src/parse/loose_plugin.ts +2 -2
- package/src/parse/record_call_lparen_plugin.ts +85 -0
- package/src/transform/gts.ts +32 -45
- package/src/transform/volar/collect_tokens.ts +44 -18
- package/src/transform/volar/index.ts +16 -28
- package/src/transform/volar/mappings.ts +45 -26
- package/src/transform/volar/printer.ts +123 -0
- package/src/transform/volar/replacements.ts +89 -11
- package/src/transform/volar/walker.ts +52 -95
- package/src/types.ts +16 -4
package/src/types.ts
CHANGED
|
@@ -25,6 +25,18 @@ declare module "estree" {
|
|
|
25
25
|
GTSQueryExpression: GTSQueryExpression;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
interface ImportDeclaration {
|
|
29
|
+
/** Emit inner diagnostics to the top-of-file */
|
|
30
|
+
diagnosticsOnTop?: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface SimpleCallExpression {
|
|
34
|
+
lParenLoc?: SourceLocation;
|
|
35
|
+
}
|
|
36
|
+
interface NewExpression {
|
|
37
|
+
lParenLoc?: SourceLocation;
|
|
38
|
+
}
|
|
39
|
+
|
|
28
40
|
interface GTSDefineStatement extends BaseStatement {
|
|
29
41
|
type: "GTSDefineStatement";
|
|
30
42
|
body: GTSNamedAttributeDefinition;
|
|
@@ -32,10 +44,10 @@ declare module "estree" {
|
|
|
32
44
|
|
|
33
45
|
interface GTSNamedAttributeDefinition extends BaseNode {
|
|
34
46
|
type: "GTSNamedAttributeDefinition";
|
|
35
|
-
name:
|
|
47
|
+
name: Identifier | Literal;
|
|
36
48
|
body: GTSAttributeBody;
|
|
37
49
|
bindingAccessModifier?: "public" | "protected" | "private";
|
|
38
|
-
bindingName?:
|
|
50
|
+
bindingName?: Identifier;
|
|
39
51
|
}
|
|
40
52
|
|
|
41
53
|
interface GTSAttributeBody extends BaseNode {
|
|
@@ -46,7 +58,7 @@ declare module "estree" {
|
|
|
46
58
|
|
|
47
59
|
interface GTSPositionalAttributeList extends BaseNode {
|
|
48
60
|
type: "GTSPositionalAttributeList";
|
|
49
|
-
attributes:
|
|
61
|
+
attributes: Expression[];
|
|
50
62
|
}
|
|
51
63
|
|
|
52
64
|
interface GTSNamedAttributeBlock extends BaseNode {
|
|
@@ -67,7 +79,7 @@ declare module "estree" {
|
|
|
67
79
|
|
|
68
80
|
interface GTSShortcutFunctionExpression extends BaseExpression {
|
|
69
81
|
type: "GTSShortcutFunctionExpression";
|
|
70
|
-
body:
|
|
82
|
+
body: BlockStatement | Expression;
|
|
71
83
|
expression: boolean;
|
|
72
84
|
}
|
|
73
85
|
|