-
Notifications
You must be signed in to change notification settings - Fork 839
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
在if-else、嵌套if中使用continue无法生效 #394
Comments
似乎是 continue 的 bug,我看下 |
确认是严重的 bug,惭愧,竟然测试用例没有覆盖到 continue 这个 case,我尽快修复发个版本。 在 continue 和 if/else 共同出现,或者continue 和嵌套 if 的场景,会出现此不符合预期的行为。问题出在 IfCallccFunction 函数的实现上。 |
好的,辛苦了。 |
killme2008
added a commit
that referenced
this issue
Jun 22, 2021
killme2008
added a commit
that referenced
this issue
Jun 22, 2021
@saber-Railgun 已修复,可以用 v5.2.6 这个分支来测试,回忆下应该是当时做重构,忘了去掉这个判断条件了,太尴尬了。 今天会发布掉 5.2.6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
使用版本为5.2.1。
for i in range(0, 10) {
if (i == 3) {
continue;
} else {
let j = 10 + i;
}
p(i);
}
如上述代码,参照java中continue的语义,应该不会打印3。但实际运行结果是打印了3,截图如下
for i in range(0, 10) {
if (i == 3) {
continue;
}
p(i);
}
如果去掉else,则运行结果就不会打印3了,截图如下
根据语雀中对于continue关键字的定义,并没有提到上述相关特性。https://www.yuque.com/boyan-avfmj/aviatorscript/vfqgqn
请问这是个bug还是文档描述不清晰呢?
在嵌套if中同样无法生效。代码示例如下
for i in range(0, 10) {
if (i>3) {
if (i==4){
continue;
}
}
p(i);
}
输出为
The text was updated successfully, but these errors were encountered: