Crates.io | r7rs-parser |
lib.rs | r7rs-parser |
version | 0.1.0 |
source | src |
created_at | 2022-10-28 07:00:59.243096 |
updated_at | 2022-10-28 07:00:59.243096 |
description | Simple Scheme R7RS parser & lexer |
homepage | |
repository | https://github.com/playxe/r7rs-parser |
max_upload_size | |
id | 700165 |
size | 70,381 |
Simple R7RS Scheme parser.
use r7rs_parser::{ parser::Parser, expr::NoIntern};
const SOURCE: &'static str = r#"
#!fold-case
(Add 2 3+43i 4145125125153151351351353 3/4)
"#;
fn main() {
let mut i = NoIntern;
let mut parser = Parser::new(&mut i, &SOURCE, false);
while !parser.finished() {
match parser.parse(true) {
Ok(expr) => {
let s = expr.to_string(&NoIntern, false);
println!("{}", s);
}
Err(e) => {
println!("{}", e);
}
}
}
}