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 CHANGED
@@ -1,3 +1,8 @@
1
+ 2023.04.19, v3.2.3
2
+
3
+ fix:
4
+ - bf330c5 goldstein: add support of tokens
5
+
1
6
  2023.04.19, v3.2.2
2
7
 
3
8
  fix:
package/build/parser.cjs CHANGED
@@ -5040,11 +5040,19 @@ var extendParser = (keywords3) => {
5040
5040
  parse: parse4
5041
5041
  };
5042
5042
  };
5043
- var createParse = (parser) => (a) => parser.parse(a, {
5044
- ecmaVersion: "latest",
5045
- sourceType: "module",
5046
- locations: true
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "goldstein",
3
- "version": "3.2.2",
3
+ "version": "3.2.3",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "JavaScript with no limits",
@@ -12,8 +12,18 @@ export const extendParser = (keywords) => {
12
12
  };
13
13
  };
14
14
 
15
- const createParse = (parser) => (a) => parser.parse(a, {
16
- ecmaVersion: 'latest',
17
- sourceType: 'module',
18
- locations: true,
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
+ };