Documentation
¶
Overview ¶
checker is the static-analysis pass behind `mx check`. Today it catches three classes of bug before the program runs:
- undefined identifiers (typos, forgotten imports)
- wrong arity on calls to user-defined functions
- unused `let` bindings (warnings, not errors)
The checker walks the AST exactly once, maintaining a scope chain that mirrors how the interpreter would build environments at run time. When it visits a route or function body, it pushes a new child scope so locals don't leak into siblings.
The checker doesn't attempt to model values or types — MX is dynamically typed and most useful errors at this layer are about names, not types. A real type system can grow on top later.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diagnostic ¶
Diagnostic is one issue found during analysis.
func Check ¶
func Check(prog *parser.Program) []Diagnostic
Check runs the analyzer over a parsed program and returns every diagnostic found, in source order.