diff options
Diffstat (limited to 'src/compile.cpp')
-rw-r--r-- | src/compile.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/compile.cpp b/src/compile.cpp index 393084e..756e90d 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -43,7 +43,7 @@ compile_literal_symbol(CEnv& cenv, const ASymbol* sym) throw() if (existing) { return *existing; } else { - CVal compiled = cenv.engine()->compileString(cenv, (string("__T_") + sym->sym()).c_str()); + CVal compiled = cenv.engine()->compileString(cenv, sym->sym()); cenv.vals.def(sym, compiled); return compiled; } @@ -147,6 +147,18 @@ compile_if(CEnv& cenv, const ATuple* aif) throw() } static CVal +compile_quote(CEnv& cenv, const ATuple* quote) throw() +{ + switch (quote->list_ref(1)->tag()) { + case T_SYMBOL: + return compile_literal_symbol(cenv, quote->list_ref(1)->as_symbol()); + default: + assert(false); + return NULL; + } +} + +static CVal compile_call(CEnv& cenv, const ATuple* call) throw() { CFunc f = resp_compile(cenv, call->head()); @@ -199,6 +211,8 @@ resp_compile(CEnv& cenv, const AST* ast) throw() return compile_fn(cenv, call); else if (form == "if") return compile_if(cenv, call); + else if (form == "quote") + return compile_quote(cenv, call); else return compile_call(cenv, call); } |