Expand description
Semantic analysis passes.
Provides analysis passes that transform parsed AST into analyzed form:
- Name resolution (symbol_table)
- Dependency analysis and recursion detection (dependencies)
- Type inference (type_check)
- Grammar linking (link)
- Semantic validation (validation)
Modules§
- dependencies
- Dependency analysis for definitions.
- link
- Link pass: resolve node types and fields against tree-sitter grammar.
- refs
- Utilities for working with definition references in expressions.
- symbol_
table - Symbol table: name resolution and reference checking.
- type_
check - Unified type checking pass.
- validation
- Semantic validation passes.
- visitor
- AST Visitor pattern.
Structs§
- Dependency
Analysis - Result of dependency analysis.
- Link
Output - Output from the link phase for binary emission.
- Symbol
Table - Registry of named definitions in a query.
- Type
Context - Central registry for types, symbols, and expression metadata.
Constants§
- UNNAMED_
DEF - Sentinel name for unnamed definitions (bare expressions at root level). Code generators can emit whatever name they want for this.
Traits§
Functions§
- infer_
types - Run type inference on all definitions.
- primary_
def_ name - Get the primary definition name (first non-underscore, or underscore if none).
- validate_
alt_ kinds - validate_
anchors - validate_
empty_ constructs - validate_
predicates - validate_
recursion - Validate recursion using the pre-computed dependency analysis.
- walk_
expr