ned14 / pcpp

A C99 preprocessor written in pure Python
Other
215 stars 39 forks source link

Fixes errors with ternary operator paranthesis and chars. #8

Closed untaugh closed 6 years ago

untaugh commented 6 years ago

This would fix cases:

if ((1?2:3) < 2)

if L'\0' - 1 > 0

ned14 commented 6 years ago

Thanks for the contribution of char literal support in expression, works nicely. I wasn't able to merge the ternary fix, it breaks the test suite, and given the terrible non-parsing implementation we rely heavily on being able to wrap the first argument in brackets to cause "the right thing" to happen.