Commit b80e9dca authored by Kevin Modzelewski's avatar Kevin Modzelewski

Support empty lines on the repl

They end up generating "pass" statements with a lineno of 0, which
trips an assert later on.  This commit just sets them to have a lineno
of 1.

I'm not sure how to test this, since piping into stdin is supposed to
be treated as a file (not as the repl).  Though, we get that wrong right now.
parent 82c402a6
......@@ -710,6 +710,13 @@ public:
auto r = _convert(stmt);
r->lineno = stmt->lineno;
r->col_offset = stmt->col_offset;
if (stmt->lineno == 0) {
// So far it looks like these can only be generated for empty lines on the repl
assert(stmt->kind == Pass_kind);
r->lineno = 1;
}
return r;
}
......
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