]> git.ipfire.org Git - thirdparty/git.git/commitdiff
userdiff-cpp: learn the C++ spaceship operator
authorJohannes Sixt <j6t@kdbg.org>
Sun, 10 Oct 2021 17:03:04 +0000 (17:03 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 10 Oct 2021 22:24:21 +0000 (15:24 -0700)
Since C++20, the language has a generalized comparison operator <=>.
Teach the cpp driver not to separate it into <= and > tokens.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4034/cpp/expect
userdiff.c

index b90b3f207bf4b01d3c582eeb95355d28dbec1f84..5ff4ce477b43a54ed215f88a702472232217fc81 100644 (file)
@@ -25,7 +25,7 @@ str.e+<RED>65<RESET><GREEN>75<RESET>
 a<RED>*<RESET><GREEN>*=<RESET>b c<RED>/<RESET><GREEN>/=<RESET>d e<RED>%<RESET><GREEN>%=<RESET>f
 a<RED>+<RESET><GREEN>++<RESET>b c<RED>-<RESET><GREEN>--<RESET>d
 a<RED><<<RESET><GREEN><<=<RESET>b c<RED>>><RESET><GREEN>>>=<RESET>d
-a<RED><<RESET><GREEN><=<RESET>b c<RED><=<RESET><GREEN><<RESET>d e<RED>><RESET><GREEN>>=<RESET>f g<RED>>=<RESET><GREEN>><RESET>h i<=<GREEN>><RESET>j
+a<RED><<RESET><GREEN><=<RESET>b c<RED><=<RESET><GREEN><<RESET>d e<RED>><RESET><GREEN>>=<RESET>f g<RED>>=<RESET><GREEN>><RESET>h i<RED><=<RESET><GREEN><=><RESET>j
 a<RED>==<RESET><GREEN>!=<RESET>b c<RED>!=<RESET><GREEN>=<RESET>d
 a<RED>^<RESET><GREEN>^=<RESET>b c<RED>|<RESET><GREEN>|=<RESET>d e<RED>&&<RESET><GREEN>&=<RESET>f
 a<RED>||<RESET><GREEN>|<RESET>b
index c1084650dde48c3f15ee2317e094735234dedf28..7b143ef36b0c26ca892600c2008547954e2cc263 100644 (file)
@@ -72,7 +72,7 @@ PATTERNS("cpp",
         "|0[xXbB][0-9a-fA-F']+[lLuU]*"
         /* floatingpoint numbers that begin with a decimal point */
         "|\\.[0-9][0-9']*([Ee][-+]?[0-9]+)?[fFlL]?"
-        "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->\\*?|\\.\\*"),
+        "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->\\*?|\\.\\*|<=>"),
 PATTERNS("csharp",
         /* Keywords */
         "!^[ \t]*(do|while|for|if|else|instanceof|new|return|switch|case|throw|catch|using)\n"