ISA parser: Match /* */ and // style comments.

Comments should not be scanned for operands, and we should look for both /* */
style and // style.
This commit is contained in:
Gabe Black 2011-09-08 03:20:05 -07:00
parent 87d687e242
commit f4dc64655f

View file

@ -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())