@gi-tcg/gts-transpiler 0.4.2 → 0.4.3
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 +4 -3
- package/package.json +1 -1
- package/src/config.ts +1 -0
- package/src/parse/gts_plugin.ts +4 -3
- package/src/transform/volar/walker.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -203,7 +203,7 @@ function gtsPlugin(options = {}) {
|
|
|
203
203
|
dummy.isDummy = true;
|
|
204
204
|
return this.finishNode(dummy, "Identifier");
|
|
205
205
|
}
|
|
206
|
-
return this.
|
|
206
|
+
return this.parseExprSubscripts(void 0, false);
|
|
207
207
|
}
|
|
208
208
|
gts_parseShortcutFunction() {
|
|
209
209
|
const node = this.startNode();
|
|
@@ -1563,7 +1563,7 @@ const gtsToTypingsWalker = {
|
|
|
1563
1563
|
};
|
|
1564
1564
|
state.literalFromIdentifier.add(lit);
|
|
1565
1565
|
return lit;
|
|
1566
|
-
} else return
|
|
1566
|
+
} else return visit(attr);
|
|
1567
1567
|
});
|
|
1568
1568
|
const returnValue = {
|
|
1569
1569
|
type: "Identifier",
|
|
@@ -1976,7 +1976,8 @@ const DEFAULT_GTS_CONFIG = {
|
|
|
1976
1976
|
"anemo",
|
|
1977
1977
|
"geo",
|
|
1978
1978
|
"dendro",
|
|
1979
|
-
"omni"
|
|
1979
|
+
"omni",
|
|
1980
|
+
"$"
|
|
1980
1981
|
],
|
|
1981
1982
|
queryBindings: ["my", "opp"]
|
|
1982
1983
|
};
|
package/package.json
CHANGED
package/src/config.ts
CHANGED
package/src/parse/gts_plugin.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { tokTypes, type Parser as ParserClass } from "acorn";
|
|
1
|
+
import { tokTypes, type Parser as ParserClass, type Node } from "acorn";
|
|
2
2
|
import type { Parse, AST } from "../types.ts";
|
|
3
3
|
import { specialIdentifiers } from "../keywords.ts";
|
|
4
4
|
import { DUMMY_PLACEHOLDER } from "./loose_plugin.ts";
|
|
@@ -46,7 +46,8 @@ AttributeExpression:
|
|
|
46
46
|
# foo bar { baz = 1 };
|
|
47
47
|
# foo bar, { baz: 1 }; // If allowed, hard to distinguish
|
|
48
48
|
# foo bar, ({ baz: 1 }); // OK
|
|
49
|
-
[lookahead != "{"]
|
|
49
|
+
[lookahead != "{"] CallExpression OptionalChain?
|
|
50
|
+
[lookahead != "{"] MemberExpression OptionalChain?
|
|
50
51
|
|
|
51
52
|
DirectShortcutFunction:
|
|
52
53
|
[lookahead = one of ":", ReservedWord]
|
|
@@ -260,7 +261,7 @@ export function gtsPlugin(options: GtsPluginOption = {}) {
|
|
|
260
261
|
dummy.isDummy = true;
|
|
261
262
|
return this.finishNode(dummy, "Identifier");
|
|
262
263
|
}
|
|
263
|
-
return this.
|
|
264
|
+
return this.parseExprSubscripts(void 0, false);
|
|
264
265
|
}
|
|
265
266
|
|
|
266
267
|
gts_parseShortcutFunction() {
|