Skip to content

Commit 800be6b

Browse files
authored
Merge pull request #2101 from Smit-create/i-2100
Skip AugAssign in Symbol Table visitor
2 parents 10c4f27 + a3300ba commit 800be6b

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

integration_tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ RUN(NAME expr_15 LABELS cpython llvm c)
418418
RUN(NAME expr_16 LABELS cpython c)
419419
RUN(NAME expr_17 LABELS cpython llvm c)
420420
RUN(NAME expr_18 FAIL LABELS cpython llvm c)
421+
RUN(NAME expr_19 LABELS cpython llvm c)
421422

422423
RUN(NAME expr_01u LABELS cpython llvm c NOFAST)
423424
RUN(NAME expr_02u LABELS cpython llvm c NOFAST)

integration_tests/expr_19.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from lpython import (f64,)
2+
3+
result : f64 = f64(14)
4+
divisor : f64 = f64(4)
5+
result /= divisor
6+
7+
assert abs(result - f64(3.5)) < 1e-12

src/lpython/semantics/python_ast_to_asr.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4512,6 +4512,10 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
45124512
}
45134513
}
45144514

4515+
void visit_AugAssign(const AST::AugAssign_t &/*x*/) {
4516+
// We skip this in the SymbolTable visitor, but visit it in the BodyVisitor
4517+
}
4518+
45154519
void visit_AnnAssign(const AST::AnnAssign_t &/*x*/) {
45164520
// We skip this in the SymbolTable visitor, but visit it in the BodyVisitor
45174521
}

0 commit comments

Comments
 (0)