Remove erroneous lexer command placement error message for rules with more than 1 command

This commit is contained in:
Sam Harwell 2012-11-18 18:17:21 -06:00
parent e610f26998
commit 7fe48dfebf
1 changed files with 1 additions and 2 deletions

View File

@ -347,8 +347,7 @@ public class BasicSemanticChecks extends GrammarTreeVisitor {
boolean outerMostAlt = blk.parent.getType() == RULE;
Tree rule = tree.getAncestor(RULE);
String fileName = tree.getToken().getInputStream().getSourceName();
if ( !outerMostAlt || tree.getChildIndex() != alt.getChildCount()-1 ||
blk.getChildCount()>1 )
if ( !outerMostAlt || blk.getChildCount()>1 )
{
ErrorType e = ErrorType.LEXER_COMMAND_PLACEMENT_ISSUE;
if ( tree.getType() == ACTION ) e = ErrorType.LEXER_ACTION_PLACEMENT_ISSUE;