mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-13 09:01:51 +03:00
conform/conformtest.py: Extend tokenizer to cover character constants
Such constants are used in __USE_EXTERN_INLINES blocks.
This commit is contained in:
@ -633,12 +633,11 @@ class HeaderTests(object):
|
|||||||
bad_tokens.discard(match.group(1))
|
bad_tokens.discard(match.group(1))
|
||||||
continue
|
continue
|
||||||
# Tokenize the line and check identifiers found. The
|
# Tokenize the line and check identifiers found. The
|
||||||
# handling of strings does not allow for escaped
|
# handling of strings and character constants does not
|
||||||
# quotes, no allowance is made for character
|
# allow for escaped quotes, and hex floats may be
|
||||||
# constants, and hex floats may be wrongly split into
|
# wrongly split into tokens including identifiers, but
|
||||||
# tokens including identifiers, but this is sufficient
|
# this is sufficient in practice.
|
||||||
# in practice and matches the old perl script.
|
line = re.sub(r'(?:\bL)?(?:"[^"]*"|\'[^\']*\')', '', line)
|
||||||
line = re.sub(r'"[^"]*"', '', line)
|
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
for token in re.split(r'[^A-Za-z0-9_]+', line):
|
for token in re.split(r'[^A-Za-z0-9_]+', line):
|
||||||
if re.match(r'[A-Za-z_]', token):
|
if re.match(r'[A-Za-z_]', token):
|
||||||
|
Reference in New Issue
Block a user