]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
xgettext: Support '_' in number tokens in C++.
authorBruno Haible <bruno@clisp.org>
Sat, 27 Jan 2018 13:09:55 +0000 (14:09 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 27 Jan 2018 13:09:55 +0000 (14:09 +0100)
* gettext-tools/src/x-c.c (phase5_get): Recognize '_' in C++.
* NEWS: Update.

NEWS
gettext-tools/src/x-c.c

diff --git a/NEWS b/NEWS
index 57933c35de7d7cf3a1b6c6e11a41935b7598e5a9..d5c09799fc68d1245b4f2e6ff4e5da00ea8ad2a3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@
   - C, C++:
     xgettext now supports 'p'/'P' exponent markers in number tokens, as
     specified in C99 and C++17.
+  - C++:
+    xgettext now supports underscores in number tokens.
   - C++:
     xgettext now supports single-quotes in number tokens, as specified in
     C++14.
index 3dd25499a7dd129ca4efb6546a19d6ceff616c41..e2d4e54484e81509ffde574c3d8db95e98618b45 100644 (file)
@@ -1438,6 +1438,17 @@ phase5_get (token_ty *tp)
             case '.':
               continue;
 
+            case '_':
+              if (cxx_extensions)
+                /* In C++, an underscore can be part of a preprocessing number
+                   token.  */
+                continue;
+              else
+                {
+                  phase4_ungetc (c);
+                  break;
+                }
+
             case '\'':
               if (cxx_extensions)
                 {