goldstein 3.2.2 → 3.2.4
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 +10 -0
- package/build/parser.cjs +14 -5
- package/package.json +1 -1
- package/packages/parser/index.js +16 -5
package/ChangeLog
CHANGED
package/build/parser.cjs
CHANGED
|
@@ -5040,11 +5040,20 @@ 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
|
+
comment: true
|
|
5049
|
+
};
|
|
5050
|
+
const result = parser.parse(source, options);
|
|
5051
|
+
const tokens = Array.from(parser.tokenizer(source, options));
|
|
5052
|
+
return {
|
|
5053
|
+
...result,
|
|
5054
|
+
tokens
|
|
5055
|
+
};
|
|
5056
|
+
};
|
|
5048
5057
|
|
|
5049
5058
|
// packages/operator/scopeflags.js
|
|
5050
5059
|
var SCOPE_TOP2 = 1;
|
package/package.json
CHANGED
package/packages/parser/index.js
CHANGED
|
@@ -12,8 +12,19 @@ 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
|
+
comment: true,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const result = parser.parse(source, options);
|
|
24
|
+
const tokens = Array.from(parser.tokenizer(source, options));
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
...result,
|
|
28
|
+
tokens,
|
|
29
|
+
};
|
|
30
|
+
};
|