Merge branch 'fix-202'

This commit is contained in:
Sam Harwell 2013-03-27 15:02:07 -05:00
commit cae9f7bbf1
1 changed files with 6 additions and 1 deletions

View File

@ -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) {