Skip to content

Incorrect removal of parentheses after the comma operator followed by a compound statement #560

@kousuke3021

Description

@kousuke3021

When converting the following code into an Abstract Syntax Tree (AST) and generating code from it using pycparser, the parentheses surrounding a compound statement are removed, resulting in code that fails to compile due to a syntax error.

void test(){
    (sizeof (0), ({ if (0) ; else ; }));
}

The generated code appears as follows:

void test(){
    sizeof (0), { if (0) ; else ; };
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions