|
|
@ -1,7 +1,6 @@
|
|
|
|
"use strict";
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
let arrays = require("../../utils/arrays"),
|
|
|
|
let visitor = require("../visitor");
|
|
|
|
visitor = require("../visitor");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Removes proxy rules -- that is, rules that only delegate to other rule.
|
|
|
|
* Removes proxy rules -- that is, rules that only delegate to other rule.
|
|
|
@ -28,7 +27,7 @@ function removeProxyRules(ast, options) {
|
|
|
|
ast.rules.forEach((rule, i) => {
|
|
|
|
ast.rules.forEach((rule, i) => {
|
|
|
|
if (isProxyRule(rule)) {
|
|
|
|
if (isProxyRule(rule)) {
|
|
|
|
replaceRuleRefs(ast, rule.name, rule.expression.name);
|
|
|
|
replaceRuleRefs(ast, rule.name, rule.expression.name);
|
|
|
|
if (!arrays.contains(options.allowedStartRules, rule.name)) {
|
|
|
|
if (options.allowedStartRules.indexOf(rule.name) === -1) {
|
|
|
|
indices.push(i);
|
|
|
|
indices.push(i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|