diff options
Diffstat (limited to 'src/c.cpp')
-rw-r--r-- | src/c.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |