From f4dc64655f5ff3e0c33be7a9129ee423809e7a19 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 8 Sep 2011 03:20:05 -0700 Subject: ISA parser: Match /* */ and // style comments. Comments should not be scanned for operands, and we should look for both /* */ style and // style. --- src/arch/isa_parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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()) -- cgit v1.2.3