summaryrefslogtreecommitdiff
path: root/ast.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ast.cpp')
-rw-r--r--ast.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/ast.cpp b/ast.cpp
index d903ad5..b57b5ef 100644
--- a/ast.cpp
+++ b/ast.cpp
@@ -44,10 +44,10 @@ ostream& operator<<(ostream &os,Site site){
}
-Scope::Scope():type(Type::direct){}
-Scope::Scope(Type type,const StatementList &body,const vector<Expression> &args)
+ScopeDef::ScopeDef():type(Type::direct){}
+ScopeDef::ScopeDef(Type type,const StatementList &body,const vector<Expression> &args)
:type(type),body(body),args(args){}
-/*Scope::Scope(Type type,const StatementList &body,const vector<Name> &nameargs)
+/*ScopeDef::ScopeDef(Type type,const StatementList &body,const vector<Name> &nameargs)
:type(type),body(body){
for(const Name &n : nameargs){
args.emplace_back(Expression::Type::call,n,vector<Expression>());
@@ -58,11 +58,11 @@ string indent(int amount){
return string(amount,'\t');
}
-ostream& operator<<(ostream &os,const Scope &scope){
+ostream& operator<<(ostream &os,const ScopeDef &scope){
switch(scope.type){
- case Scope::Type::direct: break;
- case Scope::Type::lazy: os<<'?'; break;
- case Scope::Type::function: os<<"??"; break;
+ case ScopeDef::Type::direct: break;
+ case ScopeDef::Type::lazy: os<<'?'; break;
+ case ScopeDef::Type::function: os<<"??"; break;
}
if(scope.args.size()!=0){
os<<'(';
@@ -98,7 +98,7 @@ Expression::Expression(Type type,const Name &name,const Expression &arg)
throw runtime_error("Expression(type,name,arg) called with invalid type "+to_string(type));
}
}
-Expression::Expression(Type type,const Name &name,const vector<Expression> &args,const Scope &scope)
+Expression::Expression(Type type,const Name &name,const vector<Expression> &args,const ScopeDef &scope)
:type(type),name(name),args(args),scope(scope){
if(type!=Type::dive){
throw runtime_error("Expression(type,name,args,scope) called with invalid type "+to_string(type));
@@ -116,7 +116,7 @@ Expression::Expression(Type type,const string &strval)
throw runtime_error("Expression(type,strval) called with invalid type "+to_string(type));
}
}
-Expression::Expression(Type type,const Scope &scope)
+Expression::Expression(Type type,const ScopeDef &scope)
:type(type),scope(scope){
if(type!=Type::scope){
throw runtime_error("Expression(type,scope) called with invalid type "+to_string(type));