Struct rad::processor::Processor [−][src]
pub struct Processor { /* fields omitted */ }Expand description
Processor that parses(lexes) given input and print out to desginated output
Implementations
Set write option to yield output to the file
Yield error to the file
Use unix line ending instead of operating system’s default one
Add custom rules
Open authority of processor
Open authority of processor but yield warning
Print current permission status
Print the result of a processing
Freeze to single file
Frozen file is a bincode encoded binary format file.
Add new closure rule
Accessing index bigger or equal to the length of argument vector is panicking error while “insufficient arguments” will simply prints error without panicking and stop evaluation.
Args
name- Name of the macro to addarg_count- Count of macro’s argumentclosure- Vector of string is an parsed arguments with given length.
Example
processor.add_closure_rule(
"test",
2,
Box::new(|args: Vec<String>| -> Option<String> {
Some(format!("First : {}\nSecond: {}", args[0], args[1]))
})
);Read from standard input
If debug mode is enabled this, doesn’t read stdin line by line but by chunk because user input is also a standard input and processor cannot distinguish the two