Added support for various C++ string prefixes.

These were already tokenized without errors, but the prefixes were considered to be a separate token.
This commit is contained in:
Maikel Steneker
2019-05-10 15:30:01 +02:00
parent b4821131ea
commit 6bb83a71dd

View File

@ -312,7 +312,9 @@ TOKEN :
< CHARACTER : ("L")? "'" ( ( ~["'","\\","\r","\n"] ) | ( "\\" ( ~["\n","\r"] ) ) )* "'" >
| < STRING : ("L")? "\"" ( ( ~["\"","\\","\r","\n"] ) | ( "\\" ( ~["\n","\r"] | "\n" | "\r\n" ) ) )* "\"" >
| < #STRPREF : (["L", "u", "U"] | "u8")? >
| < STRING : <STRPREF>
"\"" ( ( ~["\"","\\","\r","\n"] ) | ( "\\" ( ~["\n","\r"] | "\n" | "\r\n" ) ) )* "\"" >
| < RSTRING : "R\"(" ( ~[")"] | ( ")" ~["\""] ) )* ")\"" >
}