Bug 2354: Fixed parsing of block comments between statement and argument 81/12781/3
authorMartin Ciglan <mciglan@cisco.com>
Wed, 12 Nov 2014 11:28:42 +0000 (12:28 +0100)
committerTony Tkacik <ttkacik@cisco.com>
Fri, 14 Nov 2014 12:44:31 +0000 (12:44 +0000)
Lexer didn't contain BLOCK_COMMENT_MODE in VALUE_MODE,
therefore parser tried to parse comments instead of skipping them

Change-Id: I6d131a45df121570537686006aa31397124ea6ca
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
yang/yang-parser-impl/src/main/antlr/YangLexer.g4

index ac9358c72eb55494f9affb955ff918747f8126d8..48d75a0feec6ac8e1afa9962fe051b2fdb2c099a 100644 (file)
@@ -105,7 +105,9 @@ fragment HEX : [0-9a-fA-F] ;
           
 END_IDENTIFIER_SEMICOLON : ';' -> type(SEMICOLON),popMode;
 END_IDENTIFIER_LEFT_BRACE : '{' ->type(LEFT_BRACE), popMode;
+
+START_INNER_BLOCK_COMMENT : '/*' ->pushMode(BLOCK_COMMENT_MODE), skip ;
+
 fragment SUB_STRING : ('"' (ESC | ~["])*'"') | ('\'' (ESC | ~['])*'\'') ;
 
 STRING: ((~( '\r' | '\n' | '\t' | ' ' | ';' | '{' | '"' | '\'')~( '\r' | '\n' | '\t' | ' ' | ';' | '{' )* ) | SUB_STRING ) ->popMode;// IDENTIFIER ;