ned14 / pcpp

A C99 preprocessor written in pure Python
Other
220 stars 41 forks source link

Escape special regex character '.' in t_CPP_DOT #41

Closed JasperCraeghs closed 4 years ago

JasperCraeghs commented 4 years ago

Special regex character . needs to be excaped in t_CPP_DOT, which is used as a regex pattern. This bug was encounterd about 1/5th of the time while using Python 3.5 on input #if !defined(FOO). Since Python 3.6+ dictionaries are order-preserving so this bug never occurred for this particular input with more recent Python versions.

ned14 commented 4 years ago

Thanks for the bug fix!