aboutsummaryrefslogtreecommitdiffstats
path: root/src/compile.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-08-19 15:40:25 +0000
committerDavid Robillard <d@drobilla.net>2010-08-19 15:40:25 +0000
commit6b71fb1a3adc0b8eb3db01c199422f7aea2c4500 (patch)
tree404b8ebe7b43d235eed9cff7634610c512c2ad27 /src/compile.cpp
parent9a1c3c7cfc96cb6ee1c9f7bc103b99b89da43d6e (diff)
downloadresp-6b71fb1a3adc0b8eb3db01c199422f7aea2c4500.tar.gz
resp-6b71fb1a3adc0b8eb3db01c199422f7aea2c4500.tar.bz2
resp-6b71fb1a3adc0b8eb3db01c199422f7aea2c4500.zip
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
Diffstat (limited to 'src/compile.cpp')
-rw-r--r--src/compile.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/compile.cpp b/src/compile.cpp
index f5a4128..31fa889 100644
--- a/src/compile.cpp
+++ b/src/compile.cpp
@@ -38,6 +38,12 @@ AString::compile(CEnv& cenv) throw()
}
CVal
+AQuote::compile(CEnv& cenv) throw()
+{
+ return (*(begin() + 1))->compile(cenv);
+}
+
+CVal
ALexeme::compile(CEnv& cenv) throw()
{
return cenv.engine()->compileString(cenv, c_str());
@@ -112,6 +118,16 @@ ACons::compile(CEnv& cenv) throw()
}
CVal
+ATuple::compile(CEnv& cenv) throw()
+{
+ const AType* type = cenv.type(this);
+ vector<CVal> 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()
{
const_iterator i = begin();