public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] conform/conformtest.py: Extend tokenizer to cover character constants
@ 2020-02-17 19:34 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2020-02-17 19:34 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1f1c65e232878bca88fe8551318c7bc02b90ee90

commit 1f1c65e232878bca88fe8551318c7bc02b90ee90
Author: Florian Weimer <fweimer@redhat.com>
Date:   Mon Feb 17 17:18:49 2020 +0100

    conform/conformtest.py: Extend tokenizer to cover character constants
    
    Such constants are used in __USE_EXTERN_INLINES blocks.

Diff:
---
 conform/conformtest.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/conform/conformtest.py b/conform/conformtest.py
index 951e3b2..cb2bd97 100644
--- a/conform/conformtest.py
+++ b/conform/conformtest.py
@@ -633,12 +633,11 @@ class HeaderTests(object):
                     bad_tokens.discard(match.group(1))
                     continue
                 # Tokenize the line and check identifiers found.  The
-                # handling of strings does not allow for escaped
-                # quotes, no allowance is made for character
-                # constants, and hex floats may be wrongly split into
-                # tokens including identifiers, but this is sufficient
-                # in practice and matches the old perl script.
-                line = re.sub(r'"[^"]*"', '', line)
+                # handling of strings and character constants does not
+                # allow for escaped quotes, and hex floats may be
+                # wrongly split into tokens including identifiers, but
+                # this is sufficient in practice.
+                line = re.sub(r'(?:\bL)?(?:"[^"]*"|\'[^\']*\')', '', line)
                 line = line.strip()
                 for token in re.split(r'[^A-Za-z0-9_]+', line):
                     if re.match(r'[A-Za-z_]', token):


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-17 19:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-17 19:34 [glibc] conform/conformtest.py: Extend tokenizer to cover character constants Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).