isa_parser: allow negative integer literals
authorNathan Binkert <nate@binkert.org>
Fri, 6 Nov 2009 01:21:25 +0000 (17:21 -0800)
committerNathan Binkert <nate@binkert.org>
Fri, 6 Nov 2009 01:21:25 +0000 (17:21 -0800)
src/arch/isa_parser.py

index 2db7c6aa6d134590286fa5d22143d3718b35e708..bd45a83135873a77408b29e57cb99b3d16d24a6e 100755 (executable)
@@ -128,7 +128,7 @@ class ISAParser(Grammar):
 
     # Integer literal
     def t_INTLIT(self, t):
-        r'(0x[\da-fA-F]+)|\d+'
+        r'-?(0x[\da-fA-F]+)|\d+'
         try:
             t.value = int(t.value,0)
         except ValueError: