Commit 5589f6fe22f7a974f9df9e5a57d470c586870d06
Committed by
GitHub
1 parent
5525fef1
Updated "decimal_literal" Variable in olevba.py
Updated "decimal_literal" Variable in olevba.py so that it will handle negative integers.
Showing
1 changed file
with
1 additions
and
1 deletions
oletools/olevba.py
| ... | ... | @@ -721,7 +721,7 @@ class VbaExpressionString(str): |
| 721 | 721 | # NOTE: here Combine() is required to avoid spaces between elements |
| 722 | 722 | # NOTE: here WordStart is necessary to avoid matching a number preceded by |
| 723 | 723 | # letters or underscore (e.g. "VBT1" or "ABC_34"), when using scanString |
| 724 | -decimal_literal = Combine(WordStart(vba_identifier_chars) + Word(nums) | |
| 724 | +decimal_literal = Combine(WordStart(vba_identifier_chars) + Word(nums) | Word('-' + nums) | |
| 725 | 725 | + Suppress(Optional(Word('%&^', exact=1)))) |
| 726 | 726 | decimal_literal.setParseAction(lambda t: int(t[0])) |
| 727 | 727 | ... | ... |