diff options
author | Teddy <ted.sybil@gmail.com> | 2013-08-05 23:31:48 +0800 |
---|---|---|
committer | Teddy <ted.sybil@gmail.com> | 2013-08-05 23:31:48 +0800 |
commit | 2ec8f26f31d13bf3c3bbda24ea5e1cace6a819a2 (patch) | |
tree | f623aaa220efa2993161997729dce9ff03d936ad /parser.cpp | |
parent | 5dab7df6830018c5c28ebcc7cc3b242ccad2736b (diff) |
added support for string
Diffstat (limited to 'parser.cpp')
-rw-r--r-- | parser.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -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) { |