Commit bacfd4b65e7a6e626f4c423ae119f3b4d7d2f4bb

Authored by Philippe Lagadec
Committed by GitHub
2 parents 94caa668 45215e20

Merge pull request #127 from w3tmo/master

Updated "decimal_literal" Variable in olevba.py to handle negative integers
Showing 1 changed file with 1 additions and 1 deletions
oletools/olevba.py
... ... @@ -755,7 +755,7 @@ class VbaExpressionString(str):
755 755 # NOTE: here Combine() is required to avoid spaces between elements
756 756 # NOTE: here WordStart is necessary to avoid matching a number preceded by
757 757 # letters or underscore (e.g. "VBT1" or "ABC_34"), when using scanString
758   -decimal_literal = Combine(WordStart(vba_identifier_chars) + Word(nums)
  758 +decimal_literal = Combine(WordStart(vba_identifier_chars) + Optional('-') + Word(nums)
759 759 + Suppress(Optional(Word('%&^', exact=1))))
760 760 decimal_literal.setParseAction(lambda t: int(t[0]))
761 761  
... ...