arpx_job_parser

Crates.ioarpx_job_parser
lib.rsarpx_job_parser
version0.1.12
sourcesrc
created_at2022-02-14 03:26:42.447316
updated_at2022-03-01 03:53:23.937861
descriptionParse arpx job scripts for runtime
homepage
repositoryhttps://github.com/jaredgorski/arpx_job_parser
max_upload_size
id531997
size71,105
Jared Gorski (jaredgorski)

documentation

README

arpx_job_parser

Parse arpx job scripts for runtime

Description

This library provides parser functions for processing arpx job scripts.

Usage

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",
//                         },
//                     ],
//                 },
//             ],
//         },
//     ),
// )
Commit count: 42

cargo fmt