swamp-analyzer

Crates.ioswamp-analyzer
lib.rsswamp-analyzer
version0.2.26
created_at2025-03-29 15:10:25.896653+00
updated_at2025-08-18 11:21:09.992719+00
descriptionanalyzer for swamp
homepage
repositoryhttps://github.com/swamp/swamp
max_upload_size
id1611386
size518,499
Peter Bjorklund (piot)

documentation

README

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

Commit count: 802

cargo fmt