Change 'elseif' to 'else if' to better support C++ expectations

This commit is contained in:
Jonathan Turner
2009-07-17 14:16:27 +00:00
parent 689143aba5
commit ac817ff33a
4 changed files with 25 additions and 22 deletions

View File

@@ -525,13 +525,13 @@ namespace chaiscript
retval = eval_token(ss, node->children[i+1]);
cond = true;
}
else if (node->children[i]->text == "elseif") {
else if (node->children[i]->text == "else if") {
retval = eval_token(ss, node->children[i+1]);
try {
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]);