Crates.io | arpx_job_parser |
lib.rs | arpx_job_parser |
version | 0.1.12 |
source | src |
created_at | 2022-02-14 03:26:42.447316 |
updated_at | 2022-03-01 03:53:23.937861 |
description | Parse arpx job scripts for runtime |
homepage | |
repository | https://github.com/jaredgorski/arpx_job_parser |
max_upload_size | |
id | 531997 |
size | 71,105 |
Parse arpx job scripts for runtime
This library provides parser functions for processing arpx job scripts.
use arpx_job_parser::parse_job;
fn main() {
let job = r#"
[
(loop1 ? loop2 : loop3;)
loop2 ? loop3 : loop4;
]
loop3 ? loop4 : loop5;
loop6;
(loop7 ? loop8;)
"#;
let parsed = parse_job(job);
dbg!(parsed);
}
// [src/main.rs:16] parsed = Ok(
// (
// "",
// Job {
// tasks: [
// Task {
// processes: [
// Process {
// name: "loop1",
// onfail: "loop3",
// onsucceed: "loop2",
// },
// Process {
// name: "loop2",
// onfail: "loop4",
// onsucceed: "loop3",
// },
// ],
// },
// Task {
// processes: [
// Process {
// name: "loop3",
// onfail: "loop5",
// onsucceed: "loop4",
// },
// ],
// },
// Task {
// processes: [
// Process {
// name: "loop6",
// onfail: "",
// onsucceed: "",
// },
// ],
// },
// Task {
// processes: [
// Process {
// name: "loop7",
// onfail: "",
// onsucceed: "loop8",
// },
// ],
// },
// ],
// },
// ),
// )