Crate cttt_parser

source ·
Expand description

cttt-parser

Crates.io Docs.rs Test Audit

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

Enums

Statics

Functions

  • Parse a string into a vector of Comments.
  • Parse a string into a vector of Comments, and check for unknown commands.