-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Labels
C: calyx-pyItems that have to do with the builder libraryItems that have to do with the builder libraryPriority: LowDon't do these during a deadlineDon't do these during a deadlineS: AvailableCan be worked uponCan be worked upongood first issueGood issue to start contributing on CalyxGood issue to start contributing on Calyx
Description
The calyx-py AST library tracks (Python) source positions using mutable global state. There are global configuration variables that control the tracking:
calyx/calyx-py/calyx/py_ast.py
Lines 8 to 16 in 85968c4
""" | |
The base path that fileinfos will be relative with respect to. If None, absolute paths will be used. | |
""" | |
FILEINFO_BASE_PATH = None | |
""" | |
Determines if sourceinfo and @pos attributes should be emitted or not. | |
""" | |
EMIT_SOURCELOC = True |
And a couple of global tables that store the actual data in class variables, like this:
calyx/calyx-py/calyx/py_ast.py
Lines 36 to 37 in 85968c4
FileTable.table[filename] = FileTable.counter | |
FileTable.counter += 1 |
Both of these can cause classic global-mutable-state problems with testability and so on. It would be better to associate all of these with the root Program
class instead. This way, it would be possible to construct two different Program
s from the same Python code and not have them clobber each other.
Metadata
Metadata
Assignees
Labels
C: calyx-pyItems that have to do with the builder libraryItems that have to do with the builder libraryPriority: LowDon't do these during a deadlineDon't do these during a deadlineS: AvailableCan be worked uponCan be worked upongood first issueGood issue to start contributing on CalyxGood issue to start contributing on Calyx