diff options
author | pommicket <pommicket@gmail.com> | 2025-09-07 22:51:58 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-09-07 22:51:58 -0400 |
commit | 8d5b16efda7c21fabd3cec655d143ed3e78ea5e6 (patch) | |
tree | abef05b4f14321b34ba1b7c603d1eb7512aa5972 /examples | |
parent | 575bb3913b01ec83490d61f0540ccdcb4d861845 (diff) |
More parser
Diffstat (limited to 'examples')
-rw-r--r-- | examples/conf.pom | 1 | ||||
-rw-r--r-- | examples/simple.rs | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/examples/conf.pom b/examples/conf.pom new file mode 100644 index 0000000..5fe5fbb --- /dev/null +++ b/examples/conf.pom @@ -0,0 +1 @@ +fav-colour = green diff --git a/examples/simple.rs b/examples/simple.rs new file mode 100644 index 0000000..161baac --- /dev/null +++ b/examples/simple.rs @@ -0,0 +1,16 @@ +use pom_parser::Configuration; +use std::process::ExitCode; + +fn try_main() -> Result<(), Box<dyn std::error::Error>> { + let conf = Configuration::load_path("examples/conf.pom")?; + println!("{conf}"); + Ok(()) +} + +fn main() -> ExitCode { + if let Err(e) = try_main() { + eprintln!("Error: {e}"); + return ExitCode::FAILURE; + } + ExitCode::SUCCESS +} |