From: Gabe Black Date: Thu, 8 Sep 2011 10:20:05 +0000 (-0700) Subject: ISA parser: Match /* */ and // style comments. X-Git-Tag: stable_2012_02_02~98 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f4dc64655f5ff3e0c33be7a9129ee423809e7a19;p=gem5.git ISA parser: Match /* */ and // style comments. Comments should not be scanned for operands, and we should look for both /* */ style and // style. --- 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())