Crate cttt_parser
source ·Expand description
cttt-parser
A parser for the Change This Then That.
Examples
Basic usage:
let s = "
// @cttt.name(foo)
let x = 1;
// @cttt.change(bar)
// @cttt.name(bar)
let y = 2;
// @cttt.change(foo)
";
println!("{:#?}", cttt_parser::parse(s));
Strict usage:
let s = "
// @cttt.name(foo)
let x = 1;
// @cttt.change(bar)
// @cttt.name(bar)
let y = 2;
// @cttt.change(foo)
";
println!(
"{:#?}",
cttt_parser::parse_strict(s, vec!["name".to_string(), "change".to_string()])
);
Structs
- A Comment with a command and arguments
- Debug information for a Comment
- Error identifying location of unknown command
Enums
- Error identifying location of unknown command or other parsing error
Statics
- Namespace for commands
Functions
- Parse a string into a vector of Comments.
- Parse a string into a vector of Comments, and check for unknown commands.