diff options
author | Nadrieril | 2019-09-11 22:42:15 +0200 |
---|---|---|
committer | Nadrieril | 2019-09-11 22:42:15 +0200 |
commit | 80bd718677080227f7b2e26744456cb13debca27 (patch) | |
tree | 5ec397012fbfe65192c07c16c7fd20a6bd73e2db /pest_consume_macros/src/make_parser.rs | |
parent | f4f83af7831c309923feaf453069a6a75e181084 (diff) |
Various tweaks
Diffstat (limited to 'pest_consume_macros/src/make_parser.rs')
-rw-r--r-- | pest_consume_macros/src/make_parser.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/pest_consume_macros/src/make_parser.rs b/pest_consume_macros/src/make_parser.rs index 2ed3271..c30b12f 100644 --- a/pest_consume_macros/src/make_parser.rs +++ b/pest_consume_macros/src/make_parser.rs @@ -261,7 +261,7 @@ fn apply_special_attrs(f: &mut ParsedFn, rule_enum: &Path) -> Result<()> { // 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 #self_ty::allows_shortcut(#input_arg.as_rule()) { - if let Some(child) = #input_arg.single_child() { + if let ::std::option::Option::Some(child) = #input_arg.single_child() { if child.as_aliased_rule::<Self>() == #self_ty::AliasedRule::#fn_name { #input_arg = child; continue; @@ -273,9 +273,9 @@ fn apply_special_attrs(f: &mut ParsedFn, rule_enum: &Path) -> Result<()> { match #input_arg.as_rule() { #(#rule_enum::#aliases => Self::#aliases(#input_arg),)* #rule_enum::#fn_name => #block, - r => unreachable!( + r => ::std::unreachable!( "make_parser: called {} on {:?}", - stringify!(#fn_name), + ::std::stringify!(#fn_name), r ) } @@ -349,14 +349,14 @@ pub fn make_parser( #(#rule_enum::#srcs => Self::#srcs(#input_arg),)* // We can't match on #rule_enum::#tgt since `tgt` might be an arbitrary // identifier. - r if &format!("{:?}", r) == stringify!(#tgt) => - return Err(#input_arg.error(format!( + r if &::std::format!("{:?}", r) == ::std::stringify!(#tgt) => + return ::std::result::Result::Err(#input_arg.error(::std::format!( "make_parser: missing method for rule {}", - stringify!(#tgt), + ::std::stringify!(#tgt), ))), - r => unreachable!( + r => ::std::unreachable!( "make_parser: called {} on {:?}", - stringify!(#tgt), + ::std::stringify!(#tgt), r ) } @@ -383,7 +383,7 @@ pub fn make_parser( match rule { #(#rule_alias_branches)* // TODO: return a proper error ? - r => unreachable!("Rule {:?} does not have a corresponding parsing method", r), + r => ::std::unreachable!("Rule {:?} does not have a corresponding parsing method", r), } } fn allows_shortcut(rule: Self::Rule) -> bool { |