diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2011-06-07 00:46:54 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2011-06-07 00:46:54 -0700 |
commit | ab3704170e4b9e3f3ece995d6209c353a463a4a1 (patch) | |
tree | be4a91d02e9d1336b9c8cd9abe340fa0ab47864e /src/arch | |
parent | a59a143a25bdc7d794cdcc8ebb6e8d2f37903015 (diff) | |
download | gem5-ab3704170e4b9e3f3ece995d6209c353a463a4a1.tar.xz |
ISA parser: Loosen the regular expressions matching filenames.
The regular expressions matching filenames in the ##include directives and the
internally generated ##newfile directives where only looking for filenames
composed of alpha numeric characters, periods, and dashes. In Unix/Linux, the
rules for what characters can be in a filename are much looser than that. This
change replaces those expressions with ones that look for anything other than
a quote character. Technically quote characters are allowed as well so we
should allow escaping them somehow, but the additional complexity probably
isn't worth it.
Diffstat (limited to 'src/arch')
-rwxr-xr-x | src/arch/isa_parser.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/arch/isa_parser.py b/src/arch/isa_parser.py index 947742354..6cc113142 100755 --- a/src/arch/isa_parser.py +++ b/src/arch/isa_parser.py @@ -1215,7 +1215,7 @@ class ISAParser(Grammar): return t def t_NEWFILE(self, t): - r'^\#\#newfile\s+"[\w/.-]*"' + r'^\#\#newfile\s+"[^"]*"' self.fileNameStack.push((t.value[11:-1], t.lexer.lineno)) t.lexer.lineno = 0 @@ -1998,7 +1998,7 @@ StaticInstPtr f.close() # This regular expression matches '##include' directives - includeRE = re.compile(r'^\s*##include\s+"(?P<filename>[\w/.-]*)".*$', + includeRE = re.compile(r'^\s*##include\s+"(?P<filename>[^"]*)".*$', re.MULTILINE) def replace_include(self, matchobj, dirname): |