Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9c00b60

Browse files
authored
Added empty visit_For function in the SymbolTableVisitor class (lcompilers#1509)
1 parent a868f5f commit 9c00b60

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

integration_tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ RUN(NAME expr_14 LABELS cpython llvm c)
256256
RUN(NAME loop_01 LABELS cpython llvm c)
257257
RUN(NAME loop_02 LABELS cpython llvm c wasm wasm_x86 wasm_x64)
258258
RUN(NAME loop_03 LABELS cpython llvm c wasm wasm_x64)
259+
RUN(NAME loop_04 LABELS cpython llvm)
259260
RUN(NAME if_01 LABELS cpython llvm c wasm wasm_x86 wasm_x64)
260261
RUN(NAME if_02 LABELS cpython llvm c wasm wasm_x86 wasm_x64)
261262
RUN(NAME print_02 LABELS cpython llvm c)

integration_tests/loop_04.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from ltypes import i32
2+
j: i32
3+
i: i32
4+
for i in range(5):
5+
j = i
6+
print("j: ", j)

src/lpython/semantics/python_ast_to_asr.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3787,6 +3787,10 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
37873787
void visit_Expr(const AST::Expr_t &/*x*/) {
37883788
// We skip this in the SymbolTable visitor, but visit it in the BodyVisitor
37893789
}
3790+
3791+
void visit_For(const AST::For_t &/*x*/) {
3792+
// We skip this in the SymbolTable visitor, but visit it in the BodyVisitor
3793+
}
37903794
};
37913795

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

0 commit comments

Comments
 (0)