diff options
author | Griffin Smith <root@gws.fyi> | 2021-03-13T17·19-0500 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2021-03-13T17·19-0500 |
commit | 3dff189499af1ddd60d8fc128b794d15f1cb19ae (patch) | |
tree | 7349a51c332fd2049c1b7874eff434fe9e85a6e5 /src/parser/macros.rs | |
parent | 1ea2d8ba9fef3bee2c757d19d8b42e541e3fe390 (diff) |
Factor out expr parser into its own module
Diffstat (limited to 'src/parser/macros.rs')
-rw-r--r-- | src/parser/macros.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/parser/macros.rs b/src/parser/macros.rs new file mode 100644 index 000000000000..60db5133dc0f --- /dev/null +++ b/src/parser/macros.rs @@ -0,0 +1,15 @@ +#[macro_use] +macro_rules! test_parse { + ($parser: ident, $src: expr) => {{ + let res = $parser($src); + nom_trace::print_trace!(); + let (rem, res) = res.unwrap(); + assert!( + rem.is_empty(), + "non-empty remainder: \"{}\", parsed: {:?}", + rem, + res + ); + res + }}; +} |