diff mbox series

[3/3] userdiff: learn the C++ spaceship operator

Message ID df66485e7f019dd81f53f73fd3772bf0b678059d.1633589461.git.gitgitgadget@gmail.com (mailing list archive)
State Superseded
Headers show
Series Fun with cpp word regex | expand

Commit Message

Johannes Sixt Oct. 7, 2021, 6:51 a.m. UTC
From: Johannes Sixt <j6t@kdbg.org>

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>
---
 userdiff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/userdiff.c b/userdiff.c
index 1b640c7df79..13cec0b48db 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -62,7 +62,7 @@  PATTERNS("cpp",
 	 "|0[xXbB][0-9a-fA-F']+[lLuU]*"
 	 /* floatingpoint numbers that begin with a decimal point */
 	 "|\\.[0-9']+([Ee][-+]?[0-9]+)?[fFlL]?"
-	 "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->\\*?|\\.\\*"),
+	 "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->\\*?|\\.\\*|<=>"),
 PATTERNS("csharp",
 	 /* Keywords */
 	 "!^[ \t]*(do|while|for|if|else|instanceof|new|return|switch|case|throw|catch|using)\n"