From 0d01692c97ea8ca6fc4b229e5b9678cb252bceda Mon Sep 17 00:00:00 2001 From: Greg Brown Date: Sat, 9 Jan 2021 14:31:02 +0000 Subject: Introduce chomp as a procedural macro. Add a bunch of tests. Fix chomp and chewed so autochomp compiles. --- chomp-macro/tests/sheep.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 chomp-macro/tests/sheep.rs (limited to 'chomp-macro/tests/sheep.rs') diff --git a/chomp-macro/tests/sheep.rs b/chomp-macro/tests/sheep.rs new file mode 100644 index 0000000..862e810 --- /dev/null +++ b/chomp-macro/tests/sheep.rs @@ -0,0 +1,15 @@ +chomp_macro::nibble! { + let opt(x) = _ | x; + let plus(x) = [rec](x . opt(rec)); + match "ba" . plus("a"); +} + +#[test] +fn baa() { + Ast::parse_str("baa").unwrap(); +} + +#[test] +fn baaaaaaaaaaaaaaa() { + Ast::parse_str("baaaaaaaaaaaaaaa").unwrap(); +} -- cgit v1.2.3