diff options
author | David Robillard <d@drobilla.net> | 2009-03-15 05:50:11 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-03-15 05:50:11 +0000 |
commit | 1bf9034de882d364390e8887945a150bfb3873c1 (patch) | |
tree | 28279706acce83f9d6323ebcb046188ffe3069a8 /tuplr.cpp | |
parent | 43535af604602e1bfa72363bd0e6cfc84807c33e (diff) | |
download | resp-1bf9034de882d364390e8887945a150bfb3873c1.tar.gz resp-1bf9034de882d364390e8887945a150bfb3873c1.tar.bz2 resp-1bf9034de882d364390e8887945a150bfb3873c1.zip |
Clean up ATuple, AType, Exp.
git-svn-id: http://svn.drobilla.net/resp/tuplr@98 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'tuplr.cpp')
-rw-r--r-- | tuplr.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -46,7 +46,7 @@ readChar(Cursor& cur, istream& in) SExp readExpression(Cursor& cur, istream& in) { -#define PUSH(s, t) { if (t != "") { s.top().list.push_back(SExp(loc, t)); t = ""; } } +#define PUSH(s, t) { if (t != "") { s.top().push_back(SExp(loc, t)); t = ""; } } #define YIELD(s, t) { if (s.empty()) { return SExp(loc, t); } else PUSH(s, t) } stack<SExp> stk; string tok; @@ -80,7 +80,7 @@ readExpression(Cursor& cur, istream& in) PUSH(stk, tok); SExp l = stk.top(); stk.pop(); - stk.top().list.push_back(l); + stk.top().push_back(l); } break; case '#': @@ -123,13 +123,13 @@ parseLiteral(PEnv& penv, const SExp& exp, void* arg) inline AST* parseFn(PEnv& penv, const SExp& exp, void* arg) { - if (exp.list.size() < 2) + if (exp.size() < 2) throw Error("Missing function parameters and body", exp.loc); - else if (exp.list.size() < 3) + else if (exp.size() < 3) throw Error("Missing function body", exp.loc); - SExp::List::const_iterator a = exp.list.begin(); ++a; + SExp::const_iterator a = exp.begin(); ++a; AClosure* ret = new AClosure(exp.loc, penv.sym("fn"), new ATuple(penv.parseTuple(*a++))); - while (a != exp.list.end()) + while (a != exp.end()) ret->push_back(penv.parse(*a++)); return ret; } |