The RE wasn't correct, since we want to isolate the directive.

Also check for pragma and emit a warning.
This commit is contained in:
Sei Lisa 2016-06-27 18:37:28 +02:00
parent fb83279706
commit 633c31df6c

View file

@ -326,7 +326,7 @@ class parser(object):
r'^#\s*(?:' r'^#\s*(?:'
r'(?:[Ll][Ii][Nn][Ee]\s+)?(\d+)(?:\s+("(?:[^"\\]|\\.)*"))?' r'(?:[Ll][Ii][Nn][Ee]\s+)?(\d+)(?:\s+("(?:[^"\\]|\\.)*"))?'
r'|' r'|'
r'([A-Za-z0-9_]+\s+(.+?))' r'([A-Za-z0-9_]+)\s+(.+?)'
r')\s*$' r')\s*$'
) )
match = self.parse_directive_re.search(directive) match = self.parse_directive_re.search(directive)
@ -350,9 +350,9 @@ class parser(object):
del linenum del linenum
else: else:
assert match.group(3) is not None assert match.group(3) is not None
if match.group(3) == 'pragma': if match.group(3).lower() == 'pragma':
# TODO: process #pragma # TODO: process #pragma
pass warning('pragma not implemented')
def GetToken(self): def GetToken(self):
"""Lexer""" """Lexer"""