summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2016-11-20 17:01:18 +0100
committertomsmeding <tom.smeding@gmail.com>2016-11-20 17:01:18 +0100
commitefe58ee75044352809cc755fdb46fcdda8a7ad02 (patch)
tree1d72ba2f9d28875e57cfa455dd7eb51de206aba5
parent91e5244add56bf284142ba332931377622e876c6 (diff)
Make local functions static
-rw-r--r--environment.cpp17
-rw-r--r--environment.h3
2 files changed, 11 insertions, 9 deletions
diff --git a/environment.cpp b/environment.cpp
index cb4b0e4..e36031b 100644
--- a/environment.cpp
+++ b/environment.cpp
@@ -52,7 +52,7 @@ AST Environment::get(const Name &name){
// ------------------------------------------------------------
-void indexReplace(AST &ast,const Name &name,Index index){
+static void indexReplace(AST &ast,const Name &name,Index index){
if(ast.quoted){
return;
}
@@ -86,7 +86,7 @@ void indexReplace(AST &ast,const Name &name,Index index){
}
-void indexify(AST &ast){
+static void indexify(AST &ast){
if(ast.quoted){
return;
}
@@ -113,7 +113,7 @@ void indexify(AST &ast){
}
}
-void singlify(AST &ast){
+static void singlify(AST &ast){
if(ast.quoted){
return;
}
@@ -169,7 +169,7 @@ AST Environment::run(const AST &astinput){
}
-void recursiveFindLevel(AST &ast,Index index,vector<pair<AST*,Index>> &nodes){
+static void recursiveFindLevel(AST &ast,Index index,vector<pair<AST*,Index>> &nodes){
if(ast.quoted){
return;
}
@@ -200,7 +200,7 @@ void recursiveFindLevel(AST &ast,Index index,vector<pair<AST*,Index>> &nodes){
}
-void increaseFree(AST &ast,Index amount,Index fromIndex){
+static void increaseFree(AST &ast,Index amount,Index fromIndex){
if(ast.quoted){
return;
}
@@ -231,7 +231,7 @@ void increaseFree(AST &ast,Index amount,Index fromIndex){
}
-bool hasFree(AST &ast,Index fromIndex){
+static bool hasFree(AST &ast,Index fromIndex){
if(ast.quoted){
return false;
}
@@ -329,12 +329,13 @@ bool Environment::betareduce(AST &ast,i64 depth){
}
-void etareduce(AST &ast){
+static bool etareduce(AST &ast){
if(ast.quoted){
- return;
+ return false;
}
// do nothing yet
+ return false;
}
diff --git a/environment.h b/environment.h
index 5776122..bc86efb 100644
--- a/environment.h
+++ b/environment.h
@@ -18,8 +18,9 @@ private:
unordered_map<string,AST> defs;
unordered_map<string,Hook> hooks;
- void reduce(AST &ast,i64 depth=0);
+ bool reduce(AST &ast,i64 depth=0);
bool betareduce(AST &ast,i64 depth);
+ bool resolve(AST &ast);
public:
void load(const Environment &other);