Overload Resolution for Python Programs #
Walks a Python AST and collects which overloaded service modules
are actually used. Given an OverloadTable (from a dispatch
.pyspec.st.ion file), the walker finds every Call whose
function name appears in the table and whose first argument is
a string literal matching an overload entry, then records the
pythonModule of the resolved return type.
The result is a deduplicated set of module names that can be used
to determine which .pyspec.st.ion files are needed.
Recursive AST Walker #
def
Strata.Python.Specs.IdentifyOverloads.resolveOverloads
(overloads : OverloadTable)
(stmts : Array (stmt SourceRange))
:
Run the walker over the top-level statements and return the final state containing collected modules and warnings.
Equations
- Strata.Python.Specs.IdentifyOverloads.resolveOverloads overloads stmts = (StateT.run (ReaderT.run (Strata.Python.Specs.IdentifyOverloads.walkStmtsâ stmts) overloads) { }).snd