Change for to use statements instead of expressions for init and step
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include "AST/ForStatement.h"
|
||||
#include "AST/ASTVisitor.h"
|
||||
|
||||
ForStatement::ForStatement(Expression *init, Expression *cond, Expression *step, Statement *stmt) : init_(init), cond_(cond), step_(step), stmt_(stmt) {
|
||||
ForStatement::ForStatement(Statement *init, Expression *cond, Statement *step, Statement *stmt) : init_(init), cond_(cond), step_(step), stmt_(stmt) {
|
||||
//
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ void ForStatement::accept(ASTVisitor* visitor) {
|
||||
visitor->visit(this);
|
||||
}
|
||||
|
||||
Expression* ForStatement::getInit() {
|
||||
Statement* ForStatement::getInit() {
|
||||
return init_;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ Expression* ForStatement::getCond() {
|
||||
return cond_;
|
||||
}
|
||||
|
||||
Expression* ForStatement::getStep() {
|
||||
Statement* ForStatement::getStep() {
|
||||
return step_;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "AST/RandomForStatement.h"
|
||||
#include "AST/ASTVisitor.h"
|
||||
|
||||
RandomForStatement::RandomForStatement(Expression *init, Expression *prob, Expression *step, Statement *stmt) : init_(init),prob_(prob),step_(step),stmt_(stmt)
|
||||
RandomForStatement::RandomForStatement(Statement *init, Expression *prob, Statement *step, Statement *stmt) : init_(init),prob_(prob),step_(step),stmt_(stmt)
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -14,7 +14,7 @@ void RandomForStatement::accept(ASTVisitor *visitor) {
|
||||
visitor->visit(this);
|
||||
}
|
||||
|
||||
Expression* RandomForStatement::getInit() {
|
||||
Statement *RandomForStatement::getInit() {
|
||||
return init_;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ Expression* RandomForStatement::getProb() {
|
||||
return prob_;
|
||||
}
|
||||
|
||||
Expression* RandomForStatement::getStep() {
|
||||
Statement* RandomForStatement::getStep() {
|
||||
return step_;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user