From 6bb83a71dda1199a1f3dea8e82c18d9fcff4a1c8 Mon Sep 17 00:00:00 2001 From: Maikel Steneker Date: Fri, 10 May 2019 15:30:01 +0200 Subject: [PATCH] Added support for various C++ string prefixes. These were already tokenized without errors, but the prefixes were considered to be a separate token. --- pmd-cpp/etc/grammar/cpp.jj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmd-cpp/etc/grammar/cpp.jj b/pmd-cpp/etc/grammar/cpp.jj index a39effe982..59eb1b51c6 100644 --- a/pmd-cpp/etc/grammar/cpp.jj +++ b/pmd-cpp/etc/grammar/cpp.jj @@ -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 : + "\"" ( ( ~["\"","\\","\r","\n"] ) | ( "\\" ( ~["\n","\r"] | "\n" | "\r\n" ) ) )* "\"" > | < RSTRING : "R\"(" ( ~[")"] | ( ")" ~["\""] ) )* ")\"" > }