diff options
author | David Robillard <d@drobilla.net> | 2010-08-19 15:40:25 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-08-19 15:40:25 +0000 |
commit | 6b71fb1a3adc0b8eb3db01c199422f7aea2c4500 (patch) | |
tree | 404b8ebe7b43d235eed9cff7634610c512c2ad27 /src/c.cpp | |
parent | 9a1c3c7cfc96cb6ee1c9f7bc103b99b89da43d6e (diff) | |
download | resp-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/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 |