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

Empty bracket pairs properly tokenized #1439

Merged
merged 1 commit into from
Nov 1, 2022
Merged

Conversation

oowekyala
Copy link
Collaborator

This allows spaces in empty bracket pairs in types, like int[ ]. Although it doesn't look good, I think it's surprising to make the language space-sensitive in this case only. It also allows commenting things out, eg int[/*4*/].

The change removes one token from the grammar: [] is now tokenized as [ then ], like in C and all other target languages that use these tokens.

This change is extracted from #544

@oowekyala oowekyala requested a review from lhstrh November 1, 2022 14:50
Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

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

If only all PRs were this clean an concise! 😆

@lhstrh lhstrh added the language Related to the syntax and semantics of LF label Nov 1, 2022
@lhstrh lhstrh changed the title Tokenize empty bracket pairs properly Empty bracket pairs properly tokenized Nov 1, 2022
@lhstrh lhstrh merged commit d9095f4 into master Nov 1, 2022
@lhstrh lhstrh deleted the tokenize-empty-width branch November 1, 2022 17:56
@lhstrh lhstrh added the enhancement Enhancement of existing feature label Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing feature language Related to the syntax and semantics of LF
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants