Skip to content

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!

@deepnight
Copy link

Also up here, any chance to see "??" making its way to hscript?
I'm quite surprised Shiro didn't need it before?

@ncannasse
Copy link
Member

I think the cpp change should not be made inside the hscript code but inside the haxe compiler code. Please revert the cpp specific changes and open an issue in haxe compiler github.

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.

7 participants