Commit a91f6187 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Set lineno on these constructed AST nodes

parent 8ffb10cc
......@@ -1145,6 +1145,9 @@ public:
bool visit_import(AST_Import* node) override {
for (AST_alias* a : node->names) {
AST_LangPrimitive* import = new AST_LangPrimitive(AST_LangPrimitive::IMPORT_NAME);
import->lineno = node->lineno;
import->col_offset = node->col_offset;
import->args.push_back(new AST_Num());
static_cast<AST_Num*>(import->args[0])->num_type = AST_Num::INT;
static_cast<AST_Num*>(import->args[0])->n_int = -1;
......@@ -1186,6 +1189,9 @@ public:
RELEASE_ASSERT(node->level == 0, "");
AST_LangPrimitive* import = new AST_LangPrimitive(AST_LangPrimitive::IMPORT_NAME);
import->lineno = node->lineno;
import->col_offset = node->col_offset;
import->args.push_back(new AST_Num());
static_cast<AST_Num*>(import->args[0])->num_type = AST_Num::INT;
static_cast<AST_Num*>(import->args[0])->n_int = node->level;
......
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