35 releases
Uses new Rust 2024
| 0.2.26 | Aug 18, 2025 |
|---|---|
| 0.2.25 | Aug 16, 2025 |
| 0.2.19 | Jul 30, 2025 |
| 0.1.16 | Apr 7, 2025 |
| 0.0.14 | Apr 1, 2025 |
#13 in #semantic-analysis
177 downloads per month
Used in 11 crates
(4 directly)
540KB
12K
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::Expressiontree, 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
~680KB
~13K SLoC