aboutsummaryrefslogtreecommitdiffstats
path: root/typing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'typing.cpp')
-rw-r--r--typing.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/typing.cpp b/typing.cpp
index 759a418..161a959 100644
--- a/typing.cpp
+++ b/typing.cpp
@@ -22,9 +22,9 @@
***************************************************************************/
void
-ASTTuple::constrain(TEnv& tenv) const
+ATuple::constrain(TEnv& tenv) const
{
- AType* t = new AType(ASTTuple(), loc);
+ AType* t = new AType(ATuple(), loc);
FOREACH(const_iterator, p, *this) {
(*p)->constrain(tenv);
t->push_back(tenv.type(*p));
@@ -33,7 +33,7 @@ ASTTuple::constrain(TEnv& tenv) const
}
void
-ASTClosure::constrain(TEnv& tenv) const
+AClosure::constrain(TEnv& tenv) const
{
at(1)->constrain(tenv);
at(2)->constrain(tenv);
@@ -43,22 +43,22 @@ ASTClosure::constrain(TEnv& tenv) const
}
void
-ASTCall::constrain(TEnv& tenv) const
+ACall::constrain(TEnv& tenv) const
{
FOREACH(const_iterator, p, *this)
(*p)->constrain(tenv);
AType* retT = tenv.type(this);
- AType* argsT = new AType(ASTTuple(), loc);
+ AType* argsT = new AType(ATuple(), loc);
for (size_t i = 1; i < size(); ++i)
argsT->push_back(tenv.type(at(i)));
tenv.constrain(at(0), new AType(at(0)->loc, tenv.penv.sym("Fn"), argsT, retT, 0));
}
void
-ASTDefinition::constrain(TEnv& tenv) const
+ADefinition::constrain(TEnv& tenv) const
{
if (size() != 3) throw Error("`def' requires exactly 2 arguments", loc);
- if (!dynamic_cast<const ASTSymbol*>(at(1)))
+ if (!dynamic_cast<const ASymbol*>(at(1)))
throw Error("`def' name is not a symbol", loc);
FOREACH(const_iterator, p, *this)
(*p)->constrain(tenv);
@@ -68,7 +68,7 @@ ASTDefinition::constrain(TEnv& tenv) const
}
void
-ASTIf::constrain(TEnv& tenv) const
+AIf::constrain(TEnv& tenv) const
{
if (size() < 3) throw Error("`if' requires exactly 3 arguments", loc);
if (size() % 2 != 0) throw Error("`if' missing final else clause", loc);
@@ -86,9 +86,9 @@ ASTIf::constrain(TEnv& tenv) const
}
void
-ASTPrimitive::constrain(TEnv& tenv) const
+APrimitive::constrain(TEnv& tenv) const
{
- const string n = dynamic_cast<ASTSymbol*>(at(0))->str();
+ const string n = dynamic_cast<ASymbol*>(at(0))->str();
enum { ARITHMETIC, BINARY, BITWISE, COMPARISON } type;
if (n == "+" || n == "-" || n == "*" || n == "/")
type = ARITHMETIC;
@@ -136,7 +136,7 @@ ASTPrimitive::constrain(TEnv& tenv) const
}
void
-ASTConsCall::constrain(TEnv& tenv) const
+AConsCall::constrain(TEnv& tenv) const
{
if (size() != 3) throw Error("`cons' requires exactly 2 arguments", loc);
AType* t = new AType(loc, tenv.penv.sym("Pair"), 0);
@@ -148,7 +148,7 @@ ASTConsCall::constrain(TEnv& tenv) const
}
void
-ASTCarCall::constrain(TEnv& tenv) const
+ACarCall::constrain(TEnv& tenv) const
{
if (size() != 2) throw Error("`car' requires exactly 1 argument", loc);
at(1)->constrain(tenv);
@@ -159,7 +159,7 @@ ASTCarCall::constrain(TEnv& tenv) const
}
void
-ASTCdrCall::constrain(TEnv& tenv) const
+ACdrCall::constrain(TEnv& tenv) const
{
if (size() != 2) throw Error("`cdr' requires exactly 1 argument", loc);
at(1)->constrain(tenv);
@@ -175,14 +175,14 @@ ASTCdrCall::constrain(TEnv& tenv) const
***************************************************************************/
static void
-substitute(ASTTuple* tup, AST* from, AST* to)
+substitute(ATuple* tup, AST* from, AST* to)
{
if (!tup) return;
for (size_t i = 0; i < tup->size(); ++i)
if (*tup->at(i) == *from)
tup->at(i) = to;
else
- substitute(dynamic_cast<ASTTuple*>(tup->at(i)), from, to);
+ substitute(dynamic_cast<ATuple*>(tup->at(i)), from, to);
}
TSubst