From c4fdba338355d80e40b84391af9f8c022d4f21af Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Sun, 10 Oct 2021 17:03:04 +0000 Subject: [PATCH] userdiff-cpp: learn the C++ spaceship operator 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 Signed-off-by: Junio C Hamano --- t/t4034/cpp/expect | 2 +- userdiff.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t4034/cpp/expect b/t/t4034/cpp/expect index b90b3f207b..5ff4ce477b 100644 --- a/t/t4034/cpp/expect +++ b/t/t4034/cpp/expect @@ -25,7 +25,7 @@ str.e+6575 a**=b c//=d e%%=f a+++b c---d a<<<<=b c>>>>=d -a<<=b c<=<d e>>=f g>=>h i<=>j +a<<=b c<=<d e>>=f g>=>h i<=<=>j a==!=b c!==d a^^=b c||=d e&&&=f a|||b diff --git a/userdiff.c b/userdiff.c index c1084650dd..7b143ef36b 100644 --- a/userdiff.c +++ b/userdiff.c @@ -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"