Commit 0f7b96ba authored by Kevin Modzelewski's avatar Kevin Modzelewski

The repl prints the repr(), not the str()

parent 0687a454
...@@ -222,10 +222,19 @@ int main(int argc, char** argv) { ...@@ -222,10 +222,19 @@ int main(int argc, char** argv) {
if (m->body.size() > 0 && m->body[0]->type == AST_TYPE::Expr) { if (m->body.size() > 0 && m->body[0]->type == AST_TYPE::Expr) {
AST_Expr* e = ast_cast<AST_Expr>(m->body[0]); AST_Expr* e = ast_cast<AST_Expr>(m->body[0]);
AST_Call* c = new AST_Call();
AST_Name* r = new AST_Name();
r->id = "repr";
r->ctx_type = AST_TYPE::Load;
c->func = r;
c->starargs = NULL;
c->kwargs = NULL;
c->args.push_back(e->value);
AST_Print* p = new AST_Print(); AST_Print* p = new AST_Print();
p->dest = NULL; p->dest = NULL;
p->nl = true; p->nl = true;
p->values.push_back(e->value); p->values.push_back(c);
m->body[0] = p; m->body[0] = p;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment