pcpp
pcpp copied to clipboard
LL suffix not parsed correctly
When trying to parse an integer suffixed with "LL", parsing fails. E.g. in
#define very_long_one (1LL)
To reproduce I boiled it down to:
import pcpp
proc = pcpp.Preprocessor()
tokens = proc.tokenize("1LL")
proc.evalexpr(tokens)
Yields:
:3 error: Could not evaluate expression due to SyntaxError("around token 'L' type CPP_ID") (passed to evaluator: '1LL')
This can be easily fixed by changing the CPP_INTEGER regex in pcpp.parser to allow one more optional 'L' at the end, however I'm kind of puzzled why nobody else has ran into this issue. Am I missing something?
We ought to do a better job in pcpp parsing U, L, LL, ULL etc.
Thanks for the BR.