diff options
author | David Robillard <d@drobilla.net> | 2009-10-15 16:58:33 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-10-15 16:58:33 +0000 |
commit | 7743d332e41c7795dcbaa49511293f22597e4db7 (patch) | |
tree | c6018e89d3265698e992a3e96b77a25ae40675b6 /src/c.cpp | |
parent | cc8d52479fea5b2f4419463daf027ec11e813dc8 (diff) | |
download | resp-7743d332e41c7795dcbaa49511293f22597e4db7.tar.gz resp-7743d332e41c7795dcbaa49511293f22597e4db7.tar.bz2 resp-7743d332e41c7795dcbaa49511293f22597e4db7.zip |
Replace more use of at(0) with head().
git-svn-id: http://svn.drobilla.net/resp/tuplr@228 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/c.cpp')
-rw-r--r-- | src/c.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -43,12 +43,12 @@ static const Type* llType(const AType* t) { if (t->kind == AType::PRIM) { - if (t->at(0)->str() == "Nothing") return new string("void"); - if (t->at(0)->str() == "Bool") return new string("bool"); - if (t->at(0)->str() == "Int") return new string("int"); - if (t->at(0)->str() == "Float") return new string("float"); + if (t->head()->str() == "Nothing") return new string("void"); + if (t->head()->str() == "Bool") return new string("bool"); + if (t->head()->str() == "Int") return new string("int"); + if (t->head()->str() == "Float") return new string("float"); throw Error(t->loc, string("Unknown primitive type `") + t->str() + "'"); - } else if (t->kind == AType::EXPR && t->at(0)->str() == "Fn") { + } else if (t->kind == AType::EXPR && t->head()->str() == "Fn") { const AType* retT = t->at(2)->as<const AType*>(); if (!llType(retT)) return NULL; @@ -264,7 +264,7 @@ CEngine::compilePrimitive(CEnv& cenv, APrimitive* prim) CEngine* engine = reinterpret_cast<CEngine*>(cenv.engine()); Value* a = llVal(prim->at(1)->compile(cenv)); Value* b = llVal(prim->at(2)->compile(cenv)); - const string n = prim->at(0)->to<ASymbol*>()->str(); + const string n = prim->head()->to<ASymbol*>()->str(); string op = n; // Convert operator to C operator if they don't match |