ned14 / pcpp

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

Bug in t_CPP_FLOAT regex #46

Closed LynnKirby closed 3 years ago

LynnKirby commented 3 years ago

https://github.com/ned14/pcpp/blob/26db1a47d132e7ab4a49780dc165f14f6fc767f5/pcpp/preprocessor.py#L128

The t_CPP_FLOAT regex has spaces in it. Since spaces are interpreted literally, this never matches a float literal.

I only noticed this issue when using the parsed tokens directly. The output text is fine since it just pastes the token sequence together.

ned14 commented 3 years ago

That bug you just found came from David's original preprocessor. You must have very good eyes! Thanks for the report!