diff options
Diffstat (limited to 'src/arch/isa_parser.py')
-rwxr-xr-x | src/arch/isa_parser.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/arch/isa_parser.py b/src/arch/isa_parser.py index 863c7c70e..c0cdebe11 100755 --- a/src/arch/isa_parser.py +++ b/src/arch/isa_parser.py @@ -1851,21 +1851,21 @@ StaticInstPtr # Define operand variables. operands = user_dict.keys() + extensions = self.operandTypeMap.keys() - operandsREString = (r''' - (?<![\w\.]) # neg. lookbehind assertion: prevent partial matches - ((%s)(?:\.(\w+))?) # match: operand with optional '.' then suffix - (?![\w\.]) # neg. lookahead assertion: prevent partial matches - ''' - % string.join(operands, '|')) + operandsREString = r''' + (?<!\w) # neg. lookbehind assertion: prevent partial matches + ((%s)(?:_(%s))?) # match: operand with optional '_' then suffix + (?!\w) # neg. lookahead assertion: prevent partial matches + ''' % (string.join(operands, '|'), string.join(extensions, '|')) self.operandsRE = re.compile(operandsREString, re.MULTILINE|re.VERBOSE) # Same as operandsREString, but extension is mandatory, and only two # groups are returned (base and ext, not full name as above). # Used for subtituting '_' for '.' to make C++ identifiers. - operandsWithExtREString = (r'(?<![\w\.])(%s)\.(\w+)(?![\w\.])' - % string.join(operands, '|')) + operandsWithExtREString = r'(?<!\w)(%s)_(%s)(?!\w)' \ + % (string.join(operands, '|'), string.join(extensions, '|')) self.operandsWithExtRE = \ re.compile(operandsWithExtREString, re.MULTILINE) |