Skip to content
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

[Bug] Anomaly in array type parsing #2016

Closed
acoglio opened this issue Sep 26, 2023 · 0 comments · Fixed by #2017
Closed

[Bug] Anomaly in array type parsing #2016

acoglio opened this issue Sep 26, 2023 · 0 comments · Fixed by #2017
Labels
bug Something isn't working

Comments

@acoglio
Copy link
Contributor

acoglio commented Sep 26, 2023

Maybe not a (serious) bug, but at least anomalous behavior.

This works

cast r5 into r7 as /* comment */ [u8; 10u32];

while this does not work

cast r5 into r7 as /* comment */ u8;

The culprit is this line, which parses comments and whitespace at the beginning of an array type. Array types are one of three kind of plaintext types, the other two being literal types and identifiers: neither the parser of literal types nor the parser for identifiers parse comment and whitespace at the beginning; their callers parse whitespace (not comments). So the proposal is to remove the culprit line, and treat array types the same as the other plaintext types when parsing.

@acoglio acoglio added the bug Something isn't working label Sep 26, 2023
acoglio added a commit that referenced this issue Sep 26, 2023
@howardwu howardwu mentioned this issue Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant