Skip to content

Add a SymbolKindTable to DAGCode, make infer_kinds() a transformation, test infer_kinds()

Matt Wala requested to merge sym-kind-table-in-dagcode into master

This adds a new attribute called sym_kind_table to DAGCode which is a SymbolKindTable. The function infer_kinds is changed to be a transformation that returns a modified DAGCode object with all symbol kinds inferred.

Since DAGCode is immutable, SymbolKindTable is changed to be immutable as well. The interface is changed to make SymbolKindTable free of side effects. To maintain efficiency, the underlying dicts are replaced with persistent dictionaries provided by pyrsistent.

This change also makes it an error when unification fails in SymbolKindTable.set()

Also this adds simple tests for kind inference.

Closes #35 by providing an interface to supply kind information when kind inference won't work

Edited by Matt Wala

Merge request reports

Loading