We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Given this code:
a = 3 until a.negative? a -= 1 next if a == 1 p "a = #{a}" end p a
Cruby has the following output:
"a = 2" "a = 0" "a = -1" -1
Natalie stops as soon as the next is hit:
next
"a = 2"
The code generated looks like this:
env->set_line(4); auto send_6 = a_var.public_send(env, symbols[3]/*:==*/, Args({ Value::integer(1) }, false), nullptr, self); Value if_result7; if (send_6->is_truthy()) { return Value(NilObject::the()); if_result7 = Value(NilObject::the()); } else { if_result7 = Value(NilObject::the()); }
The return in the truthy path is not what we need.
return
The text was updated successfully, but these errors were encountered:
Remove next from scheduler
96f887a
This pattern does not work as expected in Natalie, see natalie-lang#1337 for the bug report.
933da9a
b6b8f8c
Fix next inside while and until loops
while
until
2100d90
Fixes #1337
bdb5d72
Successfully merging a pull request may close this issue.
Given this code:
Cruby has the following output:
Natalie stops as soon as the
next
is hit:The code generated looks like this:
The
return
in the truthy path is not what we need.The text was updated successfully, but these errors were encountered: