saphyr-serde/parser
jneem 434f4521dd Better tracking for beginning and ending positions of mappings. (#10)
Previously, we often used the scanner state to infer the positions of
mappings. This is sometimes wrong, because the scanner has already
scanned ahead by the time the mapping is parsed.

This commit adds a check to the test suite, asserting that parser event
positions are all observed in order, and it fixes the scanner and parser
to make the new check pass.
2024-10-13 14:47:41 +02:00
..
.cargo Add bench_compare tool. 2024-03-15 18:29:54 +01:00
.github/workflows Run CI only on master pushes. 2024-03-21 12:33:00 +01:00
.licenses Update licence, readme, doc. 2024-02-08 07:12:14 +01:00
documents maint: version-up and minimize where we mention the version 2024-03-25 22:25:46 -07:00
src Better tracking for beginning and ending positions of mappings. (#10) 2024-10-13 14:47:41 +02:00
tests Better tracking for beginning and ending positions of mappings. (#10) 2024-10-13 14:47:41 +02:00
tools Use spans instead of markers (#3) 2024-08-05 17:08:23 +02:00
.gitattributes Add linguist attributes for tests/*.rs.inc files 2024-03-25 20:11:04 +01:00
Cargo.toml Some cleanup after monorepo-ing. 2024-10-12 16:29:33 +02:00
CHANGELOG.md v0.0.2 2024-06-13 22:18:27 +02:00
garden.yaml garden: access yaml-rust2 pull requests as yaml-rust2/pull/* 2024-03-25 22:18:37 -07:00
justfile Improve buffer handling in scan_plain_scalar. 2024-08-05 01:11:13 +02:00
LICENSE Update licence, readme, doc. 2024-02-08 07:12:14 +01:00
README.md v0.0.2 2024-06-13 22:18:27 +02:00

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.2"

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.