aboutsummaryrefslogtreecommitdiffstats
path: root/src/c.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/c.cpp')
-rw-r--r--src/c.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/c.cpp b/src/c.cpp
index d6d71f3..7f4a563 100644
--- a/src/c.cpp
+++ b/src/c.cpp
@@ -49,6 +49,9 @@ llType(const AType* t)
if (t->head()->str() == "Bool") return new string("bool");
if (t->head()->str() == "Int") return new string("int");
if (t->head()->str() == "Float") return new string("float");
+ if (t->head()->str() == "String") return new string("char*");
+ if (t->head()->str() == "Quote") return new string("char*");
+ if (t->head()->str() == "Lexeme") return new string("char*");
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();
@@ -201,7 +204,7 @@ CEngine::compileLiteral(CEnv& cenv, AST* lit)
CVal
CEngine::compileString(CEnv& cenv, const char* str)
{
- return new Value(str);
+ return new Value(string("\"") + str + "\"");
}
CFunc