diff options
Diffstat (limited to '')
-rw-r--r-- | dhall/src/parser.rs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/dhall/src/parser.rs b/dhall/src/parser.rs index bb73b11..906b696 100644 --- a/dhall/src/parser.rs +++ b/dhall/src/parser.rs @@ -25,6 +25,16 @@ pub fn custom_parse_error(pair: &Pair<Rule>, msg: String) -> ParseError { } + +macro_rules! named { + ($name:ident<$o:ty>; $submac:ident!( $($args:tt)* )) => ( + #[allow(unused_variables)] + fn $name(pair: Pair<Rule>) -> ParseResult<$o> { + $submac!(pair; $($args)*) + } + ); +} + macro_rules! match_children { // Normal pattern (@0, $pairs:expr, $x:ident : $ty:ident $($rest:tt)*) => { @@ -145,15 +155,6 @@ macro_rules! match_rule { }; } -macro_rules! named { - ($name:ident<$o:ty>; $submac:ident!( $($args:tt)* )) => ( - #[allow(unused_variables)] - fn $name(pair: Pair<Rule>) -> ParseResult<$o> { - $submac!(pair; $($args)*) - } - ); -} - named!(eoi<()>; plain_value!(())); |