|
|
|
@ -1,8 +1,8 @@
|
|
|
|
|
/*
|
|
|
|
|
* Optimalization passes made on the grammar AST before compilation. Each pass
|
|
|
|
|
* is a function that is passed the AST and returns a new AST. The AST can be
|
|
|
|
|
* modified in-place by the pass. The order in which the passes are run is
|
|
|
|
|
* specified in |PEG.compiler.compile| and should be the same as the order of
|
|
|
|
|
* is a function that is passed the AST and does not return anything. The AST
|
|
|
|
|
* can be modified in-place by the pass. The order in which the passes are run
|
|
|
|
|
* is specified in |PEG.compiler.compile| and should be the same as the order of
|
|
|
|
|
* definitions here.
|
|
|
|
|
*/
|
|
|
|
|
PEG.compiler.passes = {
|
|
|
|
@ -74,8 +74,6 @@ PEG.compiler.passes = {
|
|
|
|
|
delete ast.rules[name];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ast;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -154,7 +152,5 @@ PEG.compiler.passes = {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
compute(ast);
|
|
|
|
|
|
|
|
|
|
return ast;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|