| Crates.io | swamp-parser |
| lib.rs | swamp-parser |
| version | 0.2.26 |
| created_at | 2025-03-29 16:02:21.535189+00 |
| updated_at | 2025-08-18 11:24:23.491466+00 |
| description | Parses Swamp programming language source code into an Abstract Syntax Tree (AST) defined in the `swamp-ast` crate, using the pest parsing library. |
| homepage | |
| repository | https://github.com/swamp/swamp |
| max_upload_size | |
| id | 1611422 |
| size | 147,083 |
Parses Swamp programming language source code text into an Abstract Syntax Tree (AST).
This crate takes a string containing Swamp source code and attempts to parse it according to the grammar defined in src/grammar.pest. If successful, it produces an AST representation using the data structures defined in the swamp-ast crate. If the source code contains syntax errors, it returns a ParseError.
The parser is built using the pest parser generator library.
&str.Result<swamp_ast::Module, ParseError>.swamp_ast::Module).ParseError) provides information about the location and nature of the syntax error.swamp_ast::Node containing SpanWithoutFileId) to the generated AST nodes.Add this to your Cargo.toml:
[dependencies]
swamp-parser = "0.2.26"
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