goldstein 3.2.0 → 3.2.2
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 +32 -1
- package/package.json +2 -2
- package/packages/goldstein/parser.js +1 -1
package/ChangeLog
CHANGED
package/build/parser.cjs
CHANGED
|
@@ -5472,6 +5472,36 @@ function keywordImport(Parser3) {
|
|
|
5472
5472
|
};
|
|
5473
5473
|
}
|
|
5474
5474
|
|
|
5475
|
+
// packages/keyword-arrow/index.js
|
|
5476
|
+
function fn3(Parser3) {
|
|
5477
|
+
return class extends Parser3 {
|
|
5478
|
+
parseBlock(createNewLexicalScope, node, exitStrict) {
|
|
5479
|
+
if (createNewLexicalScope === void 0)
|
|
5480
|
+
createNewLexicalScope = true;
|
|
5481
|
+
if (node === void 0)
|
|
5482
|
+
node = this.startNode();
|
|
5483
|
+
node.body = [];
|
|
5484
|
+
this.eat(types$1.arrow);
|
|
5485
|
+
this.expect(types$1.braceL);
|
|
5486
|
+
if (createNewLexicalScope) {
|
|
5487
|
+
this.enterScope(0);
|
|
5488
|
+
}
|
|
5489
|
+
while (this.type !== types$1.braceR) {
|
|
5490
|
+
const stmt = this.parseStatement(null);
|
|
5491
|
+
node.body.push(stmt);
|
|
5492
|
+
}
|
|
5493
|
+
if (exitStrict) {
|
|
5494
|
+
this.strict = false;
|
|
5495
|
+
}
|
|
5496
|
+
this.next();
|
|
5497
|
+
if (createNewLexicalScope) {
|
|
5498
|
+
this.exitScope();
|
|
5499
|
+
}
|
|
5500
|
+
return this.finishNode(node, "BlockStatement");
|
|
5501
|
+
}
|
|
5502
|
+
};
|
|
5503
|
+
}
|
|
5504
|
+
|
|
5475
5505
|
// packages/goldstein/parser.js
|
|
5476
5506
|
var defaultKeywords = {
|
|
5477
5507
|
keywordFn: fn,
|
|
@@ -5483,10 +5513,11 @@ var defaultKeywords = {
|
|
|
5483
5513
|
keywordFreeze,
|
|
5484
5514
|
keywordIf: fn2,
|
|
5485
5515
|
keywordImport,
|
|
5516
|
+
keywordArrow: fn3,
|
|
5486
5517
|
stringInterpolation
|
|
5487
5518
|
};
|
|
5488
5519
|
var keywords2 = defaultKeywords;
|
|
5489
|
-
var parse3 = (source, keywords3 = defaultKeywords) => {
|
|
5520
|
+
var parse3 = (source, options, keywords3 = defaultKeywords) => {
|
|
5490
5521
|
const { parse: parse4 } = extendParser(Object.values(keywords3));
|
|
5491
5522
|
return parse4(source);
|
|
5492
5523
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "goldstein",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "JavaScript with no limits",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"lint": "madrun lint",
|
|
27
27
|
"fix:lint": "madrun fix:lint",
|
|
28
28
|
"build": "madrun build",
|
|
29
|
-
"
|
|
29
|
+
"wisdom": "madrun wisdom"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@putout/printer": "^1.16.0",
|
|
@@ -27,7 +27,7 @@ const defaultKeywords = {
|
|
|
27
27
|
|
|
28
28
|
export const keywords = defaultKeywords;
|
|
29
29
|
|
|
30
|
-
export const parse = (source, keywords = defaultKeywords) => {
|
|
30
|
+
export const parse = (source, options, keywords = defaultKeywords) => {
|
|
31
31
|
const {parse} = extendParser(Object.values(keywords));
|
|
32
32
|
return parse(source);
|
|
33
33
|
};
|