Function oursh::program::parse[][src]

pub fn parse<P: Program, R: BufRead>(reader: R) -> Result<P, ()>

Parse a program of the given type.

Examples

use oursh::program::{parse, PosixProgram, BasicProgram};

let program = b"sleep 1; date & date";
assert!(parse::<PosixProgram, &[u8]>(program).is_ok());
// TODO: assert!(parse::<BasicProgram, &[u8]>(program).is_err());