From 25e58056dc218afe0768081ef1c52974593773c0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 28 Dec 2010 07:14:59 +0000 Subject: Add quote form, to allow expressions literal symbols and lists (lists not yet implemented). Quoting is a thin lexical concept - a quote of a symbol/list compiles to a symbol/list, rather than interpreted as code (i.e. a variable/call, respectively). A quote of anything else is equivalent to its quotee, e.g. a quote of a String is simply that string (the quote is removed at an early stage by the compiler). There is no Quote data type, or explicit unquoting, or anything like that. git-svn-id: http://svn.drobilla.net/resp/resp@365 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/llvm.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/llvm.cpp') diff --git a/src/llvm.cpp b/src/llvm.cpp index 4c8ff2a..cb2d6c1 100644 --- a/src/llvm.cpp +++ b/src/llvm.cpp @@ -140,7 +140,7 @@ LLVMEngine::llType(const AST* t) if (sym == "Int") return Type::getInt32Ty(context); if (sym == "Float") return Type::getFloatTy(context); if (sym == "String") return PointerType::get(Type::getInt8Ty(context), NULL); - if (sym == "Quote") return PointerType::get(Type::getInt8Ty(context), NULL); + if (sym == "Symbol") return PointerType::get(Type::getInt8Ty(context), NULL); } else if (is_form(t, "Fn")) { ATuple::const_iterator i = t->as_tuple()->begin(); const ATuple* protT = (*++i)->to_tuple(); @@ -466,6 +466,9 @@ LLVMEngine::call(CEnv& cenv, CFunc f, const AST* retT) } } ss << "\""; + } else if (retT->str() == "Symbol") { + const std::string s(((char* (*)())fp)()); + ss << s; } else if (t != Type::getVoidTy(context)) { ss << ((void* (*)())fp)(); } else { -- cgit v1.2.1