Skip to content

Conversation

@jserv
Copy link
Collaborator

@jserv jserv commented Aug 2, 2025

This commit allows struct members to be declared with multiple variables on the same line, matching standard C syntax. For example:

    struct node {
        struct node *next, *prev;  // Now supported
        int value;
    };

The fix handles comma-separated declarators by parsing additional variables after the first one, inheriting the base type while parsing pointer levels and array dimensions independently for each declarator.

Summary by Bito

This pull request adds support for declaring multiple struct members on the same line in C, enhancing the parsing logic for comma-separated declarations. It updates relevant data structures to support this new syntax and includes tests to ensure functionality.

This commit allows struct members to be declared with multiple variables
on the same line, matching standard C syntax. For example:

    struct node {
        struct node *next, *prev;  // Now supported
        int value;
    };

The fix handles comma-separated declarators by parsing additional
variables after the first one, inheriting the base type while parsing
pointer levels and array dimensions independently for each declarator.
@jserv jserv merged commit 8a263c7 into master Aug 2, 2025
12 checks passed
@jserv jserv deleted the fix-decl branch August 2, 2025 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants