2024-04-02 14:57:23 +00:00
|
|
|
# saphyr-parser
|
2015-05-28 17:56:03 +00:00
|
|
|
|
2024-04-02 14:57:23 +00:00
|
|
|
[saphyr-parser](https://github.com/saphyr-rs/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.**
|
2024-03-25 00:00:19 +00:00
|
|
|
|
2024-02-08 06:12:14 +00:00
|
|
|
This work is based on [`yaml-rust`](https://github.com/chyh1990/yaml-rust) with
|
|
|
|
fixes towards being compliant to the [YAML test
|
|
|
|
suite](https://github.com/yaml/yaml-test-suite/). `yaml-rust`'s parser is
|
|
|
|
heavily influenced by `libyaml` and `yaml-cpp`.
|
2015-05-28 17:56:03 +00:00
|
|
|
|
2024-04-02 14:57:23 +00:00
|
|
|
`saphyr-parser` is a pure Rust YAML 1.2 implementation that benefits from the
|
2024-03-17 09:24:09 +00:00
|
|
|
memory safety and other benefits from the Rust language.
|
2015-05-30 17:58:39 +00:00
|
|
|
|
2024-04-02 14:57:23 +00:00
|
|
|
## Installing
|
|
|
|
Add the following to your Cargo.toml:
|
2015-05-30 17:58:39 +00:00
|
|
|
|
2017-05-10 21:09:30 +00:00
|
|
|
```toml
|
2015-06-04 08:39:53 +00:00
|
|
|
[dependencies]
|
2024-10-24 16:38:46 +00:00
|
|
|
saphyr-parser = "0.0.3"
|
2015-06-04 08:39:53 +00:00
|
|
|
```
|
2024-04-02 14:57:23 +00:00
|
|
|
or use `cargo add` to get the latest version automatically:
|
|
|
|
```sh
|
|
|
|
cargo add saphyr-parser
|
2015-05-30 17:58:39 +00:00
|
|
|
```
|
|
|
|
|
2024-04-02 14:57:23 +00:00
|
|
|
## TODO how-to
|
2015-05-30 17:58:39 +00:00
|
|
|
|
2023-08-19 14:41:51 +00:00
|
|
|
## 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.
|
|
|
|
|
2015-05-28 17:56:03 +00:00
|
|
|
## Specification Compliance
|
|
|
|
|
2024-02-08 06:12:14 +00:00
|
|
|
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](https://github.com/yaml/yaml-test-suite/).
|
2019-07-24 16:25:10 +00:00
|
|
|
|
2016-01-11 04:53:19 +00:00
|
|
|
## License
|
|
|
|
|
|
|
|
Licensed under either of
|
|
|
|
|
2024-02-08 06:12:14 +00:00
|
|
|
* Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
|
|
|
|
* MIT license (http://opensource.org/licenses/MIT)
|
2016-01-11 04:53:19 +00:00
|
|
|
|
|
|
|
at your option.
|
|
|
|
|
2024-02-08 06:12:14 +00:00
|
|
|
Since this repository was originally maintained by
|
|
|
|
[chyh1990](https://github.com/chyh1990), there are 2 sets of licenses.
|
|
|
|
A license of each set must be included in redistributions. See the
|
|
|
|
[LICENSE](LICENSE) file for more details.
|
|
|
|
|
|
|
|
You can find licences in the [`.licenses`](.licenses) subfolder.
|
|
|
|
|
2015-05-30 17:58:39 +00:00
|
|
|
## Contribution
|
|
|
|
|
2024-04-02 14:57:23 +00:00
|
|
|
[Fork this repository](https://github.com/saphyr-rs/saphyr-parser/fork) and
|
|
|
|
[Create a Pull Request on Github](https://github.com/saphyr-rs/saphyr-parser/compare/master...saphyr-rs:saphyr-parser:master).
|
2024-03-25 00:00:19 +00:00
|
|
|
You may need to click on "compare across forks" and select your fork's branch.
|
2016-01-11 04:53:19 +00:00
|
|
|
|
|
|
|
Unless you explicitly state otherwise, any contribution intentionally submitted
|
2024-02-08 06:12:14 +00:00
|
|
|
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.
|
2024-03-25 00:00:19 +00:00
|
|
|
|
|
|
|
## Links
|
|
|
|
|
2024-04-02 14:57:23 +00:00
|
|
|
* [saphyr-parser source code repository](https://github.com/saphyr-rs/saphyr-parser)
|
2024-03-25 00:00:19 +00:00
|
|
|
|
2024-04-02 14:57:23 +00:00
|
|
|
* [saphyr-parser releases on crates.io](https://crates.io/crates/saphyr-parser)
|
2024-03-25 00:00:19 +00:00
|
|
|
|
2024-04-02 14:57:23 +00:00
|
|
|
* [saphyr-parser documentation on docs.rs](https://docs.rs/saphyr-parser/latest/saphyr-parser/)
|
2024-03-25 00:00:19 +00:00
|
|
|
|
|
|
|
* [yaml-test-suite](https://github.com/yaml/yaml-test-suite)
|