Change 'elseif' to 'else if' to better support C++ expectations
This commit is contained in:
@@ -531,7 +531,7 @@ namespace chaiscript
|
||||
cond = dispatchkit::boxed_cast<bool &>(retval);
|
||||
}
|
||||
catch (const dispatchkit::bad_boxed_cast &) {
|
||||
throw Eval_Error("Elseif condition not boolean", node->children[i+1]);
|
||||
throw Eval_Error("'else if' condition not boolean", node->children[i+1]);
|
||||
}
|
||||
if (cond) {
|
||||
retval = eval_token(ss, node->children[i+2]);
|
||||
|
@@ -846,7 +846,9 @@ namespace chaiscript
|
||||
while (has_matches) {
|
||||
while (Eol());
|
||||
has_matches = false;
|
||||
if (Keyword("elseif", true)) {
|
||||
if (Keyword("else", true)) {
|
||||
if (Keyword("if")) {
|
||||
match_stack.back()->text = "else if";
|
||||
if (!Char('(')) {
|
||||
throw Eval_Error("Incomplete 'else if' expression", File_Position(line, col), filename);
|
||||
}
|
||||
@@ -862,7 +864,7 @@ namespace chaiscript
|
||||
}
|
||||
has_matches = true;
|
||||
}
|
||||
else if (Keyword("else", true)) {
|
||||
else {
|
||||
while (Eol());
|
||||
|
||||
if (!Block()) {
|
||||
@@ -871,6 +873,7 @@ namespace chaiscript
|
||||
has_matches = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
build_match(Token_Type::If, prev_stack_top);
|
||||
}
|
||||
|
Reference in New Issue
Block a user