Gura Rust parser

This repository contains the implementation of a Gura (compliant with version 1.0.0) format parser for Rust lang.
Documentation -
Cargo
Installation
Add the dependency to your Cargo.toml:
[dependencies]
gura = "0.2.0"
Usage
use gura::{dump, parse, GuraType};
fn main() {
let gura_string = "
# This is a Gura document.
title: \"Gura Example\"
an_object:
username: \"Stephen\"
pass: \"Hawking\"
# Line breaks are OK when inside arrays
hosts: [
\"alpha\",
\"omega\"
]"
.to_string();
let parsed = parse(&gura_string).unwrap();
println!("Title -> {}", parsed["title"]);
println!("\nHosts:");
if let GuraType::Array(hosts) = &parsed["hosts"] {
for host in hosts.iter() {
println!("Host -> {}", *host);
}
}
let string_again = dump(&parsed);
println!("\n+++++ Dump result +++++");
println!("{}", string_again);
}
Contributing
All kind of contribution is welcome! If you want to contribute just:
- Fork this repository.
- Create a new branch and introduce there your new changes.
- Make a Pull Request!
Or you can join to our community in Discord!
Tests
To run all the tests: cargo test
Licence
This repository is distributed under the terms of the MIT license.