Crates.io | renpy_parser |
lib.rs | renpy_parser |
version | 0.0.3 |
source | src |
created_at | 2024-11-05 16:42:40.114157 |
updated_at | 2024-11-10 17:48:35.862871 |
description | Parse renpy script files with Rust |
homepage | |
repository | https://github.com/stillonearth/renpy-rs |
max_upload_size | |
id | 1436790 |
size | 200,405 |
Ren'Py Scenario File Parser in Rust (translated from Ren'Py's parser.py)
This parser handles a subset of the Ren'Py scripting language, excluding support for variables, expressions, and Python code.
Supported keywords:
use renpy_parser::{group_logical_lines, lexer::Lexer, list_logical_lines, parsers::parse_block};
fn main() {
let lines = list_logical_lines("assets/script.rpy").unwrap();
let blocks = group_logical_lines(lines).unwrap();
let l = &mut Lexer::new(blocks.clone(), true);
let (asts, errors) = parse_block(l);
for ast in asts {
println!("ast: {:?}", ast);
}
}