pycparser icon indicating copy to clipboard operation
pycparser copied to clipboard

Pragmas in enum declaration raise error

Open corradods opened this issue 4 years ago • 1 comments

Hello, Pycpaser raise a parser error when i try to parse this. It seems pragma are not allowed inside enum types declaration (both the cases). It is possible to fix this, letting the pragma survive to the parsing? The code can be compiled and executed without any problem. I read around this should be c99 compliant.

enum E { A, #pragma MYPRAGMA Z};

enum E2 { #pragma MYPRAGMA X, Y}; void main() { ; }

corradods avatar May 26 '21 13:05 corradods

Yep, pragmas aren't supported within enums now. PRs welcome

eliben avatar May 27 '21 13:05 eliben