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

Add support for null coalescing (?? & ??=) #131

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gamerbross
Copy link
Contributor

Nothing to explain :)

mk(ETernary(
mk(EBinop("==", mk(EIdent(tmp),pmin(e1),pmax(e1)), mk(EIdent("null"),pmin(e1),pmax(e1)))),
e2,
e1
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be tmp to avoid code duplication?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah my bad

Copy link
Member

Choose a reason for hiding this comment

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

This also means that a relevant test is missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i just made one and after the change runs successfully, but maybe pushing it would be a lot of code just for it that now works great. I had to make a new class with a integer variable with a getter function that increases everytime you access it

@gamerbross
Copy link
Contributor Author

should be good now

@gamerbross
Copy link
Contributor Author

Is there any new about this?

@gamerbross
Copy link
Contributor Author

gamerbross commented Jul 17, 2024

btw i just added support for ??= operator

@gamerbross gamerbross changed the title Add support for null coalescing Add support for null coalescing (?? & ??=) Jul 17, 2024
@NeeEoo
Copy link

NeeEoo commented Jul 17, 2024

You should do "??" + "=" since the c++ compiler converts ??= to a #

https://www.geeksforgeeks.org/trigraphs-in-c-with-examples/

@MAJigsaw77
Copy link

@gamerbross

You should do "??" + "=" since the c++ compiler converts ??= to a #

https://www.geeksforgeeks.org/trigraphs-in-c-with-examples/

The cpp tagert will break if you don't make this change .___.

@AbnormalPoof
Copy link

Any updates on this? This would be a great feature to have!

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.

5 participants