Merge branch 'fix-202'
This commit is contained in:
commit
cae9f7bbf1
|
@ -316,8 +316,8 @@ public class OutputModelController {
|
|||
RuleActionFunction raf = lexer.actionFuncs.get(r);
|
||||
if ( raf==null ) {
|
||||
raf = new RuleActionFunction(delegate, r, ctxType);
|
||||
lexer.actionFuncs.put(r, raf);
|
||||
}
|
||||
|
||||
for (ActionAST a : r.actions) {
|
||||
if ( a instanceof PredAST ) {
|
||||
PredAST p = (PredAST)a;
|
||||
|
@ -332,6 +332,11 @@ public class OutputModelController {
|
|||
raf.actions.put(g.lexerActions.get(a), new Action(delegate, a));
|
||||
}
|
||||
}
|
||||
|
||||
if (!raf.actions.isEmpty() && !lexer.actionFuncs.containsKey(r)) {
|
||||
// only add to lexer if the function actually contains actions
|
||||
lexer.actionFuncs.put(r, raf);
|
||||
}
|
||||
}
|
||||
|
||||
public RuleFunction rule(Rule r) {
|
||||
|
|
Loading…
Reference in New Issue