Skip to content

parser: add support for multidimensional arrays#31

Merged
Alonely0 merged 2 commits into
uutils:mainfrom
gabrielhnf:parser-add-multidimensional-arrays
May 28, 2026
Merged

parser: add support for multidimensional arrays#31
Alonely0 merged 2 commits into
uutils:mainfrom
gabrielhnf:parser-add-multidimensional-arrays

Conversation

@gabrielhnf
Copy link
Copy Markdown
Contributor

Implements parsing support for multidimensional array access (a[1][2][3])

@Alonely0 Alonely0 marked this pull request as ready for review May 28, 2026 14:39
Copy link
Copy Markdown
Collaborator

@Alonely0 Alonely0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's perfect. Tysm! Could you add some tests? Should be quick with the macro; take the other parser tests for reference.

@gabrielhnf
Copy link
Copy Markdown
Contributor Author

gabrielhnf commented May 28, 2026

Noticed while adding tests that left unary place operators were parsing only one dimensional arrays (++a[1][2] became (++a[1])[2]), so I had to tweak fn parse_place as well to handle multidimensional arrays, let me know if you prefer a different approach or any more tests.

Copy link
Copy Markdown
Collaborator

@Alonely0 Alonely0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch with the increment/decrement operators, and overall great job. I got nothing else to add, so we can merge right away. Ty!

@Alonely0 Alonely0 merged commit 1df4886 into uutils:main May 28, 2026
12 of 13 checks passed
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