diff options
Diffstat (limited to 'src/resp.hpp')
-rw-r--r-- | src/resp.hpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/resp.hpp b/src/resp.hpp index 7383cdd..f2f27f5 100644 --- a/src/resp.hpp +++ b/src/resp.hpp @@ -246,15 +246,17 @@ struct ALiteral : public AST { }; /// Lexeme (any atom in the CST, e.g. "a", "3.4", ""hello"", etc.) -struct ALexeme : public AST, public std::string { - ALexeme(Cursor c, const string& s) : AST(T_LEXEME, c), std::string(s) {} +struct ALexeme : public AST { + ALexeme(Cursor c, const string& s) : AST(T_LEXEME, c), cppstr(s) {} bool operator==(const AST& rhs) const { return this == &rhs; } + const string cppstr; }; /// String, e.g. ""a"" -struct AString : public AST, public std::string { - AString(Cursor c, const string& s) : AST(T_STRING, c), std::string(s) {} +struct AString : public AST { + AString(Cursor c, const string& s) : AST(T_STRING, c), cppstr(s) {} bool operator==(const AST& rhs) const { return this == &rhs; } + const string cppstr; }; /// Symbol, e.g. "a" @@ -553,7 +555,7 @@ struct PEnv : private map<const string, ASymbol*> { macros.insert(make_pair(s, f)); } MF mac(const ALexeme& s) const { - map<string, MF>::const_iterator i = macros.find(s); + map<string, MF>::const_iterator i = macros.find(s.cppstr); return (i != macros.end()) ? i->second : NULL; } string gensymstr(const char* s="_") { return (format("%s_%d") % s % symID++).str(); } |