From 815e5dc20339e19c5bd299c3dcd69b6f88bf5317 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 4 Jul 2009 05:43:18 +0000 Subject: Tidy. git-svn-id: http://svn.drobilla.net/resp/tuplr@184 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/parse.cpp | 6 +++--- src/tuplr.hpp | 9 +++------ 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/parse.cpp b/src/parse.cpp index 1f16bfe..d36a92a 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -117,9 +117,9 @@ initLang(PEnv& penv, TEnv& tenv) penv.defmac("def", macDef); // Special forms - penv.reg(true, "fn", PEnv::Handler(parseFn)); - penv.reg(true, "if", PEnv::Handler(parseCall)); - penv.reg(true, "def", PEnv::Handler(parseCall)); + penv.reg(true, "fn", PEnv::Handler(parseFn)); + penv.reg(true, "if", PEnv::Handler(parseCall)); + penv.reg(true, "def", PEnv::Handler(parseCall)); // Numeric primitives penv.reg(true, "+", PEnv::Handler(parseCall)); diff --git a/src/tuplr.hpp b/src/tuplr.hpp index 018607c..4b6c4bc 100644 --- a/src/tuplr.hpp +++ b/src/tuplr.hpp @@ -133,8 +133,8 @@ struct Object; /// Garbage collector struct GC { enum Tag { - TAG_AST = 2, ///< Abstract syntax tree node - TAG_FRAME = 4 ///< Stack frame + TAG_AST = 1, ///< Abstract syntax tree node + TAG_FRAME = 2 ///< Stack frame }; typedef std::list Roots; typedef std::list Heap; @@ -236,7 +236,6 @@ struct ALiteral : public AST { /// String, e.g. ""a"" struct AString : public AST, public std::string { AString(Cursor c, const string& s) : AST(c), std::string(s) {} - AString& operator=(const AString& rhs) { *this = rhs; return *this; } bool operator==(const AST& rhs) const { return this == &rhs; } void constrain(TEnv& tenv, Constraints& c) const {} CValue compile(CEnv& cenv) { return NULL; } @@ -519,9 +518,7 @@ struct PEnv : private map { if (tup) { if (tup->empty()) throw Error(exp->loc, "call to empty list"); if (!tup->front()->to()) { - const AString* str = tup->front()->to(); - assert(str); - MF mf = mac(*str); + MF mf = mac(*tup->front()->to()); const AST* expanded = (mf ? mf(*this, exp) : exp); const ATuple* expanded_tup = expanded->to(); const PEnv::Handler* h = handler(true, *expanded_tup->front()->to()); -- cgit v1.2.1