Skip to content

Commit 73c9a0b

Browse files
committed
wasm: remove _currRuleName, _currRuleInfo
1 parent 6f99512 commit 73c9a0b

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

packages/wasm/src/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -840,8 +840,9 @@ export class Compiler {
840840
return this.asm._functionDecls.at(-1);
841841
}
842842

843-
compileRule(name, ruleInfo) {
843+
compileRule(name) {
844844
const {asm} = this;
845+
const ruleInfo = getNotNull(this.rules, name);
845846
let paramTypes = [];
846847
if (ruleInfo.patterns) {
847848
paramTypes = [w.valtype.i32];
@@ -1072,10 +1073,7 @@ export class Compiler {
10721073
ruleDecls.push(this.compileTerminalRule(name));
10731074
} else {
10741075
assert(!name.startsWith('$term'));
1075-
const ruleInfo = (this._currRuleInfo = getNotNull(this.rules, name));
1076-
this._currRuleName = name;
1077-
ruleDecls.push(this.compileRule(name, ruleInfo));
1078-
this._currRuleName = this._currRuleInfo = undefined;
1076+
ruleDecls.push(this.compileRule(name));
10791077
}
10801078
}
10811079
const {asm} = this;

0 commit comments

Comments
 (0)