7 releases
Uses new Rust 2024
new 0.1.15 | Apr 1, 2025 |
---|---|
0.1.14 | Apr 1, 2025 |
0.1.13 | Mar 30, 2025 |
0.0.14 | Apr 1, 2025 |
#1063 in Data structures
388 downloads per month
Used in 6 crates
(4 directly)
345KB
8K
SLoC
Swamp Analyzer
Performs semantic analysis for the Swamp programming language.
Overview
This crate bridges the gap between parsing and code generation/interpretation. It takes the Abstract Syntax Tree (AST) generated by swamp-parser
(using types from swamp-ast
) and transforms it into a type-checked, resolved Abstract Semantic Graph (ASG) defined in swamp-semantic
.
The core process involves:
- Type Checking: Verifying that operations, assignments, function calls, etc., adhere to the Swamp type system rules.
- Name Resolution: Linking identifiers (variables, functions, types) to their definitions within the correct scope.
- Semantic Validation: Performing other checks like correct function arity, operator usage, and pattern matching exhaustiveness (potentially).
- ASG Construction: Building the
swamp_semantic::Expression
tree, which represents the program with full type information and resolved references.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright
Copyright (c) Peter Bjorklund. All rights reserved. https://github.com/swamp/swamp
Dependencies
~490KB