[gtksourceview: 2/3] c.lang: support hexadecimal floating constants




commit f9a50d9be651e420da2fc926b9baa0580951e52e
Author: Elias Aebi <353-eyelash users noreply gitlab gnome org>
Date:   Sun Dec 5 15:51:02 2021 +0100

    c.lang: support hexadecimal floating constants

 data/language-specs/c.lang       | 3 ++-
 tests/syntax-highlighting/file.c | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/data/language-specs/c.lang b/data/language-specs/c.lang
index b126bf47..b9de0340 100644
--- a/data/language-specs/c.lang
+++ b/data/language-specs/c.lang
@@ -144,7 +144,8 @@
       <match extended="true">
         (?&lt;![\w\.])
         ((\.[0-9]+ | [0-9]+\.[0-9]*) ([Ee][+-]?[0-9]+)? |
-         ([0-9]+[Ee][+-]?[0-9]+))
+         ([0-9]+[Ee][+-]?[0-9]+) |
+         (0[xX][a-fA-F0-9]*\.?[a-fA-F0-9]*[pP][+-]?[0-9]+))
         [fFlL]?
         (?![\w\.])
       </match>
diff --git a/tests/syntax-highlighting/file.c b/tests/syntax-highlighting/file.c
index ed0bb82a..74769b74 100644
--- a/tests/syntax-highlighting/file.c
+++ b/tests/syntax-highlighting/file.c
@@ -8,6 +8,7 @@ int main (void)
     int b = 089;
     int c = 89.;
     int d = 'a';
+    double hexadecimal_floating_constant = 0x1.2p3;
     printf ("Hello %s!\n", "world");
     return 0;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]