Open w00tyd00d opened 1 year ago
Temporary workaround: add a break
statement.
switch ($switch_var) {
case 0:
execute run $result = 0;
case 1:
execute run $result = 1;
case 2:
execute run {
$result = 2;
}
break;
case 3:
execute run $result = 3;
}
compiles to what's expected.
Describe the bug
Switch statements that use an anonymous function (specifically with curly brackets) within a case will prevent any subsequent cases from being compiled. Since it needs curly brackets for it to bug, it seems like it's an error in the parser picking up the curly bracket to end the
switch
when it shouldn't.To Reproduce
switch
statement in any.jmc
file.execute
function within a case that uses curly brackets. Any following cases will be ignored by the compiler.Screenshots
JMC code:
Transpiled result:
Desktop