Strings Ending in Backslash are Improperly Lexed
[yangtools.git] / yang / yang-parser-rfc7950 / src / main / antlr / YangStatementLexer.g4
index b17c6674f221998d793015366841f86747719a75..3ddb6521ecb0552e675685f637b63971b45b72b4 100644 (file)
@@ -34,7 +34,7 @@ START_BLOCK_COMMENT : '/*' ->pushMode(BLOCK_COMMENT_MODE), skip;
 SEP: [ \n\r\t]+ -> type(SEP);
 IDENTIFIER : [a-zA-Z_/][a-zA-Z0-9_\-.:/]* -> type(IDENTIFIER);
 
-fragment SUB_STRING : ('"' (ESC | ~["])*'"') | ('\'' (ESC | ~['])*'\'');
+fragment SUB_STRING : ('"' (ESC | ~["])*? '"') | ('\'' (ESC | ~['])* '\'');
 fragment ESC : '\\' (["\\/bfnrt] | UNICODE);
 fragment UNICODE : 'u' HEX HEX HEX HEX;
 fragment HEX : [0-9a-fA-F] ;
@@ -43,4 +43,4 @@ STRING: ((~( '\r' | '\n' | '\t' | ' ' | ';' | '{' | '"' | '\'' | '}' | '/' | '+'
 
 mode BLOCK_COMMENT_MODE;
 END_BLOCK_COMMENT : '*/' -> popMode, skip;
-BLOCK_COMMENT :  . -> skip;
\ No newline at end of file
+BLOCK_COMMENT :  . -> skip;