Commit da72a44c authored by Rudi Chen's avatar Rudi Chen

Stub implementation for Ellipsis.

parent b1b8d67c
...@@ -524,6 +524,7 @@ public: ...@@ -524,6 +524,7 @@ public:
// bool visit_classdef(AST_ClassDef *node) override { return false; } // bool visit_classdef(AST_ClassDef *node) override { return false; }
bool visit_continue(AST_Continue* node) override { return false; } bool visit_continue(AST_Continue* node) override { return false; }
bool visit_dict(AST_Dict* node) override { return false; } bool visit_dict(AST_Dict* node) override { return false; }
bool visit_ellipsis(AST_Ellipsis* node) override { return false; }
bool visit_excepthandler(AST_ExceptHandler* node) override { return false; } bool visit_excepthandler(AST_ExceptHandler* node) override { return false; }
bool visit_expr(AST_Expr* node) override { return false; } bool visit_expr(AST_Expr* node) override { return false; }
bool visit_extslice(AST_ExtSlice* node) override { return false; } bool visit_extslice(AST_ExtSlice* node) override { return false; }
......
...@@ -384,6 +384,12 @@ AST_DictComp* read_dictcomp(BufferedReader* reader) { ...@@ -384,6 +384,12 @@ AST_DictComp* read_dictcomp(BufferedReader* reader) {
return rtn; return rtn;
} }
AST_Ellipsis* read_ellipsis(BufferedReader* reader) {
AST_Ellipsis* rtn = new AST_Ellipsis();
rtn->col_offset = -1;
rtn->lineno = -1;
return rtn;
}
AST_ExceptHandler* read_excepthandler(BufferedReader* reader) { AST_ExceptHandler* read_excepthandler(BufferedReader* reader) {
AST_ExceptHandler* rtn = new AST_ExceptHandler(); AST_ExceptHandler* rtn = new AST_ExceptHandler();
...@@ -822,6 +828,8 @@ AST_expr* readASTExpr(BufferedReader* reader) { ...@@ -822,6 +828,8 @@ AST_expr* readASTExpr(BufferedReader* reader) {
return read_dict(reader); return read_dict(reader);
case AST_TYPE::DictComp: case AST_TYPE::DictComp:
return read_dictcomp(reader); return read_dictcomp(reader);
case AST_TYPE::Ellipsis:
return read_ellipsis(reader);
case AST_TYPE::ExtSlice: case AST_TYPE::ExtSlice:
return read_extslice(reader); return read_extslice(reader);
case AST_TYPE::GeneratorExp: case AST_TYPE::GeneratorExp:
......
...@@ -277,6 +277,7 @@ private: ...@@ -277,6 +277,7 @@ private:
writeExpr(node->value); writeExpr(node->value);
return true; return true;
} }
virtual bool visit_ellipsis(AST_Ellipsis* node) { return true; }
virtual bool visit_excepthandler(AST_ExceptHandler* node) { virtual bool visit_excepthandler(AST_ExceptHandler* node) {
writeStmtVector(node->body); writeStmtVector(node->body);
writeColOffset(node->col_offset); writeColOffset(node->col_offset);
......
...@@ -2034,6 +2034,10 @@ public: ...@@ -2034,6 +2034,10 @@ public:
output->push_back(node); output->push_back(node);
return false; return false;
} }
virtual bool visit_ellipsis(AST_Ellipsis* node) {
output->push_back(node);
return false;
}
virtual bool visit_excepthandler(AST_ExceptHandler* node) { virtual bool visit_excepthandler(AST_ExceptHandler* node) {
output->push_back(node); output->push_back(node);
return false; return false;
......
...@@ -855,6 +855,8 @@ private: ...@@ -855,6 +855,8 @@ private:
return rtn; return rtn;
} }
AST_expr* remapEllipsis(AST_Ellipsis* node) { return node; }
AST_expr* remapExtSlice(AST_ExtSlice* node) { AST_expr* remapExtSlice(AST_ExtSlice* node) {
AST_ExtSlice* rtn = new AST_ExtSlice(); AST_ExtSlice* rtn = new AST_ExtSlice();
rtn->lineno = node->lineno; rtn->lineno = node->lineno;
...@@ -1183,6 +1185,9 @@ private: ...@@ -1183,6 +1185,9 @@ private:
case AST_TYPE::DictComp: case AST_TYPE::DictComp:
rtn = remapScopedComprehension<AST_Dict>(ast_cast<AST_DictComp>(node)); rtn = remapScopedComprehension<AST_Dict>(ast_cast<AST_DictComp>(node));
break; break;
case AST_TYPE::Ellipsis:
rtn = remapEllipsis(ast_cast<AST_Ellipsis>(node));
break;
case AST_TYPE::ExtSlice: case AST_TYPE::ExtSlice:
rtn = remapExtSlice(ast_cast<AST_ExtSlice>(node)); rtn = remapExtSlice(ast_cast<AST_ExtSlice>(node));
break; break;
......
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