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

View File

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

View File

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