[cpp] Undo changes to String literals in grammar, it's not needed anymore
Such slightly illegal char escape sequences can still be parsed now.
This commit is contained in:
@@ -321,7 +321,7 @@ TOKEN :
|
||||
|
||||
< CHARACTER : ("L")? "'" ( ( ~["'","\\","\r","\n"] ) | ( "\\" ( ~["\n","\r"] ) ) )* "'" >
|
||||
|
||||
| < STRING : ("L")? "\"" ( ( ~["\"","\\","\r","\n"] ) | ( ("\\")+ ( ~["\n","\r"] | "\n" | "\r\n" ) ) )* "\"" >
|
||||
| < STRING : ("L")? "\"" ( ( ~["\"","\\","\r","\n"] ) | ( "\\" ( ~["\n","\r"] | "\n" | "\r\n" ) ) )* "\"" >
|
||||
|
||||
| < RSTRING : "R\"(" ( ~[")"] | ( ")" ~["\""] ) )* ")\"" >
|
||||
}
|
||||
|
@@ -46,6 +46,7 @@ public class CPPTokenizerContinuationTest {
|
||||
assertEquals(")", findByLine(12, tokens).get(3).toString());
|
||||
assertEquals("{", findByLine(13, tokens).get(0).toString());
|
||||
assertEquals("\"world!\\n\"", findByLine(16, tokens).get(0).toString());
|
||||
assertEquals("\"3 Hello, \\world!\\n\"", findByLine(22, tokens).get(4).toString());
|
||||
assertEquals("}", findByLine(29, tokens).get(0).toString());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user