Support break statements
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -48,6 +48,9 @@ namespace Porygon::Binder {
|
||||
return this->BindNumericalForStatement(statement);
|
||||
case ParsedStatementKind::GenericFor:
|
||||
return this -> BindGenericForStatement(statement);
|
||||
case ParsedStatementKind::Break:
|
||||
//TODO: Validate we're in a loop
|
||||
return new BoundBreakStatement();
|
||||
case ParsedStatementKind::Bad:
|
||||
return new BoundBadStatement();
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace Porygon::Binder {
|
||||
Conditional,
|
||||
NumericalFor,
|
||||
GenericFor,
|
||||
Break,
|
||||
};
|
||||
|
||||
class BoundStatement {
|
||||
@@ -38,6 +39,13 @@ namespace Porygon::Binder {
|
||||
}
|
||||
};
|
||||
|
||||
class BoundBreakStatement : public BoundStatement {
|
||||
public:
|
||||
const BoundStatementKind GetKind() const final {
|
||||
return BoundStatementKind::Break;
|
||||
}
|
||||
};
|
||||
|
||||
class BoundBlockStatement : public BoundStatement {
|
||||
const vector<BoundStatement *> _statements;
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user