diff options
author | David Robillard <d@drobilla.net> | 2009-07-04 06:12:50 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-07-04 06:12:50 +0000 |
commit | d1f38c9f27ff1a0208884058d3c8450650703ee9 (patch) | |
tree | e0581b4047ad0bb5137e5a8389faf5c3ffb5b941 /src/tuplr.hpp | |
parent | 24bacd4211b8c53e3eeee97fbc929a2f6c4a19e8 (diff) | |
download | resp-d1f38c9f27ff1a0208884058d3c8450650703ee9.tar.gz resp-d1f38c9f27ff1a0208884058d3c8450650703ee9.tar.bz2 resp-d1f38c9f27ff1a0208884058d3c8450650703ee9.zip |
Parse AString.
git-svn-id: http://svn.drobilla.net/resp/tuplr@186 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/tuplr.hpp')
-rw-r--r-- | src/tuplr.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tuplr.hpp b/src/tuplr.hpp index da8eea5..1e64da1 100644 --- a/src/tuplr.hpp +++ b/src/tuplr.hpp @@ -237,7 +237,7 @@ struct ALiteral : public AST { struct AString : public AST, public std::string { AString(Cursor c, const string& s) : AST(c), std::string(s) {} bool operator==(const AST& rhs) const { return this == &rhs; } - void constrain(TEnv& tenv, Constraints& c) const {} + void constrain(TEnv& tenv, Constraints& c) const; CValue compile(CEnv& cenv) { return NULL; } }; @@ -535,6 +535,8 @@ struct PEnv : private map<const string, ASymbol*> { return new ALiteral<int32_t>(strtol(s.c_str(), NULL, 10), exp->loc); else return new ALiteral<float>(strtod(s.c_str(), NULL), exp->loc); + } else if ((*str)[0] == '\"') { + return new AString(exp->loc, str->substr(1, str->length() - 2)); } else { const PEnv::Handler* h = handler(false, *str); if (h) |