From 2ec8f26f31d13bf3c3bbda24ea5e1cace6a819a2 Mon Sep 17 00:00:00 2001 From: Teddy Date: Mon, 5 Aug 2013 23:31:48 +0800 Subject: added support for string --- parser.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'parser.cpp') diff --git a/parser.cpp b/parser.cpp index cb8695f..07ca066 100644 --- a/parser.cpp +++ b/parser.cpp @@ -105,14 +105,11 @@ ASTGenerator::ASTGenerator() {} EvalObj *ASTGenerator::to_obj(const string &str) { EvalObj *res = NULL; - if ((res = IntNumObj::from_string(str))) - return res; - if ((res = RatNumObj::from_string(str))) - return res; - if ((res = RealNumObj::from_string(str))) - return res; - if ((res = CompNumObj::from_string(str))) - return res; + if ((res = IntNumObj::from_string(str))) return res; + if ((res = RatNumObj::from_string(str))) return res; + if ((res = RealNumObj::from_string(str))) return res; + if ((res = CompNumObj::from_string(str))) return res; + if ((res = StrObj::from_string(str))) return res; return new SymObj(str); } Cons *ASTGenerator::absorb(Tokenizor *tk) { -- cgit v1.2.3