summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNadrieril2019-03-03 15:58:29 +0100
committerNadrieril2019-03-03 15:58:29 +0100
commit7edf830a0e5d4fad088ce099ebc2e14b2f5f3847 (patch)
tree9c60c66a1ab2bd24c09679a750d1d88ca828b5e6
parent8c22856983fb30f5dc46786b3c3fc40b9bcab44e (diff)
tweak
-rw-r--r--dhall/src/parser.rs19
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!(()));