aboutsummaryrefslogtreecommitdiff
path: root/parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'parser.cpp')
-rw-r--r--parser.cpp13
1 files changed, 5 insertions, 8 deletions
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) {