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

Support comma operator #160

Merged
merged 6 commits into from
Jun 13, 2024
Merged

Support comma operator #160

merged 6 commits into from
Jun 13, 2024

Conversation

Lai-YT
Copy link
Collaborator

@Lai-YT Lai-YT commented Jun 10, 2024

I considered adding a new node instead of supporting the comma operator as one of the binary operators, since it requires completely different type checking and code generation compared to other binary operators. This is evident from the ad-hoc rules added to both the type checker and code generator. However, I decided to keep it as a binary operator to align with the fact that it is, indeed, a binary operator, similar to how Clang handles it.

Let me know your thoughts on this approach!

@Lai-YT Lai-YT added the enhancement New feature or request label Jun 10, 2024
@Lai-YT Lai-YT requested a review from leewei05 June 10, 2024 08:44
@Lai-YT Lai-YT self-assigned this Jun 10, 2024
This was incorrect precedence, which would break many of the test cases
once we introduce the comma operator.
Although comma operator is one of the binary operators, it has its
special type checking rules. Thus, a new test case is added.
Copy link
Contributor

@leewei05 leewei05 left a comment

Choose a reason for hiding this comment

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

LGTM!

@leewei05 leewei05 merged commit 23c60b5 into main Jun 13, 2024
4 checks passed
@Lai-YT Lai-YT deleted the feat-comma-operator branch June 13, 2024 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants