diff options
author | David Robillard <d@drobilla.net> | 2009-03-07 05:49:13 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-03-07 05:49:13 +0000 |
commit | 835fa4439303938731517dc56f185f012896e6f4 (patch) | |
tree | c26c2e535a2d4a7ab8a3c6c8ae3222cc3486e012 /typing.cpp | |
parent | 5faf51234f0279c057c58a6c26cf35f4266bedaf (diff) | |
download | resp-835fa4439303938731517dc56f185f012896e6f4.tar.gz resp-835fa4439303938731517dc56f185f012896e6f4.tar.bz2 resp-835fa4439303938731517dc56f185f012896e6f4.zip |
Shorter and more consistent names (AST -> A).
git-svn-id: http://svn.drobilla.net/resp/tuplr@78 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'typing.cpp')
-rw-r--r-- | typing.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -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 |