Support default
case in the non-last position
This commit is contained in:
@@ -950,7 +950,7 @@ namespace chaiscript
|
||||
}
|
||||
else if (this->children[currentCase]->identifier == AST_Node_Type::Default) {
|
||||
this->children[currentCase]->eval(t_ss);
|
||||
breaking = true;
|
||||
hasMatched = true;
|
||||
}
|
||||
}
|
||||
catch (detail::Break_Loop &) {
|
||||
|
@@ -1807,6 +1807,8 @@ namespace chaiscript
|
||||
|
||||
build_match<eval::Case_AST_Node>(prev_stack_top);
|
||||
} else if (Keyword("default")) {
|
||||
retval = true;
|
||||
|
||||
while (Eol()) {}
|
||||
|
||||
if (!Block()) {
|
||||
|
Reference in New Issue
Block a user