diff options
Diffstat (limited to 'src/parse.cpp')
-rw-r--r-- | src/parse.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/parse.cpp b/src/parse.cpp index 78aae69..a9527ea 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -52,11 +52,11 @@ PEnv::parse(const AST* exp) THROW_IF(tup->empty(), exp->loc, "Call to empty list"); const ALexeme* form = tup->head()->to<const ALexeme*>(); if (form) { - const PEnv::Handler* h = handler(true, *form); + const PEnv::Handler* h = handler(true, form->cppstr); if (h) return h->func(*this, exp, h->arg); // Parse special form - if (isupper(form->c_str()[0])) // Call constructor (any uppercase symbol) + if (isupper(form->cppstr.c_str()[0])) // Call constructor (any uppercase symbol) return parseTuple(*this, tup); } @@ -65,20 +65,20 @@ PEnv::parse(const AST* exp) const ALexeme* lex = exp->to<const ALexeme*>(); assert(lex); - if (isdigit((*lex)[0])) { - const std::string& s = *lex; + if (isdigit(lex->cppstr[0])) { + const std::string& s = lex->cppstr; if (s.find('.') == string::npos) return new ALiteral<int32_t>(T_INT32, strtol(s.c_str(), NULL, 10), exp->loc); else return new ALiteral<float>(T_FLOAT, strtod(s.c_str(), NULL), exp->loc); - } else if ((*lex)[0] == '\"') { - return new AString(exp->loc, lex->substr(1, lex->length() - 2)); + } else if (lex->cppstr[0] == '\"') { + return new AString(exp->loc, lex->cppstr.substr(1, lex->cppstr.length() - 2)); } else { - const PEnv::Handler* h = handler(false, *lex); + const PEnv::Handler* h = handler(false, lex->cppstr); if (h) return h->func(*this, exp, h->arg); } - return sym(*lex, exp->loc); + return sym(lex->cppstr, exp->loc); } |