-
- Downloads
Add location of variable creation to attributes of symbol tale
Additionally store position of the end of the declaration instruction so that when searching a symbol in a table one also check that the declaration point has been passed. This fix issues generated by the storage of symbol tables within node description. The following code is now interpreted correctly `` Z x = 1; { Z x = x + 1; cout << x << "\n"; } cout << x << "\n"; `` It now produces the expected output `` 2 1 ``
Showing
- src/language/ASTNodeAffectationExpressionBuilder.cpp 2 additions, 2 deletionssrc/language/ASTNodeAffectationExpressionBuilder.cpp
- src/language/ASTNodeDataTypeBuilder.cpp 2 additions, 2 deletionssrc/language/ASTNodeDataTypeBuilder.cpp
- src/language/ASTNodeDataVariant.hpp 1 addition, 1 deletionsrc/language/ASTNodeDataVariant.hpp
- src/language/ASTNodeExpressionBuilder.cpp 1 addition, 1 deletionsrc/language/ASTNodeExpressionBuilder.cpp
- src/language/ASTNodeIncDecExpressionBuilder.cpp 1 addition, 1 deletionsrc/language/ASTNodeIncDecExpressionBuilder.cpp
- src/language/ASTSymbolInitializationChecker.cpp 3 additions, 3 deletionssrc/language/ASTSymbolInitializationChecker.cpp
- src/language/ASTSymbolTableBuilder.cpp 2 additions, 2 deletionssrc/language/ASTSymbolTableBuilder.cpp
- src/language/PugsParser.cpp 0 additions, 1 deletionsrc/language/PugsParser.cpp
- src/language/SymbolTable.hpp 35 additions, 5 deletionssrc/language/SymbolTable.hpp
- tests/test_ASTSymbolInitializationChecker.cpp 13 additions, 7 deletionstests/test_ASTSymbolInitializationChecker.cpp
- tests/test_SymbolTable.cpp 22 additions, 9 deletionstests/test_SymbolTable.cpp
Loading
Please register or sign in to comment