Fix some minor issues found by clang's static analyzer

This commit is contained in:
Jason Turner
2012-05-19 09:16:21 -06:00
parent ae02706c71
commit 0fd4b828f2

View File

@@ -1459,12 +1459,9 @@ namespace chaiscript
* Reads a switch statement from input
*/
bool Switch() {
bool retval = false;
size_t prev_stack_top = m_match_stack.size();
if (Keyword("switch")) {
retval = true;
if (!Char('(')) {
throw exception::eval_error("Incomplete 'switch' expression", File_Position(m_line, m_col), *m_filename);
@@ -1477,8 +1474,6 @@ namespace chaiscript
while (Eol()) {}
if (Char('{')) {
retval = true;
while (Eol()) {}
while (Case()) {
@@ -1496,9 +1491,12 @@ namespace chaiscript
}
build_match(AST_NodePtr(new eval::Switch_AST_Node()), prev_stack_top);
return true;
} else {
return false;
}
return retval;
}
/**
@@ -1971,7 +1969,6 @@ namespace chaiscript
bool saw_eol = true;
while (has_more) {
has_more = false;
int prev_line = m_line;
int prev_col = m_col;
if (Def()) {