Skip to content

Commit 7e7bebf

Browse files
author
Jose Rodriguez
committed
refact: removes long imports
Also improves some typing
1 parent c67c2b2 commit 7e7bebf

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/api/symboltable/symboltable.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@
2424
warning_implicit_type,
2525
warning_not_used,
2626
)
27-
from src.api.symboltable.scope import Scope
2827
from src.symbols import sym as symbols
2928
from src.symbols.symbol_ import Symbol
3029

30+
from .scope import Scope
31+
3132

3233
class SymbolTable:
3334
"""Implements a symbol table.

src/zxbc/zxbparser.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,8 @@
2020
import src.api.config
2121
import src.api.dataref
2222
import src.api.options
23-
import src.api.symboltable
24-
25-
# Compiler API
26-
import src.api.symboltable.symboltable
2723
import src.api.utils
2824

29-
# Lexers and parsers, etc
30-
import src.ply.yacc as yacc
31-
3225
# Symbol Classes
3326
from src import arch
3427

@@ -54,6 +47,12 @@
5447
from src.api.errmsg import error, warning
5548
from src.api.global_ import LoopInfo
5649
from src.api.opcodestemps import OpcodesTemps
50+
51+
# Compiler API
52+
from src.api.symboltable.symboltable import SymbolTable
53+
54+
# Lexers and parsers, etc
55+
from src.ply import yacc
5756
from src.symbols import sym
5857
from src.symbols.id_ import SymbolID
5958
from src.symbols.symbol_ import Symbol
@@ -81,7 +80,7 @@
8180
# ----------------------------------------------------------------------
8281
# Global Symbol Table
8382
# ----------------------------------------------------------------------
84-
SYMBOL_TABLE = gl.SYMBOL_TABLE = src.api.symboltable.symboltable.SymbolTable()
83+
SYMBOL_TABLE = gl.SYMBOL_TABLE = SymbolTable()
8584

8685
# ----------------------------------------------------------------------
8786
# Defined user labels. They all are prepended _label_. Line numbers 10,
@@ -92,17 +91,17 @@
9291
# ----------------------------------------------------------------------
9392
# True if we're in the middle of a LET sentence. False otherwise.
9493
# ----------------------------------------------------------------------
95-
LET_ASSIGNMENT = False
94+
LET_ASSIGNMENT: bool = False
9695

9796
# ----------------------------------------------------------------------
9897
# True if PRINT sentence has been used.
9998
# ----------------------------------------------------------------------
100-
PRINT_IS_USED = False
99+
PRINT_IS_USED: bool = False
101100

102101
# ----------------------------------------------------------------------
103102
# Last line number output for checking program key board BREAK
104103
# ----------------------------------------------------------------------
105-
last_brk_linenum = 0
104+
last_brk_linenum: int = 0
106105

107106

108107
# ----------------------------------------------------------------------

0 commit comments

Comments
 (0)