From f8c11845f9440ef29f15445b3f864073bd051db9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 10 Mar 2009 00:58:19 +0000 Subject: Tidy. git-svn-id: http://svn.drobilla.net/resp/tuplr@79 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- tuplr.hpp | 8 ++++---- typing.cpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tuplr.hpp b/tuplr.hpp index f095689..308c5d6 100644 --- a/tuplr.hpp +++ b/tuplr.hpp @@ -48,7 +48,7 @@ struct Cursor { struct Error { Error(const string& m, Cursor c=Cursor()) : msg(m), loc(c) {} - const string what() const throw() { return (loc ? loc.str() + ": " : "") + "error: " + msg; } + const string what() const { return (loc ? loc.str() + ": " : "") + "error: " + msg; } string msg; Cursor loc; }; @@ -423,7 +423,7 @@ struct TSubst : public map { struct TEnv : public Env { TEnv(PEnv& p) : penv(p), varID(1) {} struct Constraint : public pair { - Constraint(AType* a, AType* b, Cursor c=Cursor()) : pair(a, b), loc(c) {} + Constraint(AType* a, AType* b, Cursor c) : pair(a, b), loc(c) {} Cursor loc; }; typedef list Constraints; @@ -460,8 +460,8 @@ struct CEnv { CEnv(PEnv& p, TEnv& t, CEngine& e, ostream& os=std::cout, ostream& es=std::cerr); ~CEnv(); - typedef Env Code; - typedef Env Vals; + typedef Env Code; + typedef Env Vals; string gensym(const char* s="_") { return (format("%s%d") % s % symID++).str(); } void push() { code.push(); vals.push(); } diff --git a/typing.cpp b/typing.cpp index 161a959..80bc568 100644 --- a/typing.cpp +++ b/typing.cpp @@ -89,13 +89,13 @@ void APrimitive::constrain(TEnv& tenv) const { const string n = dynamic_cast(at(0))->str(); - enum { ARITHMETIC, BINARY, BITWISE, COMPARISON } type; + enum { ARITHMETIC, BINARY, LOGICAL, COMPARISON } type; if (n == "+" || n == "-" || n == "*" || n == "/") type = ARITHMETIC; else if (n == "%") type = BINARY; else if (n == "and" || n == "or" || n == "xor") - type = BITWISE; + type = LOGICAL; else if (n == "=" || n == "!=" || n == ">" || n == ">=" || n == "<" || n == "<=") type = COMPARISON; else @@ -117,7 +117,7 @@ APrimitive::constrain(TEnv& tenv) const tenv.constrain(at(1), tenv.type(this)); tenv.constrain(at(2), tenv.type(this)); break; - case BITWISE: + case LOGICAL: if (size() != 3) throw Error((format("`%1%' requires exactly 2 arguments") % n).str(), loc); tenv.constrain(this, tenv.named("Bool")); -- cgit v1.2.1