vppapigen: allow negative number in NUM token 58/20258/3
authorOle Troan <ot@cisco.com>
Thu, 20 Jun 2019 12:06:07 +0000 (14:06 +0200)
committerPaul Vinciguerra <pvinci@vinciconsulting.com>
Thu, 20 Jun 2019 22:09:12 +0000 (22:09 +0000)
Change-Id: I964cb44f8604187390009dcef7dd766b3804c3ca
Type: make
Signed-off-by: Ole Troan <ot@cisco.com>
src/tools/vppapigen/vppapigen.py

index 576fa54..9c6b21e 100755 (executable)
@@ -77,7 +77,7 @@ class VPPAPILexer(object):
     t_ignore_LINE_COMMENT = '//.*'
 
     def t_NUM(self, t):
-        r'0[xX][0-9a-fA-F]+|\d+'
+        r'0[xX][0-9a-fA-F]+|-?\d+'
         base = 16 if t.value.startswith('0x') else 10
         t.value = int(t.value, base)
         return t