-
Notifications
You must be signed in to change notification settings - Fork 614
New issue
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
Parehthesized compount statements #538
Labels
Comments
Can you provide a minimal, complete reproducer? |
pycparser version: __version__ = '2.22' Input: from pycparser import c_parser, c_generator
src1 = '''
float f1( float __K1, float __K2 ) {
float __left_0 = ( {
float __x1_1 = __K1;
float __x2_1 = __K2;
( __x1_1 < __x2_1 ) ? __x1_1 : __x2_1;
} );
return __left_0;
}
'''
src2 = '''
float f2( float __iz_3, float __T1, float __T2 ) {
float __df_3 = __iz_3 / ( {
float __x1_4 = __T1;
float __x2_4 = __T2;
( __x1_4 > __x2_4 ) ? __x1_4 : __x2_4;
} );
return __df_3;
}
'''
def c2c(src):
parser = c_parser.CParser()
ast = parser.parse(src)
generator = c_generator.CGenerator()
return generator.visit(ast)
print(c2c(src1))
print(c2c(src2)) Output:
|
Thanks. This is probably not too hard to fix for someone motivated enough to dig into the code. PRs welcome :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This expression are processed correctly:
But this valid expression
causes a traceback with parsing error:
The text was updated successfully, but these errors were encountered: