Skip to content

Commit

Permalink
Added empty visit_For function in the SymbolTableVisitor class (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
anutosh491 committed Feb 11, 2023
1 parent a868f5f commit 9c00b60
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ RUN(NAME expr_14 LABELS cpython llvm c)
RUN(NAME loop_01 LABELS cpython llvm c)
RUN(NAME loop_02 LABELS cpython llvm c wasm wasm_x86 wasm_x64)
RUN(NAME loop_03 LABELS cpython llvm c wasm wasm_x64)
RUN(NAME loop_04 LABELS cpython llvm)
RUN(NAME if_01 LABELS cpython llvm c wasm wasm_x86 wasm_x64)
RUN(NAME if_02 LABELS cpython llvm c wasm wasm_x86 wasm_x64)
RUN(NAME print_02 LABELS cpython llvm c)
Expand Down
6 changes: 6 additions & 0 deletions integration_tests/loop_04.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from ltypes import i32
j: i32
i: i32
for i in range(5):
j = i
print("j: ", j)
4 changes: 4 additions & 0 deletions src/lpython/semantics/python_ast_to_asr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3787,6 +3787,10 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
void visit_Expr(const AST::Expr_t &/*x*/) {
// We skip this in the SymbolTable visitor, but visit it in the BodyVisitor
}

void visit_For(const AST::For_t &/*x*/) {
// We skip this in the SymbolTable visitor, but visit it in the BodyVisitor
}
};

Result<ASR::asr_t*> symbol_table_visitor(Allocator &al, LocationManager &lm, const AST::Module_t &ast,
Expand Down

0 comments on commit 9c00b60

Please sign in to comment.