summaryrefslogtreecommitdiff
path: root/src/arch/isa_parser.py
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2011-09-08 03:20:05 -0700
committerGabe Black <gblack@eecs.umich.edu>2011-09-08 03:20:05 -0700
commitf4dc64655f5ff3e0c33be7a9129ee423809e7a19 (patch)
tree92bc9f18956e506c54e45075ae556cbacde229fd /src/arch/isa_parser.py
parent87d687e242e3437e7e3a83e04bf9a403d95b3e9e (diff)
downloadgem5-f4dc64655f5ff3e0c33be7a9129ee423809e7a19.tar.xz
ISA parser: Match /* */ and // style comments.
Comments should not be scanned for operands, and we should look for both /* */ style and // style.
Diffstat (limited to 'src/arch/isa_parser.py')
-rwxr-xr-xsrc/arch/isa_parser.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/arch/isa_parser.py b/src/arch/isa_parser.py
index e17a02f01..e7598ffe8 100755
--- a/src/arch/isa_parser.py
+++ b/src/arch/isa_parser.py
@@ -856,7 +856,8 @@ class SubOperandList(OperandList):
# Regular expression object to match C++ comments
# (used in findOperands())
-commentRE = re.compile(r'//.*\n')
+commentRE = re.compile(r'(^)?[^\S\n]*/(?:\*(.*?)\*/[^\S\n]*|/[^\n]*)($)?',
+ re.DOTALL | re.MULTILINE)
# Regular expression object to match assignment statements
# (used in findOperands())