#module #swamp

swamp-modules

Module support for Swamp

4 releases

Uses new Rust 2024

new 0.1.13 Mar 30, 2025
0.1.12 Mar 30, 2025
0.1.11 Mar 29, 2025
0.1.10 Mar 29, 2025

#3 in #modules

Download history

87 downloads per month
Used in 9 crates (7 directly)

MIT license

105KB
3K SLoC

Swamp Modules

Data structures for representing modules and their contents in the Swamp programming language.

This crate defines how modules are structured and how symbols (types, functions, constants, etc.) are organized and accessed within them.

Overview

  • Module / ModuleRef: Represents a compiled Swamp module.
  • SymbolTable: A key structure holding all the named definitions (symbols) exported by or defined within a module. It allows looking up types, functions, constants, aliases, type blueprints, and linked modules by name.
  • Symbol Enum: Defines the different kinds of entities that can be stored in a SymbolTable, such as Type, FunctionDefinition, Constant, Alias, Blueprint, Module, etc.
  • Integration: Relies heavily on types defined in swamp-types and swamp-semantic to represent the actual definitions stored in the symbol table.

Installation

Add this to your Cargo.toml:

[dependencies]
swamp-modules = "0.1.13"

License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright (c) Peter Bjorklund. All rights reserved. https://github.com/swamp/swamp

Dependencies

~475KB