Do not capture unused regexp groups

This commit is contained in:
Thomas Nagy 2016-03-25 12:56:25 +01:00
parent 5d8d7bf700
commit df7fc838ce
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
1 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ g_optrans = {
# ignore #warning and #error
re_lines = re.compile(
'^[ \t]*(#|%:)[ \t]*(ifdef|ifndef|if|else|elif|endif|include|import|define|undef|pragma)[ \t]*(.*)\r*$',
'^[ \t]*(?:#|%:)[ \t]*(ifdef|ifndef|if|else|elif|endif|include|import|define|undef|pragma)[ \t]*(.*)\r*$',
re.IGNORECASE | re.MULTILINE)
"""Match #include lines"""
@ -156,7 +156,7 @@ def filter_comments(filename):
for (a, b) in trig_def: code = code.split(a).join(b)
code = re_nl.sub('', code)
code = re_cpp.sub(repl, code)
return [(m.group(2), m.group(3)) for m in re_lines.finditer(code)]
return [(m.group(1), m.group(2)) for m in re_lines.finditer(code)]
prec = {}
"""