-
Notifications
You must be signed in to change notification settings - Fork 101
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
base: master
Are you sure you want to change the base?
Conversation
hscript/Parser.hx
Outdated
mk(ETernary( | ||
mk(EBinop("==", mk(EIdent(tmp),pmin(e1),pmax(e1)), mk(EIdent("null"),pmin(e1),pmax(e1)))), | ||
e2, | ||
e1 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah my bad
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
should be good now |
Is there any new about this? |
btw i just added support for |
??
& ??=
)
You should do "??" + "=" since the c++ compiler converts ??= to a # |
The cpp tagert will break if you don't make this change .___. |
Nothing to explain :)