From 673fe3934d2b18ebfe2ad0d6c15c750cbdf77992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sun, 10 May 2020 14:04:21 +0200 Subject: [PATCH] Fix hex numbers in uppercase --- pmd-cpp/etc/grammar/cpp.jj | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pmd-cpp/etc/grammar/cpp.jj b/pmd-cpp/etc/grammar/cpp.jj index a4dd82f4fc..26426aaa13 100644 --- a/pmd-cpp/etc/grammar/cpp.jj +++ b/pmd-cpp/etc/grammar/cpp.jj @@ -297,7 +297,7 @@ TOKEN [IGNORE_CASE] : | < UNSIGNED_DECIMALLONG : ("ul" | "lu") > -| < HEXADECIMALINT : "0x" ( | ["a"-"f"])+ > +| < HEXADECIMALINT : "0x" ()+ > | < HEXADECIMALLONG : (["u","l"])? > | < UNSIGNED_HEXADECIMALINT : "u" > | < UNSIGNED_HEXADECIMALLONG : ("ul" | "lu") > @@ -387,12 +387,16 @@ TOKEN : // but can also be \ uhhhh or \ Uhhhhhh (unicode escapes) // *and* other characters may be allowed by implementations, eg a raw unicode char (not escaped), or a dollar -// this grammar doesn't allow unicode escapes +// this grammar doesn't allow unicode escapes, maybe it should? // ref: https://en.cppreference.com/w/cpp/language/identifiers#Unicode_characters_in_identifiers < ID : ()* > +| < #UNICODE_ESCAPE: "\\" ( "u" + | "U" + ) > +| < #HEXDIGIT: ["a"-"f", "A"-"F", "0"-"9"] > | < #ID_CHAR: [ "a"-"z", "A"-"Z", "0"-"9", "_", "$", "\u00a8", "\u00aa", "\u00ad", "\u00af",