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 CHANGED
@@ -1,3 +1,13 @@
1
+ 2023.04.19, v3.2.4
2
+
3
+ fix:
4
+ - dc9866d parser: comment
5
+
6
+ 2023.04.19, v3.2.3
7
+
8
+ fix:
9
+ - bf330c5 goldstein: add support of tokens
10
+
1
11
  2023.04.19, v3.2.2
2
12
 
3
13
  fix:
package/build/parser.cjs CHANGED
@@ -5040,11 +5040,20 @@ 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
+ 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "goldstein",
3
- "version": "3.2.2",
3
+ "version": "3.2.4",
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,19 @@ 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
+ 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
+ };