3 releases

0.0.3 Oct 25, 2024
0.0.2 Jun 13, 2024
0.0.1 Apr 2, 2024

#1082 in Parser implementations

Download history 1164/week @ 2024-07-26 1062/week @ 2024-08-02 967/week @ 2024-08-09 828/week @ 2024-08-16 1260/week @ 2024-08-23 1134/week @ 2024-08-30 1107/week @ 2024-09-06 803/week @ 2024-09-13 784/week @ 2024-09-20 894/week @ 2024-09-27 786/week @ 2024-10-04 873/week @ 2024-10-11 994/week @ 2024-10-18 2130/week @ 2024-10-25 1965/week @ 2024-11-01 630/week @ 2024-11-08

5,831 downloads per month
Used in 7 crates (3 directly)

MIT/Apache

185KB
4K SLoC

saphyr-parser

saphyr-parser is a fully compliant YAML 1.2 parser implementation written in pure Rust.

If you want to load to a YAML Rust structure or manipulate YAML objects, use saphyr instead of saphyr-parser. This crate contains only the parser.

This work is based on yaml-rust with fixes towards being compliant to the YAML test suite. yaml-rust's parser is heavily influenced by libyaml and yaml-cpp.

saphyr-parser is a pure Rust YAML 1.2 implementation that benefits from the memory safety and other benefits from the Rust language.

Installing

Add the following to your Cargo.toml:

[dependencies]
saphyr-parser = "0.0.3"

or use cargo add to get the latest version automatically:

cargo add saphyr-parser

TODO how-to

Security

This library does not try to interpret any type specifiers in a YAML document, so there is no risk of, say, instantiating a socket with fields and communicating with the outside world just by parsing a YAML document.

Specification Compliance

This implementation is fully compatible with the YAML 1.2 specification. In order to help with compliance, yaml-rust2 tests against (and passes) the YAML test suite.

License

Licensed under either of

at your option.

Since this repository was originally maintained by chyh1990, there are 2 sets of licenses. A license of each set must be included in redistributions. See the LICENSE file for more details.

You can find licences in the .licenses subfolder.

Contribution

Fork this repository and Create a Pull Request on Github. You may need to click on "compare across forks" and select your fork's branch.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~2MB
~31K SLoC