eliben / pycparser

:snake: Complete C99 parser in pure Python
Other
3.26k stars 612 forks source link

Feature/add pragma support #487

Closed jordr closed 1 year ago

jordr commented 1 year ago

Resolves https://github.com/eliben/pycparser/issues/485 for _Pragma support. After the preprocessing stage, some _Pragmas may remain. This at least lets us parse such code.

I'm not certain about the _token_coord(p, 2)) here though. Might be 3? https://github.com/statinf-software/pycparser/blob/32b35034bf06d76af10054da8cc227b9e6dd75dd/pycparser/c_parser.py#L579-L580

(PS: I get ModuleNotFoundError: No module named '_ast_gen' when trying to run the tests, but I think the test additions still ran and passed.)

jordr commented 1 year ago

Thanks for the help! Looks good to me now.