inducer / pycparserext

Extensions for Eli Bendersky's pycparser
http://pypi.python.org/pypi/pycparserext
Other
83 stars 28 forks source link

Improve support for __extension__ keyword #72

Open MartinSpiessl opened 1 year ago

MartinSpiessl commented 1 year ago

This keyword is allowed to appear before expressions in GNU C and serves as a hint to the compiler to not issue a warning in case a GNU C specific extension is used, cf.: https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html

The two additional parser rules in this commit will allow to parse that keyword correctly when it appears before an expression.

For now, the keyword is not reproduced when code is generated from the AST, but this should not be a problem as it is just controlling compiler warnings and does not affect semantics (as outlined above).


this PR will likely lead to an easy-to-solve merge conflict once PR #71 is merged. I would simply update this PR by rebasing in that case. Getting #71 merged first is my preferred order. I considered bundling both changes into one PR but they are really orthogonal and this did not feel right.

inducer commented 1 year ago

I considered bundling both changes into one PR but they are really orthogonal and this did not feel right.

Sounds good. Thanks for making an effort to keep PRs small.