From 0388d9858627693bab2433f134eb4ed1d6e9b164 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 6 Sep 2019 18:17:36 +0200 Subject: Make ParseInput independent from dhall-specific types --- dhall_proc_macros/src/make_parser.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dhall_proc_macros/src/make_parser.rs') diff --git a/dhall_proc_macros/src/make_parser.rs b/dhall_proc_macros/src/make_parser.rs index a17ab61..c0594a5 100644 --- a/dhall_proc_macros/src/make_parser.rs +++ b/dhall_proc_macros/src/make_parser.rs @@ -179,7 +179,7 @@ fn apply_special_attrs(f: &mut ParsedFn, rule_enum: &Ident) -> Result<()> { #function #climber.climb( - #input_arg.pair.clone().into_inner(), + #input_arg.as_pair().clone().into_inner(), |p| Self::#child_rule(#input_arg.with_pair(p)), |l, op, r| { #fn_name(#input_arg.clone(), l?, op, r?) @@ -207,9 +207,9 @@ fn apply_special_attrs(f: &mut ParsedFn, rule_enum: &Ident) -> Result<()> { let mut #input_arg = #input_arg; // While the current rule allows shortcutting, and there is a single child, and the // child can still be parsed by the current function, then skip to that child. - while ::allows_shortcut(#input_arg.as_rule()) { + while ::allows_shortcut(#input_arg.as_rule()) { if let Some(child) = #input_arg.single_child() { - if &::rule_alias(child.as_rule()) + if &::rule_alias(child.as_rule()) == stringify!(#fn_name) { #input_arg = child; continue; @@ -313,7 +313,7 @@ pub fn make_parser( let ty = &imp.self_ty; let (impl_generics, _, where_clause) = imp.generics.split_for_impl(); Ok(quote!( - impl #impl_generics PestConsumer for #ty #where_clause { + impl #impl_generics pest_consume::PestConsumer for #ty #where_clause { type Rule = #rule_enum; fn rule_alias(rule: Self::Rule) -> String { match rule { -- cgit v1.2.3