diff options
author | Florian Weimer <fweimer@redhat.com> | 2020-02-17 17:18:49 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2020-02-17 20:32:28 +0100 |
commit | 1f1c65e232878bca88fe8551318c7bc02b90ee90 (patch) | |
tree | 86c03cf30cbac0a376ae09e7ad94e23a28b96528 | |
parent | ab3df8154f9176f7935cbc297aed97092c5e8103 (diff) | |
download | glibc-1f1c65e232878bca88fe8551318c7bc02b90ee90.tar.gz |
conform/conformtest.py: Extend tokenizer to cover character constants
Such constants are used in __USE_EXTERN_INLINES blocks.
-rw-r--r-- | conform/conformtest.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/conform/conformtest.py b/conform/conformtest.py index 951e3b2420..cb2bd97eca 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): |