We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raises pycparser.plyparser.ParseError when a label is at the end of a block. For example, the following code fails:
pycparser.plyparser.ParseError
from pycparser import CParser ast = CParser().parse( """ int main(){ label: } """ )
As this is valid C, I think it shouldn't throw that exception.
Adding a ; (or any other code line) after the label fixes this issue
;
from pycparser import CParser ast = CParser().parse( """ int main(){ label:; } """ )
The text was updated successfully, but these errors were encountered:
Thanks for the report.
Strictly reading the standard, a labeled-statement requires a statement following the label:, e.g. see section A.2.3 in https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf
labeled-statement
label:
gcc also issues a warning here in "strict" mode.
gcc
I don't object to adding the ability to support this in pycparser, if a PR can be made that doesn't complicate the parser too much.
Sorry, something went wrong.
No branches or pull requests
Raises
pycparser.plyparser.ParseError
when a label is at the end of a block. For example, the following code fails:As this is valid C, I think it shouldn't throw that exception.
Adding a
;
(or any other code line) after the label fixes this issueThe text was updated successfully, but these errors were encountered: