yaml_parser

Crates.ioyaml_parser
lib.rsyaml_parser
version0.2.2
sourcesrc
created_at2024-07-04 07:55:48.246035
updated_at2024-08-25 10:24:59.020491
descriptionSemi-tolerant YAML concrete syntax tree parser.
homepage
repositoryhttps://github.com/g-plane/pretty_yaml
max_upload_size
id1291402
size92,715
Pig Fang (g-plane)

documentation

README

yaml_parser

Crates.io docs.rs

Semi-tolerant YAML concrete syntax tree parser.

Usage

match yaml_parser::parse(&code) {
    Ok(tree) => println!("{tree:#?}"),
    Err(err) => eprintln!("{err}"),
};

It produces rowan tree if succeeded. For consuming the tree, see rowan's docs.

If you need to build AST from CST, use ast module:

let root = yaml_parser::ast::Root::cast(tree).unwrap();
dbg!(root);

Tests

Tests come from official test suite.

License

MIT License

Copyright (c) 2024-present Pig Fang

Commit count: 200

cargo fmt