projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
87d687e
)
ISA parser: Match /* */ and // style comments.
author
Gabe Black
<gblack@eecs.umich.edu>
Thu, 8 Sep 2011 10:20:05 +0000
(
03:20
-0700)
committer
Gabe Black
<gblack@eecs.umich.edu>
Thu, 8 Sep 2011 10:20:05 +0000
(
03:20
-0700)
Comments should not be scanned for operands, and we should look for both /* */
style and // style.
src/arch/isa_parser.py
patch
|
blob
|
history
diff --git
a/src/arch/isa_parser.py
b/src/arch/isa_parser.py
index e17a02f01fa21bbd8ac0b1f4a4c20e03611ed920..e7598ffe88ef302944054ecc2fa4af1374120dee 100755
(executable)
--- 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())