goldstein 3.2.2 → 3.2.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/ChangeLog +5 -0
- package/build/parser.cjs +13 -5
- package/package.json +1 -1
- package/packages/parser/index.js +15 -5
package/ChangeLog
CHANGED
package/build/parser.cjs
CHANGED
|
@@ -5040,11 +5040,19 @@ var extendParser = (keywords3) => {
|
|
|
5040
5040
|
parse: parse4
|
|
5041
5041
|
};
|
|
5042
5042
|
};
|
|
5043
|
-
var createParse = (parser) => (
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5043
|
+
var createParse = (parser) => (source) => {
|
|
5044
|
+
const options = {
|
|
5045
|
+
ecmaVersion: "latest",
|
|
5046
|
+
sourceType: "module",
|
|
5047
|
+
locations: true
|
|
5048
|
+
};
|
|
5049
|
+
const result = parser.parse(source, options);
|
|
5050
|
+
const tokens = Array.from(parser.tokenizer(source, options));
|
|
5051
|
+
return {
|
|
5052
|
+
...result,
|
|
5053
|
+
tokens
|
|
5054
|
+
};
|
|
5055
|
+
};
|
|
5048
5056
|
|
|
5049
5057
|
// packages/operator/scopeflags.js
|
|
5050
5058
|
var SCOPE_TOP2 = 1;
|
package/package.json
CHANGED
package/packages/parser/index.js
CHANGED
|
@@ -12,8 +12,18 @@ export const extendParser = (keywords) => {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
const createParse = (parser) => (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const createParse = (parser) => (source) => {
|
|
16
|
+
const options = {
|
|
17
|
+
ecmaVersion: 'latest',
|
|
18
|
+
sourceType: 'module',
|
|
19
|
+
locations: true,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const result = parser.parse(source, options);
|
|
23
|
+
const tokens = Array.from(parser.tokenizer(source, options));
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
...result,
|
|
27
|
+
tokens,
|
|
28
|
+
};
|
|
29
|
+
};
|