| Crates.io | spectec_ast |
| lib.rs | spectec_ast |
| version | 1.0.0 |
| created_at | 2026-01-01 23:39:49.709675+00 |
| updated_at | 2026-01-01 23:39:49.709675+00 |
| description | Parser for SpecTec ASTs in S-expression format |
| homepage | |
| repository | https://github.com/cyruscook/spectec_parse |
| max_upload_size | |
| id | 2017713 |
| size | 32,207 |
Parser for SpecTec ASTs in S-expression format.
Reads S-expressions from the sexpr_parse crate into the AST format.
let input = r#"(typ "m" (inst (alias nat)))"#;
let parsed = parse_spectec_stream(input).unwrap();
assert_eq!(
parsed,
vec![SpecTecDef::Typ {
x: "m".to_string(),
insts: vec![SpecTecInst::Inst {
bs: vec![],
as_: vec![],
dt: SpecTecDefTyp::Alias {
typ: SpecTecTyp::Num(SpecTecNumTyp::Nat),
},
}],
ps: vec![],
},]
);