Fix options not getting properly applied to extracted lexer in combined grammar (fixes #372)

This commit is contained in:
Sam Harwell 2014-01-16 10:34:55 -06:00
parent fe5f93a0f4
commit 4fc32e1f7c
1 changed files with 3 additions and 1 deletions

View File

@ -302,7 +302,9 @@ public class GrammarTransformPipeline {
if ( Grammar.lexerOptions.contains(optionName) && if ( Grammar.lexerOptions.contains(optionName) &&
!Grammar.doNotCopyOptionsToLexer.contains(optionName) ) !Grammar.doNotCopyOptionsToLexer.contains(optionName) )
{ {
lexerOptionsRoot.addChild((Tree)adaptor.dupTree(o)); GrammarAST optionTree = (GrammarAST)adaptor.dupTree(o);
lexerOptionsRoot.addChild(optionTree);
lexerAST.setOption(optionName, (GrammarAST)optionTree.getChild(1));
} }
} }
} }