From 6b71fb1a3adc0b8eb3db01c199422f7aea2c4500 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 19 Aug 2010 15:40:25 +0000 Subject: Add quote to syntax (currently only a lexeme is quotable, no lists...) git-svn-id: http://svn.drobilla.net/resp/resp@262 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/compile.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/compile.cpp') diff --git a/src/compile.cpp b/src/compile.cpp index f5a4128..31fa889 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -37,6 +37,12 @@ AString::compile(CEnv& cenv) throw() return cenv.engine()->compileString(cenv, c_str()); } +CVal +AQuote::compile(CEnv& cenv) throw() +{ + return (*(begin() + 1))->compile(cenv); +} + CVal ALexeme::compile(CEnv& cenv) throw() { @@ -111,6 +117,16 @@ ACons::compile(CEnv& cenv) throw() return cenv.engine()->compileTup(cenv, type, fields); } +CVal +ATuple::compile(CEnv& cenv) throw() +{ + const AType* type = cenv.type(this); + vector fields; + for (const_iterator i = begin(); i != end(); ++i) + fields.push_back((*i)->compile(cenv)); + return cenv.engine()->compileTup(cenv, type, fields); +} + CVal ADot::compile(CEnv& cenv) throw() { -- cgit v1.2.1