Fix fallthrough warnings
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2019-06-28 13:32:28 +02:00
parent df79489d4d
commit 0d63543ff4
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
3 changed files with 7 additions and 20 deletions

View File

@ -56,6 +56,7 @@ namespace Porygon::Binder {
case ParsedStatementKind::Bad:
return new BoundBadStatement();
}
throw "unreachable";
}
BoundStatement *Binder::BindBlockStatement(const ParsedStatement *statement) {
@ -355,6 +356,7 @@ namespace Porygon::Binder {
case ParsedExpressionKind::Bad:
return new BoundBadExpression(expression->GetStartPosition(), expression->GetLength());
}
throw;
}
BoundExpression *Binder::BindVariableExpression(const VariableExpression *expression) {

View File

@ -266,11 +266,7 @@ namespace Porygon::Evaluation {
case BoundExpressionKind::PeriodIndex:
return dynamic_pointer_cast<NumericEvalValue>(this->EvaluatePeriodIndexExpression(expression));
case BoundExpressionKind::LiteralString:
case BoundExpressionKind::LiteralBool:
case BoundExpressionKind::Bad:
case BoundExpressionKind::NumericalTable:
case BoundExpressionKind::Table:
default:
throw;
}
}
@ -293,12 +289,7 @@ namespace Porygon::Evaluation {
case BoundExpressionKind::PeriodIndex:
return dynamic_pointer_cast<BooleanEvalValue>(this->EvaluatePeriodIndexExpression(expression));
case BoundExpressionKind::Bad:
case BoundExpressionKind::LiteralInteger:
case BoundExpressionKind::LiteralFloat:
case BoundExpressionKind::LiteralString:
case BoundExpressionKind::NumericalTable:
case BoundExpressionKind::Table:
default:
throw;
}
@ -319,13 +310,7 @@ namespace Porygon::Evaluation {
case BoundExpressionKind::PeriodIndex:
return dynamic_pointer_cast<StringEvalValue>(this->EvaluatePeriodIndexExpression(expression));
case BoundExpressionKind::Bad:
case BoundExpressionKind::LiteralInteger:
case BoundExpressionKind::LiteralFloat:
case BoundExpressionKind::LiteralBool:
case BoundExpressionKind::Unary:
case BoundExpressionKind::NumericalTable:
case BoundExpressionKind::Table:
default:
throw;
}

View File

@ -17,7 +17,7 @@ namespace Porygon::Evaluation {
return make_shared<IntegerEvalValue>(-l);
}
}
case BoundUnaryOperation::LogicalNegation:
default:
throw;
}
}
@ -29,7 +29,7 @@ namespace Porygon::Evaluation {
bool b = val->EvaluateBool();
return make_shared<BooleanEvalValue>(!b);
}
case BoundUnaryOperation::Negation:
default:
throw;
}
}