aboutsummaryrefslogtreecommitdiffstats
path: root/src/llvm.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/llvm.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/llvm.cpp')
-rw-r--r--src/llvm.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/llvm.cpp b/src/llvm.cpp
index 043b5fc..9ca6e46 100644
--- a/src/llvm.cpp
+++ b/src/llvm.cpp
@@ -94,6 +94,8 @@ struct LLVMEngine : public Engine {
if (t->head()->str() == "Int") return Type::getInt32Ty(context);
if (t->head()->str() == "Float") return Type::getFloatTy(context);
if (t->head()->str() == "String") return PointerType::get(Type::getInt8Ty(context), NULL);
+ if (t->head()->str() == "Quote") return PointerType::get(Type::getInt8Ty(context), NULL);
+ if (t->head()->str() == "Lexeme") return PointerType::get(Type::getInt8Ty(context), NULL);
throw Error(t->loc, string("Unknown primitive type `") + t->str() + "'");
} else if (t->kind == AType::EXPR && t->head()->str() == "Fn") {
AType::const_iterator i = t->begin();
@@ -230,6 +232,8 @@ struct LLVMEngine : public Engine {
ss << "\"";
} else if (retT->head()->str() == "Lexeme") {
ss << ((char* (*)())fp)();
+ } else if (retT->head()->str() == "Quote") {
+ ss << "(quote " << ((char* (*)())fp)() << ")";
} else if (t != Type::getVoidTy(context)) {
ss << ((void* (*)())fp)();
} else {