Repository: kevinmehall/rust-peg (language: rust)

Issue:
Warn if you name the return value of a rule returning ()
If you forget a return type

```
name = [a-z]+
fncall -> Call = name:name "()" { Call(name.into_string()) }
```

we can provide an error message at the rust-peg level that will be more helpful than rustc's "error: type `()` does not implement any method in scope named `into_string`" and give a hint in the right direction. It is useless to bind a name to (), so the user meant to specify a return type.

Thanks to @untitaker for running into this pitfall and reporting it.



Discussion / hints:

Fix patch:
diff --git a/Cargo.toml b/Cargo.toml
index 727b707..bca4251 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,6 +15,8 @@ readme = "README.md"
 
 [dependencies]
 quote = "0.3"
+codemap = "0.1"
+codemap-diagnostic = "0.1"
 
 [[bin]]
 name = "rust-peg"
diff --git a/peg-syntax-ext/lib.rs b/peg-syntax-ext/lib.rs
index 8340d17..16d59f8 100644
--- a/peg-syntax-ext/lib.rs
+++ b/peg-syntax-ext/lib.rs
@@ -18,6 +18,7 @@ use rustc_plugin::Registry;
 use std::io::Read;
 use std::fs::File;
 use std::path::Path;
+use std::iter;
 
 #[plugin_registrar]
 pub fn plugin_registrar(reg: &mut Registry) {
@@ -31,17 +32,23 @@ pub fn plugin_registrar(reg: &mut Registry) {
 }
 
 fn expand_peg_str<'s>(cx: &'s mut ExtCtxt, sp: codemap::Span, ident: ast::Ident, tts: Vec<TokenTree>) -> Box<MacResult + 's> {
-    let source = match parse_arg(cx, &tts) {
-        Some(source) => source,
+    let (source, span) = match parse_arg(cx, &tts) {
+        Some((source, span)) => (source, span),
         None => return DummyResult::any(sp),
     };
 
-    expand_peg(cx, sp, ident, &source)
+    let loc = cx.codemap().lookup_char_pos(span.lo());
+    let fname = loc.file.name.to_owned();
+
+    // Make PEG line numbers match source line numbers
+    let source = iter::repeat('\n').take(loc.line - 1).collect::<String>() + &source;
+
+    expand_peg(cx, sp, ident, fname, source)
 }
 
 fn expand_peg_file<'s>(cx: &'s mut ExtCtxt, sp: codemap::Span, ident: ast::Ident, tts: Vec<TokenTree>) -> Box<MacResult + 's> {
     let fname = match parse_arg(cx, &tts) {
-        Some(fname) => fname,
+        Some((fname, _)) => fname,
         None => return DummyResult::any(sp),
     };
 
@@ -55,14 +62,14 @@ fn expand_peg_file<'s>(cx: &'s mut ExtCtxt, sp: codemap::Span, ident: ast::Ident
 
     cx.codemap().new_filemap(format!("{}", path.display()), "".to_string());
 
-    expand_peg(cx, sp, ident, &source)
+    expand_peg(cx, sp, ident, fname.to_owned(), source)
 }
 
-fn expand_peg(cx: &mut ExtCtxt, sp: codemap::Span, ident: ast::Ident, source: &str) -> Box<MacResult + 'static> {
-    let code = match peg::compile(&source) {
+fn expand_peg(cx: &mut ExtCtxt, sp: codemap::Span, ident: ast::Ident, filename: String, source: String) -> Box<MacResult + 'static> {
+    let code = match peg::compile(filename, source) {
         Ok(code) => code,
-        Err(e) => {
-          cx.span_err(sp, &format!("{}", e));
+        Err(()) => {
+          cx.span_err(sp, "Errors above in rust-peg grammar");
           return DummyResult::any(sp)
         }
     };
@@ -79,7 +86,7 @@ fn expand_peg(cx: &mut ExtCtxt, sp: codemap::Span, ident: ast::Ident, source: &s
     MacEager::items(SmallVector::one(module))
 }
 
-fn parse_arg(cx: &mut ExtCtxt, tts: &[TokenTree]) -> Option<String> {
+fn parse_arg(cx: &mut ExtCtxt, tts: &[TokenTree]) -> Option<(String, codemap::Span)> {
     use syntax::print::pprust;
 
     let mut parser = parse::new_parser_from_tts(cx.parse_sess(), tts.to_vec());
@@ -95,7 +102,7 @@ fn parse_arg(cx: &mut ExtCtxt, tts: &[TokenTree]) -> Option<String> {
                                     "expected only one string literal");
                         return None
                     }
-                    return Some(n.to_string())
+                    return Some((n.to_string(), spanned.span))
                 }
                 _ => {}
             }
diff --git a/src/bin.rs b/src/bin.rs
index 6295f4f..2377d64 100755
--- a/src/bin.rs
+++ b/src/bin.rs
@@ -12,27 +12,27 @@ fn main() {
 	let progname = &args[0];
 	let mut log = stderr();
 
+	let fname: &str;
 	let mut source = String::new();
 
 	if args.len() == 2 && &args[1] != "-h" {
-		let fname = Path::new(&args[1]);
-		File::open(fname).unwrap().read_to_string(&mut source).unwrap();
+		fname = args[1].to_str().unwrap();
+		File::open(Path::new(&args[1])).unwrap().read_to_string(&mut source).unwrap();
 	} else if args.len() == 1 {
+		fname = "<stdin>";
 		stdin().read_to_string(&mut source).unwrap();
 	} else {
 		writeln!(log, "Usage: {} [file]", progname.to_string_lossy()).unwrap();
 		process::exit(0);
 	}
 
-	match peg::compile(&source) {
+	match peg::compile(fname.to_owned(), source) {
 		Ok(parser) => {
 			let mut out = stdout();
 			writeln!(&mut out, "// Generated by rust-peg. Do not edit.").unwrap();
 			write!(&mut out, "{}", parser).unwrap();
 		}
-		Err(err) => {
-			writeln!(log, "Error compiling rust-peg grammar:").unwrap();
-			writeln!(log, "{}", err).unwrap();
+		Err(()) => {
 			process::exit(1);
 		}
 	}
diff --git a/src/grammar.rs b/src/grammar.rs
index d3a89a4..c8254cc 100644
--- a/src/grammar.rs
+++ b/src/grammar.rs
@@ -1,5 +1,5 @@
 // Generated by rust-peg. Do not edit.
-use self :: RuleResult :: { Matched , Failed } ; use translate::*; use std::char; fn escape_default ( s : & str ) -> String {
+use self :: RuleResult :: { Matched , Failed } ; use translate::*; use std::char; use codemap::{ self, Spanned }; fn escape_default ( s : & str ) -> String {
 s . chars (  ) . flat_map ( | c | c . escape_default (  ) ) . collect (  ) }
 fn char_range_at ( s : & str , pos : usize ) -> ( char , usize ) {
 let c = & s [ pos .. ] . chars (  ) . next (  ) . unwrap (  ) ; let next_pos =
@@ -57,11 +57,11 @@ RuleResult < (  ) > {
 if self . suppress_fail == 0 {
 if pos > self . max_err_pos {
 self . max_err_pos = pos ; self . expected . clear (  ) ; } if pos == self .
-max_err_pos { self . expected . insert ( expected ) ; } } Failed } } struct ParseState < 'input > { max_err_pos : usize , suppress_fail : usize , expected : :: std :: collections :: HashSet < & 'static str > , _phantom : :: std :: marker :: PhantomData < & 'input ( ) > , primary_cache : :: std :: collections :: HashMap < usize , RuleResult < Expr >> } impl < 'input > ParseState < 'input > { fn new ( ) -> ParseState < 'input > { ParseState { max_err_pos : 0 , suppress_fail : 0 , expected : :: std :: collections :: HashSet :: new ( ) , _phantom : :: std :: marker :: PhantomData , primary_cache : :: std :: collections :: HashMap :: new ( ) } } } 
+max_err_pos { self . expected . insert ( expected ) ; } } Failed } } struct ParseState < 'input > { max_err_pos : usize , suppress_fail : usize , expected : :: std :: collections :: HashSet < & 'static str > , _phantom : :: std :: marker :: PhantomData < & 'input ( ) > , primary_cache : :: std :: collections :: HashMap < usize , RuleResult < Spanned<Expr> >> } impl < 'input > ParseState < 'input > { fn new ( ) -> ParseState < 'input > { ParseState { max_err_pos : 0 , suppress_fail : 0 , expected : :: std :: collections :: HashSet :: new ( ) , _phantom : :: std :: marker :: PhantomData , primary_cache : :: std :: collections :: HashMap :: new ( ) } } } 
 
- fn __parse_items < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < Vec<Item> > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = __parse_item ( __input , __state , __pos ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , items ) => { Matched ( __pos , {  items  } ) } Failed => Failed , } } } Failed => Failed , } } } 
+ fn __parse_items < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < Vec<Spanned<Item>> > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = __parse__ ( __input , __state , __pos , file_span ) ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = { let __seq_res = Matched ( __pos , __pos ) ; match __seq_res { Matched ( __pos , start ) => { { let __seq_res = __parse_item ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , node ) => { { let __seq_res = Matched ( __pos , __pos ) ; match __seq_res { Matched ( __pos , end ) => { Matched ( __pos , {  codemap::Spanned { node, span: file_span.subspan(start as u64, end as u64) }  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , items ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  items  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_rule < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < Rule > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = __parse_exportflag ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , legacy_exported ) => { { let __seq_res = __parse_cacheflag ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , cached ) => { { let __seq_res = __parse_pubflag ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , public ) => { { let __seq_res = __parse_identifier ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , name ) => { { let __seq_res = __parse_returntype ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , returns ) => { { let __seq_res = __parse_equals ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_expression ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , expression ) => { { let __seq_res = match __parse_semicolon ( __input , __state , __pos ) { Matched ( __newpos , _ ) => { Matched ( __newpos , ( ) ) } , Failed => { Matched ( __pos , ( ) ) } , } ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
+ fn __parse_rule < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < Rule > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = __parse_exportflag ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , legacy_exported ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_cacheflag ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , cached ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_pubflag ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , public ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_identifier ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , name ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_returntype ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , returns ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "=" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_expression ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , expression ) => { { let __seq_res = match { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , ";" ) } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , ( ) ) } , Failed => { Matched ( __pos , ( ) ) } , } ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
       Rule{
         name: name,
         expr: Box::new(expression),
@@ -69,196 +69,154 @@ max_err_pos { self . expected . insert ( expected ) ; } } Failed } } struct Pars
         exported: public || legacy_exported,
         cached: cached
       }
-     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
+     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_pubflag < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < bool > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = __parse_PUB ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  true  } ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __seq_res = slice_eq ( __input , __state , __pos , "" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  false  } ) } Failed => Failed , } } } } } 
+ fn __parse_pubflag < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < bool > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = __parse_PUB ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  true  } ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => Matched ( __pos , {  false  } ) } } } 
 
- fn __parse_exportflag < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < bool > { # ! [ allow ( non_snake_case , unused ) ] { __state . suppress_fail += 1 ; let res = { let __choice_res = { let __seq_res = { let __choice_res = slice_eq ( __input , __state , __pos , "#[export]" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => slice_eq ( __input , __state , __pos , "#[pub]" ) } } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { true } ) } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __seq_res = slice_eq ( __input , __state , __pos , "" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { false } ) } Failed => Failed , } } } } ; __state . suppress_fail -= 1 ; res } } 
+ fn __parse_exportflag < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < bool > { # ! [ allow ( non_snake_case , unused ) ] { __state . suppress_fail += 1 ; let res = { let __choice_res = { let __seq_res = { let __choice_res = slice_eq ( __input , __state , __pos , "#[export]" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => slice_eq ( __input , __state , __pos , "#[pub]" ) } } ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { true } ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => Matched ( __pos , { false } ) } } ; __state . suppress_fail -= 1 ; res } } 
 
- fn __parse_cacheflag < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < bool > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "#[cache]" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { true } ) } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => Matched ( __pos , { false } ) } } } 
+ fn __parse_cacheflag < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < bool > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "#[cache]" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { true } ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => Matched ( __pos , { false } ) } } } 
 
- fn __parse_template < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < Template > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = __parse_identifier ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , name ) => { { let __seq_res = __parse_lt ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = __parse_comma ( __input , __state , __pos ) ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = __parse_identifier ( __input , __state , __pos ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , params ) => { { let __seq_res = __parse_gt ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_equals ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_expression ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , expression ) => { { let __seq_res = match __parse_semicolon ( __input , __state , __pos ) { Matched ( __newpos , _ ) => { Matched ( __newpos , ( ) ) } , Failed => { Matched ( __pos , ( ) ) } , } ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
+ fn __parse_template < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < Template > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = __parse_identifier ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , name ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "<" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "," ) ; match __seq_res { Matched ( __pos , _ ) => { __parse__ ( __input , __state , __pos , file_span ) } Failed => Failed , } } } Failed => Failed , } } ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = __parse_identifier ( __input , __state , __pos , file_span ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , list ) => { { let __seq_res = match { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , "," ) } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , ( ) ) } , Failed => { Matched ( __pos , ( ) ) } , } ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  list  } ) } Failed => Failed , } } } Failed => Failed , } } ; match __seq_res { Matched ( __pos , params ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , ">" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "=" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_expression ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , expression ) => { { let __seq_res = match { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , ";" ) } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , ( ) ) } , Failed => { Matched ( __pos , ( ) ) } , } ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
     Template { name: name, params: params, expr: Box::new(expression) }
-   } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
+   } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_item < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < Item > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = __parse_rust_use ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , u ) => { Matched ( __pos , {  Item::Use(u)  } ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_rule ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , r ) => { Matched ( __pos , {  Item::Rule(r)  } ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_template ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , t ) => { Matched ( __pos , {  Item::Template(t)  } ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_grammar_args ( __input , __state , __pos ) } } } } } } } 
+ fn __parse_item < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < Item > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = __parse_rust_use ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , u ) => { Matched ( __pos , {  Item::Use(u)  } ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_rule ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , r ) => { Matched ( __pos , {  Item::Rule(r)  } ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_template ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , t ) => { Matched ( __pos , {  Item::Template(t)  } ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_grammar_args ( __input , __state , __pos , file_span ) } } } } } } } 
 
- fn __parse_grammar_args < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < Item > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "#![" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "arguments" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_lparen ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = __parse_comma ( __input , __state , __pos ) ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = __parse_grammar_argument ( __input , __state , __pos ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , args ) => { { let __seq_res = __parse_rparen ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "]" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  Item::GrammarArgs(args)  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
+ fn __parse_grammar_args < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < Item > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "#![" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "arguments" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "(" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "," ) ; match __seq_res { Matched ( __pos , _ ) => { __parse__ ( __input , __state , __pos , file_span ) } Failed => Failed , } } } Failed => Failed , } } ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = __parse_grammar_argument ( __input , __state , __pos , file_span ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , list ) => { { let __seq_res = match { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , "," ) } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , ( ) ) } , Failed => { Matched ( __pos , ( ) ) } , } ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  list  } ) } Failed => Failed , } } } Failed => Failed , } } ; match __seq_res { Matched ( __pos , args ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , ")" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "]" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  Item::GrammarArgs(args)  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_grammar_argument < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < (String, String) > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = __parse_identifier ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , i ) => { { let __seq_res = __parse_colon ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_type_string ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , t ) => { Matched ( __pos , {  (i, t)  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
+ fn __parse_grammar_argument < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < (String, String) > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = __parse_identifier ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , i ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , ":" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_type_string ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , t ) => { Matched ( __pos , {  (i, t)  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_type_string < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { let str_start = __pos ; match __parse_rust_type ( __input , __state , __pos ) { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , tp ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  tp.to_owned()  } ) } Failed => Failed , } } } Failed => Failed , } } } 
+ fn __parse_type_string < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { let str_start = __pos ; match __parse_rust_type ( __input , __state , __pos , file_span ) { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , tp ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  tp.to_owned()  } ) } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_returntype < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = __parse_returns ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_type_string ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , tp ) => { Matched ( __pos , {  tp  } ) } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => Matched ( __pos , {  "()".to_string()  } ) } } } 
+ fn __parse_returntype < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "->" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_type_string ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , tp ) => { Matched ( __pos , {  tp  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => Matched ( __pos , {  "()".to_string()  } ) } } } 
 
- fn __parse_rust_identifier < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { __state . suppress_fail += 1 ; let res = { let __seq_res = if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { 'a' ... 'z' | 'A' ... 'Z' | '_' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[a-zA-Z_]" ) , } } else { __state . mark_failure ( __pos , "[a-zA-Z_]" ) } ; match __seq_res { Matched ( __pos , _ ) => { { let mut __repeat_pos = __pos ; loop { let __pos = __repeat_pos ; let __step_res = if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { 'a' ... 'z' | 'A' ... 'Z' | '0' ... '9' | '_' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[a-zA-Z0-9_]" ) , } } else { __state . mark_failure ( __pos , "[a-zA-Z0-9_]" ) } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } } Failed => Failed , } } ; __state . suppress_fail -= 1 ; res } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { __state . mark_failure ( __pos , "identifier" ) ; Failed } } } } 
+ fn __parse_rust_identifier < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { __state . suppress_fail += 1 ; let res = { let __seq_res = if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { 'a' ... 'z' | 'A' ... 'Z' | '_' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[a-zA-Z_]" ) , } } else { __state . mark_failure ( __pos , "[a-zA-Z_]" ) } ; match __seq_res { Matched ( __pos , _ ) => { { let mut __repeat_pos = __pos ; loop { let __pos = __repeat_pos ; let __step_res = if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { 'a' ... 'z' | 'A' ... 'Z' | '0' ... '9' | '_' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[a-zA-Z0-9_]" ) , } } else { __state . mark_failure ( __pos , "[a-zA-Z0-9_]" ) } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } } Failed => Failed , } } ; __state . suppress_fail -= 1 ; res } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { __state . mark_failure ( __pos , "identifier" ) ; Failed } } } } 
 
- fn __parse_rust_use < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { let str_start = __pos ; match { let __seq_res = __parse_USE ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_rust_path ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "::" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "*" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "::" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "{" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = { let __seq_res = slice_eq ( __input , __state , __pos , "," ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = { let __seq_res = __parse_rust_identifier ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { match { let __seq_res = slice_eq ( __input , __state , __pos , "as" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_rust_identifier ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , ( ) ) } , Failed => { Matched ( __pos , ( ) ) } , } } Failed => Failed , } } } Failed => Failed , } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } if __repeat_value . len ( ) >= 1 { Matched ( __repeat_pos , ( ) ) } else { Failed } } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "}" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => match { let __seq_res = slice_eq ( __input , __state , __pos , "as" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { __parse_rust_identifier ( __input , __state , __pos ) } Failed => Failed , } } } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , ( ) ) } , Failed => { Matched ( __pos , ( ) ) } , } } } } } ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , ";" ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , v ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  v.to_owned()  } ) } Failed => Failed , } } } Failed => Failed , } } } 
+ fn __parse_rust_use < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { let str_start = __pos ; match { let __seq_res = __parse_USE ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_rust_path ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "::" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "*" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse__ ( __input , __state , __pos , file_span ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "::" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "{" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = { let __seq_res = slice_eq ( __input , __state , __pos , "," ) ; match __seq_res { Matched ( __pos , _ ) => { __parse__ ( __input , __state , __pos , file_span ) } Failed => Failed , } } ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = { let __seq_res = __parse_rust_identifier ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { match { let __seq_res = slice_eq ( __input , __state , __pos , "as" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_rust_identifier ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { __parse__ ( __input , __state , __pos , file_span ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , ( ) ) } , Failed => { Matched ( __pos , ( ) ) } , } } Failed => Failed , } } } Failed => Failed , } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } if __repeat_value . len ( ) >= 1 { Matched ( __repeat_pos , ( ) ) } else { Failed } } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "}" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse__ ( __input , __state , __pos , file_span ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => match { let __seq_res = slice_eq ( __input , __state , __pos , "as" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { __parse_rust_identifier ( __input , __state , __pos , file_span ) } Failed => Failed , } } } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , ( ) ) } , Failed => { Matched ( __pos , ( ) ) } , } } } } } ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , ";" ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , v ) => { Matched ( __pos , {  v.to_owned()  } ) } Failed => Failed , } } } 
 
- fn __parse_rust_path < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "::" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } Failed => Failed , } } ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = __parse_rust_identifier ( __input , __state , __pos ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } if __repeat_value . len ( ) >= 1 { Matched ( __repeat_pos , ( ) ) } else { Failed } } } 
+ fn __parse_rust_path < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "::" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse__ ( __input , __state , __pos , file_span ) } Failed => Failed , } } } Failed => Failed , } } ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = __parse_rust_identifier ( __input , __state , __pos , file_span ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } if __repeat_value . len ( ) >= 1 { Matched ( __repeat_pos , ( ) ) } else { Failed } } } 
 
- fn __parse_rust_type < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "[" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_rust_type ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , "]" ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "&" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = match { let __seq_res = slice_eq ( __input , __state , __pos , "mut" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , ( ) ) } , Failed => { Matched ( __pos , ( ) ) } , } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = match { let __seq_res = slice_eq ( __input , __state , __pos , "'" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_rust_identifier ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , ( ) ) } , Failed => { Matched ( __pos , ( ) ) } , } ; match __seq_res { Matched ( __pos , _ ) => { __parse_rust_type ( __input , __state , __pos ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_rust_identifier ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "<" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "," ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } Failed => Failed , } } ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "'" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse_rust_identifier ( __input , __state , __pos ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_rust_type ( __input , __state , __pos ) } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , ">" ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_rust_identifier ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "::" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { __parse_rust_type ( __input , __state , __pos ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "(" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "," ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } Failed => Failed , } } ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = __parse_rust_type ( __input , __state , __pos ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , ")" ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_rust_identifier ( __input , __state , __pos ) } } } } } } } } } } } 
+ fn __parse_rust_type < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "[" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_rust_type ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , "]" ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "&" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = match { let __seq_res = slice_eq ( __input , __state , __pos , "mut" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse__ ( __input , __state , __pos , file_span ) } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , ( ) ) } , Failed => { Matched ( __pos , ( ) ) } , } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = match { let __seq_res = slice_eq ( __input , __state , __pos , "'" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_rust_identifier ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { __parse__ ( __input , __state , __pos , file_span ) } Failed => Failed , } } } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , ( ) ) } , Failed => { Matched ( __pos , ( ) ) } , } ; match __seq_res { Matched ( __pos , _ ) => { __parse_rust_type ( __input , __state , __pos , file_span ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_rust_identifier ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "<" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "," ) ; match __seq_res { Matched ( __pos , _ ) => { __parse__ ( __input , __state , __pos , file_span ) } Failed => Failed , } } } Failed => Failed , } } ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "'" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse_rust_identifier ( __input , __state , __pos , file_span ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_rust_type ( __input , __state , __pos , file_span ) } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , ">" ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_rust_identifier ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "::" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { __parse_rust_type ( __input , __state , __pos , file_span ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "(" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "," ) ; match __seq_res { Matched ( __pos , _ ) => { __parse__ ( __input , __state , __pos , file_span ) } Failed => Failed , } } } Failed => Failed , } } ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = __parse_rust_type ( __input , __state , __pos , file_span ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , ")" ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_rust_identifier ( __input , __state , __pos , file_span ) } } } } } } } } } } } 
 
- fn __parse_expression < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < Expr > { # ! [ allow ( non_snake_case , unused ) ] __parse_choice ( __input , __state , __pos ) } 
+ fn __parse_expression < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < Spanned<Expr> > { # ! [ allow ( non_snake_case , unused ) ] __parse_choice ( __input , __state , __pos , file_span ) } 
 
- fn __parse_choice < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < Expr > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = __parse_sequence ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , head ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = { let __seq_res = __parse_slash ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_sequence ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , s ) => { Matched ( __pos , { s } ) } Failed => Failed , } } } Failed => Failed , } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , tail ) => { Matched ( __pos , { 
+ fn __parse_choice < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < Spanned<Expr> > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = Matched ( __pos , __pos ) ; match __seq_res { Matched ( __pos , start ) => { { let __seq_res = { let __seq_res = __parse_sequence ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , head ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "/" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_sequence ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , s ) => { Matched ( __pos , { s } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , tail ) => { Matched ( __pos , { 
       if tail.len() > 0 {
         let mut list = tail;
         list.insert(0, head);
         ChoiceExpr(list)
       } else {
-        head
+        head.node
       }
-     } ) } Failed => Failed , } } } Failed => Failed , } } } 
+     } ) } Failed => Failed , } } } Failed => Failed , } } ; match __seq_res { Matched ( __pos , node ) => { { let __seq_res = Matched ( __pos , __pos ) ; match __seq_res { Matched ( __pos , end ) => { Matched ( __pos , {  codemap::Spanned { node, span: file_span.subspan(start as u64, end as u64) }  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_sequence < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < Expr > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = __parse_labeled ( __input , __state , __pos ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , elements ) => { { let __seq_res = __parse_action ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , code ) => { Matched ( __pos , { 
+ fn __parse_sequence < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < Spanned<Expr> > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = Matched ( __pos , __pos ) ; match __seq_res { Matched ( __pos , start ) => { { let __seq_res = { let __choice_res = { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = __parse__ ( __input , __state , __pos , file_span ) ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = __parse_labeled ( __input , __state , __pos , file_span ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , elements ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_action ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , code ) => { Matched ( __pos , { 
       ActionExpr(elements, code.0, code.1)
-     } ) } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = __parse_prefixed ( __input , __state , __pos ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , elements ) => { Matched ( __pos , { 
+     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = __parse__ ( __input , __state , __pos , file_span ) ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = __parse_prefixed ( __input , __state , __pos , file_span ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , elements ) => { Matched ( __pos , { 
       if elements.len() != 1 {
           SequenceExpr(elements)
       } else {
-          elements.into_iter().next().unwrap()
+          elements.into_iter().next().unwrap().node
       }
-     } ) } Failed => Failed , } } } } } 
+     } ) } Failed => Failed , } } } } ; match __seq_res { Matched ( __pos , node ) => { { let __seq_res = Matched ( __pos , __pos ) ; match __seq_res { Matched ( __pos , end ) => { Matched ( __pos , {  codemap::Spanned { node, span: file_span.subspan(start as u64, end as u64) }  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_labeled < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < TaggedExpr > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = __parse_identifier ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , label ) => { { let __seq_res = __parse_colon ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_prefixed ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , expression ) => { Matched ( __pos , { 
+ fn __parse_labeled < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < TaggedExpr > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = { let __seq_res = Matched ( __pos , __pos ) ; match __seq_res { Matched ( __pos , start ) => { { let __seq_res = __parse_identifier ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , node ) => { { let __seq_res = Matched ( __pos , __pos ) ; match __seq_res { Matched ( __pos , end ) => { Matched ( __pos , {  codemap::Spanned { node, span: file_span.subspan(start as u64, end as u64) }  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __seq_res { Matched ( __pos , label ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , ":" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_prefixed ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , expression ) => { Matched ( __pos , { 
       TaggedExpr{ name: Some(label), expr: Box::new(expression) }
-     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __seq_res = __parse_prefixed ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , expr ) => { Matched ( __pos , { 
+     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __seq_res = __parse_prefixed ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , expr ) => { Matched ( __pos , { 
       TaggedExpr{ name: None, expr: Box::new(expr) }
    } ) } Failed => Failed , } } } } } 
 
- fn __parse_prefixed < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < Expr > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = __parse_dollar ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_suffixed ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , expression ) => { Matched ( __pos , { 
+ fn __parse_prefixed < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < Spanned<Expr> > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = Matched ( __pos , __pos ) ; match __seq_res { Matched ( __pos , start ) => { { let __seq_res = { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "$" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_suffixed ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , expression ) => { Matched ( __pos , { 
       MatchStrExpr(Box::new(expression))
-     } ) } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_and ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_suffixed ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , expression ) => { Matched ( __pos , { 
+     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "&" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_suffixed ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , expression ) => { Matched ( __pos , { 
       PosAssertExpr(Box::new(expression))
-     } ) } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_not ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_suffixed ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , expression ) => { Matched ( __pos , { 
+     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __seq_res = slice_eq ( __input , __state , __pos , "!" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_suffixed ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , expression ) => { Matched ( __pos , { 
       NegAssertExpr(Box::new(expression))
-     } ) } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_suffixed ( __input , __state , __pos ) } } } } } } } 
+     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } } } } ; match __seq_res { Matched ( __pos , node ) => { { let __seq_res = Matched ( __pos , __pos ) ; match __seq_res { Matched ( __pos , end ) => { Matched ( __pos , {  codemap::Spanned { node, span: file_span.subspan(start as u64, end as u64) }  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_suffixed ( __input , __state , __pos , file_span ) } } } 
 
- fn __parse_suffixed < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < Expr > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = __parse_primary ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , e ) => { { let __seq_res = __parse_question ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
+ fn __parse_suffixed < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < Spanned<Expr> > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = Matched ( __pos , __pos ) ; match __seq_res { Matched ( __pos , start ) => { { let __seq_res = { let __choice_res = { let __seq_res = __parse_primary ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , e ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "?" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
        OptionalExpr(Box::new(e))
-     } ) } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_primary ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , e ) => { { let __seq_res = __parse_starstar ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_repeatcount ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , count ) => { { let __seq_res = __parse_primary ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , sep ) => { Matched ( __pos , { 
+     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_primary ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , e ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "**" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_repeatcount ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , count ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_primary ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , sep ) => { Matched ( __pos , { 
       Repeat(Box::new(e), count, Some(Box::new(sep)))
-     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_primary ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , e ) => { { let __seq_res = __parse_plusplus ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_primary ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , sep ) => { Matched ( __pos , { 
+     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_primary ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , e ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "++" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_primary ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , sep ) => { Matched ( __pos , { 
       Repeat(Box::new(e), BoundedRepeat::Plus, Some(Box::new(sep)))
-     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_primary ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , e ) => { { let __seq_res = __parse_star ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_repeatcount ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , count ) => { Matched ( __pos , { 
+     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_primary ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , e ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "*" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_repeatcount ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , count ) => { Matched ( __pos , { 
       Repeat(Box::new(e), count, None)
-     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_primary ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , e ) => { { let __seq_res = __parse_plus ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
+     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __seq_res = __parse_primary ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , e ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "+" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
       Repeat(Box::new(e), BoundedRepeat::Plus, None)
-     } ) } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_primary ( __input , __state , __pos ) } } } } } } } } } } } 
+     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } } } } } } } } ; match __seq_res { Matched ( __pos , node ) => { { let __seq_res = Matched ( __pos , __pos ) ; match __seq_res { Matched ( __pos , end ) => { Matched ( __pos , {  codemap::Spanned { node, span: file_span.subspan(start as u64, end as u64) }  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_primary ( __input , __state , __pos , file_span ) } } } 
 
- fn __parse_repeatcount < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < BoundedRepeat > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = __parse_lt ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_repeatnum ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , n ) => { { let __seq_res = __parse_gt ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  BoundedRepeat::Exact(n)  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_lt ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = match __parse_repeatnum ( __input , __state , __pos ) { Matched ( __newpos , __value ) => { Matched ( __newpos , Some ( __value ) ) } , Failed => { Matched ( __pos , None ) } , } ; match __seq_res { Matched ( __pos , min ) => { { let __seq_res = __parse_comma ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = match __parse_repeatnum ( __input , __state , __pos ) { Matched ( __newpos , __value ) => { Matched ( __newpos , Some ( __value ) ) } , Failed => { Matched ( __pos , None ) } , } ; match __seq_res { Matched ( __pos , max ) => { { let __seq_res = __parse_gt ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  BoundedRepeat::Both(min, max)  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __seq_res = slice_eq ( __input , __state , __pos , "" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  BoundedRepeat::None  } ) } Failed => Failed , } } } } } } } 
+ fn __parse_repeatcount < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < BoundedRepeat > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "<" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_repeatnum ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , n ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , ">" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  BoundedRepeat::Exact(n)  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "<" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = match __parse_repeatnum ( __input , __state , __pos , file_span ) { Matched ( __newpos , __value ) => { Matched ( __newpos , Some ( __value ) ) } , Failed => { Matched ( __pos , None ) } , } ; match __seq_res { Matched ( __pos , min ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "," ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = match __parse_repeatnum ( __input , __state , __pos , file_span ) { Matched ( __newpos , __value ) => { Matched ( __newpos , Some ( __value ) ) } , Failed => { Matched ( __pos , None ) } , } ; match __seq_res { Matched ( __pos , max ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , ">" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  BoundedRepeat::Both(min, max)  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => Matched ( __pos , {  BoundedRepeat::None  } ) } } } } } 
 
- fn __parse_repeatnum < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = __parse_integer ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , i ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  i.to_string()  } ) } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __seq_res = __parse_lbrace ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_rust_expr ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , e ) => { { let __seq_res = __parse_rbrace ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { e } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } } } 
+ fn __parse_repeatnum < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { let __seq_res = __parse_integer ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , i ) => { Matched ( __pos , {  i.to_string()  } ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __seq_res = slice_eq ( __input , __state , __pos , "{" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_rust_expr ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , e ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "}" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { e } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } } } 
 
- fn __parse_primary < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < Expr > { # ! [ allow ( non_snake_case , unused ) ] if let Some ( entry ) = __state . primary_cache . get ( & __pos ) { return entry . clone ( ) ; } let __rule_result = { let __choice_res = { let __seq_res = __parse_identifier ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , name ) => { { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = __parse_lt ( __input , __state , __pos ) ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = __parse_returns ( __input , __state , __pos ) ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = __parse_equals ( __input , __state , __pos ) ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
+ fn __parse_primary < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < Spanned<Expr> > { # ! [ allow ( non_snake_case , unused ) ] if let Some ( entry ) = __state . primary_cache . get ( & __pos ) { return entry . clone ( ) ; } let __rule_result = { let __seq_res = Matched ( __pos , __pos ) ; match __seq_res { Matched ( __pos , start ) => { { let __seq_res = { let __choice_res = { let __seq_res = __parse_identifier ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , name ) => { { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __choice_res = slice_eq ( __input , __state , __pos , "<" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = slice_eq ( __input , __state , __pos , "->" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => slice_eq ( __input , __state , __pos , "=" ) } } } } } Failed => Failed , } } ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
       RuleExpr(name)
-     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_identifier ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , name ) => { { let __seq_res = __parse_lt ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = __parse_comma ( __input , __state , __pos ) ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = __parse_expression ( __input , __state , __pos ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , args ) => { { let __seq_res = __parse_gt ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = __parse_equals ( __input , __state , __pos ) ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
+     } ) } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_identifier ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , name ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "<" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "," ) ; match __seq_res { Matched ( __pos , _ ) => { __parse__ ( __input , __state , __pos , file_span ) } Failed => Failed , } } } Failed => Failed , } } ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = __parse_expression ( __input , __state , __pos , file_span ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , list ) => { { let __seq_res = match { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , "," ) } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , ( ) ) } , Failed => { Matched ( __pos , ( ) ) } , } ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  list  } ) } Failed => Failed , } } } Failed => Failed , } } ; match __seq_res { Matched ( __pos , args ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , ">" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , "=" ) } Failed => Failed , } } ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
       TemplateInvoke(name, args)
-     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_literal ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_class ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = __parse_dot ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  AnyCharExpr  } ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "#position" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  PositionExpr  } ) } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "#quiet" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_lt ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_expression ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , e ) => { { let __seq_res = __parse_gt ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  QuietExpr(Box::new(e))  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "#expected" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_lparen ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_doubleQuotedString ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , s ) => { { let __seq_res = __parse_rparen ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  FailExpr(s)  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "#infix" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_lt ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_expression ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , atom ) => { { let __seq_res = __parse_gt ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_lbrace ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = __parse_infix_level ( __input , __state , __pos ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } if __repeat_value . len ( ) >= 1 { Matched ( __repeat_pos , __repeat_value ) } else { Failed } } ; match __seq_res { Matched ( __pos , levels ) => { { let __seq_res = __parse_rbrace ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  InfixExpr{ atom: Box::new(atom), levels:levels } } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __seq_res = __parse_lparen ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_expression ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , expression ) => { { let __seq_res = __parse_rparen ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  expression  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } } } } } } } } } } } } } } } } } } ; __state . primary_cache . insert ( __pos , __rule_result . clone ( ) ) ; __rule_result } 
+     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_literal ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_class ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "." ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  AnyCharExpr  } ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "#position" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  PositionExpr  } ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "#quiet" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "<" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_expression ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , e ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , ">" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  QuietExpr(Box::new(e))  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "#expected" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "(" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_doubleQuotedString ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , s ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , ")" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  FailExpr(s)  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "#infix" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "<" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_expression ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , atom ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , ">" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "{" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = __parse__ ( __input , __state , __pos , file_span ) ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = __parse_infix_level ( __input , __state , __pos , file_span ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } if __repeat_value . len ( ) >= 1 { Matched ( __repeat_pos , __repeat_value ) } else { Failed } } ; match __seq_res { Matched ( __pos , levels ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "}" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  InfixExpr{ atom: Box::new(atom), levels:levels } } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __seq_res = slice_eq ( __input , __state , __pos , "(" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_expression ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , expression ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , ")" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  expression.node  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } } } } } } } } } } } } } } } } } } ; match __seq_res { Matched ( __pos , node ) => { { let __seq_res = Matched ( __pos , __pos ) ; match __seq_res { Matched ( __pos , end ) => { Matched ( __pos , {  codemap::Spanned { node, span: file_span.subspan(start as u64, end as u64) }  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; __state . primary_cache . insert ( __pos , __rule_result . clone ( ) ) ; __rule_result } 
 
- fn __parse_infix_level < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < InfixLevel > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "#L" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  InfixAssoc::Left  } ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __seq_res = slice_eq ( __input , __state , __pos , "#R" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  InfixAssoc::Right } ) } Failed => Failed , } } } } ; match __seq_res { Matched ( __pos , assoc ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = __parse_infix_op ( __input , __state , __pos ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } if __repeat_value . len ( ) >= 1 { Matched ( __repeat_pos , __repeat_value ) } else { Failed } } ; match __seq_res { Matched ( __pos , operators ) => { Matched ( __pos , {  InfixLevel{ assoc: assoc, operators: operators}  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
+ fn __parse_infix_level < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < InfixLevel > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { let __choice_res = { let __seq_res = slice_eq ( __input , __state , __pos , "#L" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  InfixAssoc::Left  } ) } Failed => Failed , } } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __seq_res = slice_eq ( __input , __state , __pos , "#R" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  InfixAssoc::Right } ) } Failed => Failed , } } } } ; match __seq_res { Matched ( __pos , assoc ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __pos = if __repeat_value . len ( ) > 0 { let __sep_res = __parse__ ( __input , __state , __pos , file_span ) ; match __sep_res { Matched ( __newpos , _ ) => { __newpos } , Failed => break , } } else { __pos } ; let __step_res = __parse_infix_op ( __input , __state , __pos , file_span ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } if __repeat_value . len ( ) >= 1 { Matched ( __repeat_pos , __repeat_value ) } else { Failed } } ; match __seq_res { Matched ( __pos , operators ) => { Matched ( __pos , {  InfixLevel{ assoc: assoc, operators: operators}  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_infix_op < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < InfixOperator > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = __parse_identifier ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , l ) => { { let __seq_res = match { let __seq_res = __parse_identifier ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , var ) => { { let __seq_res = __parse_colon ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { var } ) } Failed => Failed , } } } Failed => Failed , } } { Matched ( __newpos , __value ) => { Matched ( __newpos , Some ( __value ) ) } , Failed => { Matched ( __pos , None ) } , } ; match __seq_res { Matched ( __pos , op ) => { { let __seq_res = __parse_primary ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , e ) => { { let __seq_res = __parse_identifier ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , r ) => { { let __seq_res = __parse_lbrace ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_rust_expr ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , action ) => { { let __seq_res = __parse_rbrace ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  InfixOperator{ operator:Box::new(e), action: action, l_arg:l, op_arg:op, r_arg:r }  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
+ fn __parse_infix_op < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < InfixOperator > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = __parse_identifier ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , l ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = match { let __seq_res = __parse_identifier ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , var ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , ":" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { var } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } { Matched ( __newpos , __value ) => { Matched ( __newpos , Some ( __value ) ) } , Failed => { Matched ( __pos , None ) } , } ; match __seq_res { Matched ( __pos , op ) => { { let __seq_res = __parse_primary ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , e ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_identifier ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , r ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "{" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_rust_expr ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , action ) => { { let __seq_res = __parse__ ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "}" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  InfixOperator{ operator:Box::new(e), action: action, l_arg:l, op_arg:op, r_arg:r }  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_rust_expr < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { let str_start = __pos ; match { let mut __repeat_pos = __pos ; loop { let __pos = __repeat_pos ; let __step_res = { let __choice_res = __parse_braced ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_nonBraceCharacters ( __input , __state , __pos ) } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , literal ) => { Matched ( __pos , {  format!("{{ {} }}", literal)  } ) } Failed => Failed , } } } 
+ fn __parse_rust_expr < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { let str_start = __pos ; match { let mut __repeat_pos = __pos ; loop { let __pos = __repeat_pos ; let __step_res = { let __choice_res = __parse_braced ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_nonBraceCharacters ( __input , __state , __pos , file_span ) } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , literal ) => { Matched ( __pos , {  format!("{{ {} }}", literal)  } ) } Failed => Failed , } } } 
 
- fn __parse_action < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < (String, /*is conditional match?*/ bool) > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "{" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = match slice_eq ( __input , __state , __pos , "?" ) { Matched ( __newpos , __value ) => { Matched ( __newpos , Some ( __value ) ) } , Failed => { Matched ( __pos , None ) } , } ; match __seq_res { Matched ( __pos , cond ) => { { let __seq_res = __parse_rust_expr ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , literal ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "}" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
+ fn __parse_action < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < (String, /*is conditional match?*/ bool) > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "{" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = match slice_eq ( __input , __state , __pos , "?" ) { Matched ( __newpos , __value ) => { Matched ( __newpos , Some ( __value ) ) } , Failed => { Matched ( __pos , None ) } , } ; match __seq_res { Matched ( __pos , cond ) => { { let __seq_res = __parse_rust_expr ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , literal ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "}" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
      (literal, cond.is_some())
-   } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
-
- fn __parse_braced < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "{" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; loop { let __pos = __repeat_pos ; let __step_res = { let __choice_res = __parse_braced ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_nonBraceCharacters ( __input , __state , __pos ) } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , "}" ) } Failed => Failed , } } } Failed => Failed , } } } 
-
- fn __parse_nonBraceCharacters < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { '{' | '}' => __state . mark_failure ( __pos , "[^{}]" ) , _ => Matched ( __next , ( ) ) , } } else { __state . mark_failure ( __pos , "[^{}]" ) } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } if __repeat_value . len ( ) >= 1 { Matched ( __repeat_pos , ( ) ) } else { Failed } } } 
-
- fn __parse_equals < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "=" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
-
- fn __parse_colon < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , ":" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
-
- fn __parse_semicolon < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , ";" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
-
- fn __parse_slash < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "/" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
-
- fn __parse_and < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "&" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
-
- fn __parse_not < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "!" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
-
- fn __parse_dollar < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "$" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
-
- fn __parse_question < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "?" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
-
- fn __parse_star < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "*" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
+   } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_starstar < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "**" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
+ fn __parse_braced < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "{" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; loop { let __pos = __repeat_pos ; let __step_res = { let __choice_res = __parse_braced ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_nonBraceCharacters ( __input , __state , __pos , file_span ) } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , "}" ) } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_plus < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "+" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
+ fn __parse_nonBraceCharacters < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { '{' | '}' => __state . mark_failure ( __pos , "[^{}]" ) , _ => Matched ( __next , ( ) ) , } } else { __state . mark_failure ( __pos , "[^{}]" ) } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } if __repeat_value . len ( ) >= 1 { Matched ( __repeat_pos , ( ) ) } else { Failed } } } 
 
- fn __parse_plusplus < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "++" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
+ fn __parse_USE < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "use" ) ; match __seq_res { Matched ( __pos , _ ) => { { __state . suppress_fail += 1 ; let __assert_res = if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { 'a' ... 'z' | 'A' ... 'Z' | '0' ... '9' | '_' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[a-zA-Z0-9_]" ) , } } else { __state . mark_failure ( __pos , "[a-zA-Z0-9_]" ) } ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_lparen < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "(" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
+ fn __parse_PUB < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "pub" ) ; match __seq_res { Matched ( __pos , _ ) => { { __state . suppress_fail += 1 ; let __assert_res = if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { 'a' ... 'z' | 'A' ... 'Z' | '0' ... '9' | '_' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[a-zA-Z0-9_]" ) , } } else { __state . mark_failure ( __pos , "[a-zA-Z0-9_]" ) } ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_rparen < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , ")" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
+ fn __parse_keyword < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = __parse_USE ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_PUB ( __input , __state , __pos , file_span ) } } } 
 
- fn __parse_dot < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "." ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
+ fn __parse_integer < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < usize > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { let str_start = __pos ; match { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { '0' ... '9' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[0-9]" ) , } } else { __state . mark_failure ( __pos , "[0-9]" ) } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } if __repeat_value . len ( ) >= 1 { Matched ( __repeat_pos , ( ) ) } else { Failed } } { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , i ) => { Matched ( __pos , {  i.parse().unwrap()  } ) } Failed => Failed , } } } 
 
- fn __parse_returns < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "->" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
+ fn __parse_identifier < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { __state . suppress_fail += 1 ; let res = { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = __parse_keyword ( __input , __state , __pos , file_span ) ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let str_start = __pos ; match { let __seq_res = if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { 'a' ... 'z' | 'A' ... 'Z' | '_' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[a-zA-Z_]" ) , } } else { __state . mark_failure ( __pos , "[a-zA-Z_]" ) } ; match __seq_res { Matched ( __pos , _ ) => { { let mut __repeat_pos = __pos ; loop { let __pos = __repeat_pos ; let __step_res = if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { 'a' ... 'z' | 'A' ... 'Z' | '0' ... '9' | '_' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[a-zA-Z0-9_]" ) , } } else { __state . mark_failure ( __pos , "[a-zA-Z0-9_]" ) } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , chars ) => { Matched ( __pos , {  chars.to_owned()  } ) } Failed => Failed , } } } Failed => Failed , } } ; __state . suppress_fail -= 1 ; res } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { __state . mark_failure ( __pos , "identifier" ) ; Failed } } } } 
 
- fn __parse_lbrace < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "{" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
-
- fn __parse_rbrace < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "}" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
-
- fn __parse_comma < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "," ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
-
- fn __parse_lt < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "<" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
-
- fn __parse_gt < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , ">" ) ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } 
-
- fn __parse_USE < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "use" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { 'a' ... 'z' | 'A' ... 'Z' | '0' ... '9' | '_' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[a-zA-Z0-9_]" ) , } } else { __state . mark_failure ( __pos , "[a-zA-Z0-9_]" ) } ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } Failed => Failed , } } } 
-
- fn __parse_PUB < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "pub" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { 'a' ... 'z' | 'A' ... 'Z' | '0' ... '9' | '_' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[a-zA-Z0-9_]" ) , } } else { __state . mark_failure ( __pos , "[a-zA-Z0-9_]" ) } ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { __parse___ ( __input , __state , __pos ) } Failed => Failed , } } } Failed => Failed , } } } 
-
- fn __parse_keyword < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = __parse_USE ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_PUB ( __input , __state , __pos ) } } } 
-
- fn __parse_integer < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < usize > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { let str_start = __pos ; match { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { '0' ... '9' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[0-9]" ) , } } else { __state . mark_failure ( __pos , "[0-9]" ) } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } if __repeat_value . len ( ) >= 1 { Matched ( __repeat_pos , ( ) ) } else { Failed } } { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , i ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  i.parse().unwrap()  } ) } Failed => Failed , } } } Failed => Failed , } } } 
-
- fn __parse_identifier < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = { __state . suppress_fail += 1 ; let res = { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = __parse_keyword ( __input , __state , __pos ) ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let str_start = __pos ; match { let __seq_res = if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { 'a' ... 'z' | 'A' ... 'Z' | '_' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[a-zA-Z_]" ) , } } else { __state . mark_failure ( __pos , "[a-zA-Z_]" ) } ; match __seq_res { Matched ( __pos , _ ) => { { let mut __repeat_pos = __pos ; loop { let __pos = __repeat_pos ; let __step_res = if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { 'a' ... 'z' | 'A' ... 'Z' | '0' ... '9' | '_' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[a-zA-Z0-9_]" ) , } } else { __state . mark_failure ( __pos , "[a-zA-Z0-9_]" ) } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , chars ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  chars.to_owned()  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } ; __state . suppress_fail -= 1 ; res } ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { __state . mark_failure ( __pos , "identifier" ) ; Failed } } } } 
-
- fn __parse_literal < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < Expr > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { let __choice_res = __parse_doubleQuotedString ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_singleQuotedString ( __input , __state , __pos ) } } ; match __seq_res { Matched ( __pos , value ) => { { let __seq_res = match slice_eq ( __input , __state , __pos , "i" ) { Matched ( __newpos , __value ) => { Matched ( __newpos , Some ( __value ) ) } , Failed => { Matched ( __pos , None ) } , } ; match __seq_res { Matched ( __pos , case_insensitive ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
+ fn __parse_literal < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < Expr > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { let __choice_res = __parse_doubleQuotedString ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_singleQuotedString ( __input , __state , __pos , file_span ) } } ; match __seq_res { Matched ( __pos , value ) => { { let __seq_res = match slice_eq ( __input , __state , __pos , "i" ) { Matched ( __newpos , __value ) => { Matched ( __newpos , Some ( __value ) ) } , Failed => { Matched ( __pos , None ) } , } ; match __seq_res { Matched ( __pos , case_insensitive ) => { Matched ( __pos , { 
       LiteralExpr(value,case_insensitive.is_some())
-     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
+     } ) } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_string < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { let __choice_res = __parse_doubleQuotedString ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_singleQuotedString ( __input , __state , __pos ) } } ; match __seq_res { Matched ( __pos , string ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  string  } ) } Failed => Failed , } } } Failed => Failed , } } } 
+ fn __parse_string < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { let __choice_res = __parse_doubleQuotedString ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_singleQuotedString ( __input , __state , __pos , file_span ) } } ; match __seq_res { Matched ( __pos , string ) => { Matched ( __pos , {  string  } ) } Failed => Failed , } } } 
 
- fn __parse_doubleQuotedString < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "\"" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = __parse_doubleQuotedCharacter ( __input , __state , __pos ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , s ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "\"" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  s.into_iter().collect()  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
+ fn __parse_doubleQuotedString < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "\"" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = __parse_doubleQuotedCharacter ( __input , __state , __pos , file_span ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , s ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "\"" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  s.into_iter().collect()  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_doubleQuotedCharacter < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = __parse_simpleDoubleQuotedCharacter ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_simpleEscapeSequence ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_zeroEscapeSequence ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_hex2EscapeSequence ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_unicodeEscapeSequence ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_eolEscapeSequence ( __input , __state , __pos ) } } } } } } } } } } } 
+ fn __parse_doubleQuotedCharacter < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = __parse_simpleDoubleQuotedCharacter ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_simpleEscapeSequence ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_zeroEscapeSequence ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_hex2EscapeSequence ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_unicodeEscapeSequence ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_eolEscapeSequence ( __input , __state , __pos , file_span ) } } } } } } } } } } } 
 
- fn __parse_simpleDoubleQuotedCharacter < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = { let __choice_res = slice_eq ( __input , __state , __pos , "\"" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = slice_eq ( __input , __state , __pos , "\\" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_eolChar ( __input , __state , __pos ) } } } } ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let str_start = __pos ; match any_char ( __input , __state , __pos ) { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , c ) => { Matched ( __pos , {  c.chars().next().unwrap()  } ) } Failed => Failed , } } } Failed => Failed , } } } 
+ fn __parse_simpleDoubleQuotedCharacter < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = { let __choice_res = slice_eq ( __input , __state , __pos , "\"" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = slice_eq ( __input , __state , __pos , "\\" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_eolChar ( __input , __state , __pos , file_span ) } } } } ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let str_start = __pos ; match any_char ( __input , __state , __pos ) { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , c ) => { Matched ( __pos , {  c.chars().next().unwrap()  } ) } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_singleQuotedString < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "'" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = __parse_singleQuotedCharacter ( __input , __state , __pos ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , s ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "'" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  s.into_iter().collect()  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
+ fn __parse_singleQuotedString < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < String > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "'" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = __parse_singleQuotedCharacter ( __input , __state , __pos , file_span ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , s ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "'" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  s.into_iter().collect()  } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_singleQuotedCharacter < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = __parse_simpleSingleQuotedCharacter ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_simpleEscapeSequence ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_zeroEscapeSequence ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_hex2EscapeSequence ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_unicodeEscapeSequence ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_eolEscapeSequence ( __input , __state , __pos ) } } } } } } } } } } } 
+ fn __parse_singleQuotedCharacter < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = __parse_simpleSingleQuotedCharacter ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_simpleEscapeSequence ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_zeroEscapeSequence ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_hex2EscapeSequence ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_unicodeEscapeSequence ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_eolEscapeSequence ( __input , __state , __pos , file_span ) } } } } } } } } } } } 
 
- fn __parse_simpleSingleQuotedCharacter < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = { let __choice_res = slice_eq ( __input , __state , __pos , "'" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = slice_eq ( __input , __state , __pos , "\\" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_eolChar ( __input , __state , __pos ) } } } } ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let str_start = __pos ; match any_char ( __input , __state , __pos ) { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , c ) => { Matched ( __pos , {  c.chars().next().unwrap()  } ) } Failed => Failed , } } } Failed => Failed , } } } 
+ fn __parse_simpleSingleQuotedCharacter < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = { let __choice_res = slice_eq ( __input , __state , __pos , "'" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = slice_eq ( __input , __state , __pos , "\\" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_eolChar ( __input , __state , __pos , file_span ) } } } } ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let str_start = __pos ; match any_char ( __input , __state , __pos ) { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , c ) => { Matched ( __pos , {  c.chars().next().unwrap()  } ) } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_class < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < Expr > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "[" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = match slice_eq ( __input , __state , __pos , "^" ) { Matched ( __newpos , __value ) => { Matched ( __newpos , Some ( __value ) ) } , Failed => { Matched ( __pos , None ) } , } ; match __seq_res { Matched ( __pos , inverted ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = { let __choice_res = __parse_classCharacterRange ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_classCharacter ( __input , __state , __pos ) } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , parts ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "]" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = match slice_eq ( __input , __state , __pos , "i" ) { Matched ( __newpos , __value ) => { Matched ( __newpos , Some ( __value ) ) } , Failed => { Matched ( __pos , None ) } , } ; match __seq_res { Matched ( __pos , flags ) => { { let __seq_res = __parse___ ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
+ fn __parse_class < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < Expr > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "[" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = match slice_eq ( __input , __state , __pos , "^" ) { Matched ( __newpos , __value ) => { Matched ( __newpos , Some ( __value ) ) } , Failed => { Matched ( __pos , None ) } , } ; match __seq_res { Matched ( __pos , inverted ) => { { let __seq_res = { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = { let __choice_res = __parse_classCharacterRange ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_classCharacter ( __input , __state , __pos , file_span ) } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } Matched ( __repeat_pos , __repeat_value ) } ; match __seq_res { Matched ( __pos , parts ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "]" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = match slice_eq ( __input , __state , __pos , "i" ) { Matched ( __newpos , __value ) => { Matched ( __newpos , Some ( __value ) ) } , Failed => { Matched ( __pos , None ) } , } ; match __seq_res { Matched ( __pos , flags ) => { Matched ( __pos , { 
       CharSetExpr(inverted.is_some(), parts)
-     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
+     } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_classCharacterRange < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < CharSetCase > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = __parse_bracketDelimitedCharacter ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , begin ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "-" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_bracketDelimitedCharacter ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , end ) => { Matched ( __pos , { 
+ fn __parse_classCharacterRange < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < CharSetCase > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = __parse_bracketDelimitedCharacter ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , begin ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "-" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_bracketDelimitedCharacter ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , end ) => { Matched ( __pos , { 
       //TODO: check start > end
       CharSetCase{start:begin, end:end}
      } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_classCharacter < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < CharSetCase > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = __parse_bracketDelimitedCharacter ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , char_ ) => { Matched ( __pos , { 
+ fn __parse_classCharacter < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < CharSetCase > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = __parse_bracketDelimitedCharacter ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , char_ ) => { Matched ( __pos , { 
       CharSetCase{start:char_, end:char_}
      } ) } Failed => Failed , } } } 
 
- fn __parse_bracketDelimitedCharacter < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = __parse_simpleBracketDelimitedCharacter ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_simpleEscapeSequence ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_zeroEscapeSequence ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_hex2EscapeSequence ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_unicodeEscapeSequence ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_eolEscapeSequence ( __input , __state , __pos ) } } } } } } } } } } } 
+ fn __parse_bracketDelimitedCharacter < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = __parse_simpleBracketDelimitedCharacter ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_simpleEscapeSequence ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_zeroEscapeSequence ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_hex2EscapeSequence ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_unicodeEscapeSequence ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_eolEscapeSequence ( __input , __state , __pos , file_span ) } } } } } } } } } } } 
 
- fn __parse_simpleBracketDelimitedCharacter < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = { let __choice_res = slice_eq ( __input , __state , __pos , "]" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = slice_eq ( __input , __state , __pos , "\\" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_eolChar ( __input , __state , __pos ) } } } } ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let str_start = __pos ; match any_char ( __input , __state , __pos ) { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , c ) => { Matched ( __pos , {  c.chars().next().unwrap()  } ) } Failed => Failed , } } } Failed => Failed , } } } 
+ fn __parse_simpleBracketDelimitedCharacter < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = { let __choice_res = slice_eq ( __input , __state , __pos , "]" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = slice_eq ( __input , __state , __pos , "\\" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_eolChar ( __input , __state , __pos , file_span ) } } } } ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let str_start = __pos ; match any_char ( __input , __state , __pos ) { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , c ) => { Matched ( __pos , {  c.chars().next().unwrap()  } ) } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_simpleEscapeSequence < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "\\" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = { let __choice_res = __parse_digit ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = slice_eq ( __input , __state , __pos , "x" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = slice_eq ( __input , __state , __pos , "u" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_eolChar ( __input , __state , __pos ) } } } } } } ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let str_start = __pos ; match any_char ( __input , __state , __pos ) { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , c ) => { Matched ( __pos , { 
+ fn __parse_simpleEscapeSequence < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "\\" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = { let __choice_res = __parse_digit ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = slice_eq ( __input , __state , __pos , "x" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = slice_eq ( __input , __state , __pos , "u" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_eolChar ( __input , __state , __pos , file_span ) } } } } } } ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let str_start = __pos ; match any_char ( __input , __state , __pos ) { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , c ) => { Matched ( __pos , { 
       match c.chars().next().unwrap() {
         //'b' => '\b',
         //'f' => '\f',
@@ -270,34 +228,34 @@ max_err_pos { self . expected . insert ( expected ) ; } } Failed } } struct Pars
       }
      } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_zeroEscapeSequence < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "\\0" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = __parse_digit ( __input , __state , __pos ) ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  0u8 as char  } ) } Failed => Failed , } } } Failed => Failed , } } } 
+ fn __parse_zeroEscapeSequence < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "\\0" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = __parse_digit ( __input , __state , __pos , file_span ) ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  0u8 as char  } ) } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_hex2EscapeSequence < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "\\x" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let str_start = __pos ; match { let __seq_res = __parse_hexDigit ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { __parse_hexDigit ( __input , __state , __pos ) } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , value ) => { Matched ( __pos , { 
+ fn __parse_hex2EscapeSequence < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "\\x" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let str_start = __pos ; match { let __seq_res = __parse_hexDigit ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { __parse_hexDigit ( __input , __state , __pos , file_span ) } Failed => Failed , } } { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , value ) => { Matched ( __pos , { 
       char::from_u32(u32::from_str_radix(value, 16).unwrap()).unwrap()
      } ) } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_unicodeEscapeSequence < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "\\u{" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let str_start = __pos ; match { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = __parse_hexDigit ( __input , __state , __pos ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } if __repeat_value . len ( ) >= 1 { Matched ( __repeat_pos , ( ) ) } else { Failed } } { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , value ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "}" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
+ fn __parse_unicodeEscapeSequence < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "\\u{" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let str_start = __pos ; match { let mut __repeat_pos = __pos ; let mut __repeat_value = vec ! ( ) ; loop { let __pos = __repeat_pos ; let __step_res = __parse_hexDigit ( __input , __state , __pos , file_span ) ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; __repeat_value . push ( __value ) ; } , Failed => { break ; } } } if __repeat_value . len ( ) >= 1 { Matched ( __repeat_pos , ( ) ) } else { Failed } } { Matched ( __newpos , _ ) => { Matched ( __newpos , & __input [ str_start .. __newpos ] ) } , Failed => Failed , } } ; match __seq_res { Matched ( __pos , value ) => { { let __seq_res = slice_eq ( __input , __state , __pos , "}" ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , { 
       char::from_u32(u32::from_str_radix(value, 16).unwrap()).unwrap()
      } ) } Failed => Failed , } } } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_eolEscapeSequence < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "\\" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_eol ( __input , __state , __pos ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  '\n'  } ) } Failed => Failed , } } } Failed => Failed , } } } 
+ fn __parse_eolEscapeSequence < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < char > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "\\" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = __parse_eol ( __input , __state , __pos , file_span ) ; match __seq_res { Matched ( __pos , _ ) => { Matched ( __pos , {  '\n'  } ) } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_digit < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { '0' ... '9' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[0-9]" ) , } } else { __state . mark_failure ( __pos , "[0-9]" ) } } 
+ fn __parse_digit < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { '0' ... '9' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[0-9]" ) , } } else { __state . mark_failure ( __pos , "[0-9]" ) } } 
 
- fn __parse_hexDigit < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { '0' ... '9' | 'a' ... 'f' | 'A' ... 'F' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[0-9a-fA-F]" ) , } } else { __state . mark_failure ( __pos , "[0-9a-fA-F]" ) } } 
+ fn __parse_hexDigit < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { '0' ... '9' | 'a' ... 'f' | 'A' ... 'F' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[0-9a-fA-F]" ) , } } else { __state . mark_failure ( __pos , "[0-9a-fA-F]" ) } } 
 
- fn __parse___ < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { __state . suppress_fail += 1 ; let res = { let mut __repeat_pos = __pos ; loop { let __pos = __repeat_pos ; let __step_res = { let __choice_res = __parse_whitespace ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_eol ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_comment ( __input , __state , __pos ) } } } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } ; __state . suppress_fail -= 1 ; res } } 
+ fn __parse__ < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { __state . suppress_fail += 1 ; let res = { let mut __repeat_pos = __pos ; loop { let __pos = __repeat_pos ; let __step_res = { let __choice_res = __parse_whitespace ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = __parse_eol ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_comment ( __input , __state , __pos , file_span ) } } } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } ; __state . suppress_fail -= 1 ; res } } 
 
- fn __parse_comment < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = __parse_singleLineComment ( __input , __state , __pos ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_multiLineComment ( __input , __state , __pos ) } } } 
+ fn __parse_comment < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = __parse_singleLineComment ( __input , __state , __pos , file_span ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => __parse_multiLineComment ( __input , __state , __pos , file_span ) } } } 
 
- fn __parse_singleLineComment < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "//" ) ; match __seq_res { Matched ( __pos , _ ) => { { let mut __repeat_pos = __pos ; loop { let __pos = __repeat_pos ; let __step_res = { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = __parse_eolChar ( __input , __state , __pos ) ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { any_char ( __input , __state , __pos ) } Failed => Failed , } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } } Failed => Failed , } } } 
+ fn __parse_singleLineComment < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "//" ) ; match __seq_res { Matched ( __pos , _ ) => { { let mut __repeat_pos = __pos ; loop { let __pos = __repeat_pos ; let __step_res = { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = __parse_eolChar ( __input , __state , __pos , file_span ) ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { any_char ( __input , __state , __pos ) } Failed => Failed , } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } } Failed => Failed , } } } 
 
- fn __parse_multiLineComment < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "/*" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; loop { let __pos = __repeat_pos ; let __step_res = { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = slice_eq ( __input , __state , __pos , "*/" ) ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { any_char ( __input , __state , __pos ) } Failed => Failed , } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , "*/" ) } Failed => Failed , } } } Failed => Failed , } } } 
+ fn __parse_multiLineComment < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __seq_res = slice_eq ( __input , __state , __pos , "/*" ) ; match __seq_res { Matched ( __pos , _ ) => { { let __seq_res = { let mut __repeat_pos = __pos ; loop { let __pos = __repeat_pos ; let __step_res = { let __seq_res = { __state . suppress_fail += 1 ; let __assert_res = slice_eq ( __input , __state , __pos , "*/" ) ; __state . suppress_fail -= 1 ; match __assert_res { Failed => Matched ( __pos , ( ) ) , Matched ( .. ) => Failed , } } ; match __seq_res { Matched ( __pos , _ ) => { any_char ( __input , __state , __pos ) } Failed => Failed , } } ; match __step_res { Matched ( __newpos , __value ) => { __repeat_pos = __newpos ; } , Failed => { break ; } } } Matched ( __repeat_pos , ( ) ) } ; match __seq_res { Matched ( __pos , _ ) => { slice_eq ( __input , __state , __pos , "*/" ) } Failed => Failed , } } } Failed => Failed , } } } 
 
- fn __parse_eol < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = slice_eq ( __input , __state , __pos , "\n" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = slice_eq ( __input , __state , __pos , "\r\n" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = slice_eq ( __input , __state , __pos , "\r" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = slice_eq ( __input , __state , __pos , "\u{2028}" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => slice_eq ( __input , __state , __pos , "\u{2029}" ) } } } } } } } } } 
+ fn __parse_eol < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] { let __choice_res = slice_eq ( __input , __state , __pos , "\n" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = slice_eq ( __input , __state , __pos , "\r\n" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = slice_eq ( __input , __state , __pos , "\r" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => { let __choice_res = slice_eq ( __input , __state , __pos , "\u{2028}" ) ; match __choice_res { Matched ( __pos , __value ) => Matched ( __pos , __value ) , Failed => slice_eq ( __input , __state , __pos , "\u{2029}" ) } } } } } } } } } 
 
- fn __parse_eolChar < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { '\n' | '\r' | '\u{2028}' | '\u{2029}' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[\n\r\u{2028}\u{2029}]" ) , } } else { __state . mark_failure ( __pos , "[\n\r\u{2028}\u{2029}]" ) } } 
+ fn __parse_eolChar < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { '\n' | '\r' | '\u{2028}' | '\u{2029}' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[\n\r\u{2028}\u{2029}]" ) , } } else { __state . mark_failure ( __pos , "[\n\r\u{2028}\u{2029}]" ) } } 
 
- fn __parse_whitespace < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { ' ' | '\t' | '\u{a0}' | '\u{feff}' | '\u{1680}' | '\u{180e}' | '\u{2000}' ... '\u{200a}' | '\u{202f}' | '\u{205f}' | '\u{3000}' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[ \t\u{a0}\u{feff}\u{1680}\u{180e}\u{2000}-\u{200a}\u{202f}\u{205f}\u{3000}]" ) , } } else { __state . mark_failure ( __pos , "[ \t\u{a0}\u{feff}\u{1680}\u{180e}\u{2000}-\u{200a}\u{202f}\u{205f}\u{3000}]" ) } } 
+ fn __parse_whitespace < 'input > ( __input : & 'input str , __state : & mut ParseState < 'input > , __pos : usize , file_span : codemap::Span ) -> RuleResult < () > { # ! [ allow ( non_snake_case , unused ) ] if __input . len ( ) > __pos { let ( __ch , __next ) = char_range_at ( __input , __pos ) ; match __ch { ' ' | '\t' | '\u{a0}' | '\u{feff}' | '\u{1680}' | '\u{180e}' | '\u{2000}' ... '\u{200a}' | '\u{202f}' | '\u{205f}' | '\u{3000}' => Matched ( __next , ( ) ) , _ => __state . mark_failure ( __pos , "[ \t\u{a0}\u{feff}\u{1680}\u{180e}\u{2000}-\u{200a}\u{202f}\u{205f}\u{3000}]" ) , } } else { __state . mark_failure ( __pos , "[ \t\u{a0}\u{feff}\u{1680}\u{180e}\u{2000}-\u{200a}\u{202f}\u{205f}\u{3000}]" ) } } 
 
- pub fn items < 'input > ( __input : & 'input str ) -> ParseResult < Vec<Item> > { # ! [ allow ( non_snake_case , unused ) ] let mut __state = ParseState :: new ( ) ; match __parse_items ( __input , & mut __state , 0 ) { Matched ( __pos , __value ) => { if __pos == __input . len ( ) { return Ok ( __value ) } } _ => { } } let ( __line , __col ) = pos_to_line ( __input , __state . max_err_pos ) ; Err ( ParseError { line : __line , column : __col , offset : __state . max_err_pos , expected : __state . expected , } ) }
\ No newline at end of file
+ pub fn items < 'input > ( __input : & 'input str , file_span : codemap::Span ) -> ParseResult < Vec<Spanned<Item>> > { # ! [ allow ( non_snake_case , unused ) ] let mut __state = ParseState :: new ( ) ; match __parse_items ( __input , & mut __state , 0 , file_span ) { Matched ( __pos , __value ) => { if __pos == __input . len ( ) { return Ok ( __value ) } } _ => { } } let ( __line , __col ) = pos_to_line ( __input , __state . max_err_pos ) ; Err ( ParseError { line : __line , column : __col , offset : __state . max_err_pos , expected : __state . expected , } ) }
\ No newline at end of file
diff --git a/src/grammar.rustpeg b/src/grammar.rustpeg
index c9957e1..2e8ed4c 100644
--- a/src/grammar.rustpeg
+++ b/src/grammar.rustpeg
@@ -1,10 +1,17 @@
 use translate::*;
 use std::char;
+use codemap::{ self, Spanned };
 
-pub items -> Vec<Item> = __ items:item* { items }
+#![arguments(file_span: codemap::Span)]
+
+spanned<inner>
+  = start:#position node:inner end:#position
+  { codemap::Spanned { node, span: file_span.subspan(start as u64, end as u64) } }
+
+pub items -> Vec<Spanned<Item>> = _ items:spanned<item>**_ _ { items }
 
 rule -> Rule
-  = legacy_exported:exportflag cached:cacheflag public:pubflag name:identifier returns: returntype equals expression:expression semicolon? {
+  = legacy_exported:exportflag _ cached:cacheflag _ public:pubflag _ name:identifier _ returns:returntype _ "=" _ expression:expression (_ ";")? {
       Rule{
         name: name,
         expr: Box::new(expression),
@@ -14,12 +21,12 @@ rule -> Rule
       }
     }
 
-    pubflag -> bool = PUB { true } / "" { false }
-    exportflag -> bool = #quiet<("#[export]" / "#[pub]") __ {true} / "" {false}>
-    cacheflag -> bool = "#[cache]" __ {true} / {false}
+    pubflag -> bool = PUB { true } / { false }
+    exportflag -> bool = #quiet<("#[export]" / "#[pub]") {true} / {false}>
+    cacheflag -> bool = "#[cache]" {true} / {false}
 
 template -> Template
-  = name:identifier lt params:(identifier ** comma) gt equals expression:expression semicolon? {
+  = name:identifier _ "<" _ params:COMMASEP<identifier> _ ">" _ "=" _ expression:expression (_ ";")? {
     Template { name: name, params: params, expr: Box::new(expression) }
   }
 
@@ -30,135 +37,140 @@ item -> Item
   / grammar_args
 
   grammar_args -> Item
-    = "#![" __ "arguments" __ lparen args:(grammar_argument**comma) rparen "]" __
+    = "#![" _ "arguments" _ "(" _ args:COMMASEP<grammar_argument> _ ")" _ "]"
     { Item::GrammarArgs(args) }
 
     grammar_argument -> (String, String)
-      = i:identifier colon t:type_string { (i, t) }
+      = i:identifier _ ":" _ t:type_string { (i, t) }
 
 
-type_string -> String = tp:$rust_type __ { tp.to_owned() }
+type_string -> String = tp:$rust_type _ { tp.to_owned() }
 
 returntype -> String
-  = returns tp:type_string { tp }
+  = "->" _ tp:type_string { tp }
   / { "()".to_string() }
 
 rust_identifier = #quiet<[a-zA-Z_][a-zA-Z0-9_]*> / #expected("identifier")
 
 rust_use -> String
-  = v:$(USE rust_path __ (
-    "::" __ "*" __
-    / "::" __ "{" __ ((rust_identifier __ ("as" __ rust_identifier __ )?) ++ ("," __)) "}" __
-    / ("as" __ rust_identifier)?
-  ) ";") __ { v.to_owned() }
+  = v:$(USE _ rust_path _ (
+    "::" _ "*" _
+    / "::" _ "{" _ ((rust_identifier _ ("as" _ rust_identifier _ )?) ++ ("," _)) "}" _
+    / ("as" _ rust_identifier)?
+  ) ";") { v.to_owned() }
 
-rust_path = rust_identifier ++ (__ "::" __)
+rust_path = rust_identifier ++ (_ "::" _)
 
 rust_type
-  = "[" __ rust_type __ "]"
-  / "&" __ ("mut" __)? ("'" rust_identifier __)? rust_type
-  / rust_identifier __ "<" __ (("'" rust_identifier) / rust_type) ** (__ "," __) __ ">"
-  / rust_identifier __ "::" __ rust_type
-  / "(" __ rust_type ** (__ "," __) __ ")"
+  = "[" _ rust_type _ "]"
+  / "&" _ ("mut" _)? ("'" rust_identifier _)? rust_type
+  / rust_identifier _ "<" _ (("'" rust_identifier) / rust_type) ** (_ "," _) _ ">"
+  / rust_identifier _ "::" _ rust_type
+  / "(" _ rust_type ** (_ "," _) _ ")"
   / rust_identifier
 
-expression -> Expr
+expression -> Spanned<Expr>
   = choice
 
-choice -> Expr
-  = head:sequence tail:(slash s:sequence {s})* {
+choice -> Spanned<Expr>
+  = spanned<head:sequence tail:(_ "/" _ s:sequence {s})* {
       if tail.len() > 0 {
         let mut list = tail;
         list.insert(0, head);
         ChoiceExpr(list)
       } else {
-        head
+        head.node
       }
-    }
+    }>
 
-sequence -> Expr
-  = elements:labeled* code:action {
+sequence -> Spanned<Expr>
+  = spanned<elements:labeled**_ _ code:action {
       ActionExpr(elements, code.0, code.1)
     }
-  / elements:prefixed* {
+  / elements:prefixed**_ {
       if elements.len() != 1 {
           SequenceExpr(elements)
       } else {
-          elements.into_iter().next().unwrap()
+          elements.into_iter().next().unwrap().node
       }
-    }
+    }>
 
 labeled -> TaggedExpr
-  = label:identifier colon expression:prefixed {
+  = label:spanned<identifier> _ ":" _ expression:prefixed {
       TaggedExpr{ name: Some(label), expr: Box::new(expression) }
     }
-  / expr: prefixed {
+  / expr:prefixed {
       TaggedExpr{ name: None, expr: Box::new(expr) }
   }
 
-prefixed -> Expr
-  = dollar expression:suffixed {
+prefixed -> Spanned<Expr>
+  = spanned<
+   "$" _ expression:suffixed {
       MatchStrExpr(Box::new(expression))
     }
-  / and expression:suffixed {
+  / "&" _ expression:suffixed {
       PosAssertExpr(Box::new(expression))
     }
-  / not expression:suffixed {
+  / "!" _ expression:suffixed {
       NegAssertExpr(Box::new(expression))
-    }
+    }>
   / suffixed
 
-suffixed -> Expr
-  = e:primary question {
+
+suffixed -> Spanned<Expr>
+  = spanned<
+   e:primary _ "?" {
        OptionalExpr(Box::new(e))
     }
-  / e:primary starstar count:repeatcount sep:primary {
+  / e:primary _ "**" _ count:repeatcount _ sep:primary {
       Repeat(Box::new(e), count, Some(Box::new(sep)))
     }
-  / e:primary plusplus sep:primary {
+  / e:primary _ "++" _ sep:primary {
       Repeat(Box::new(e), BoundedRepeat::Plus, Some(Box::new(sep)))
     }
-  / e:primary star count:repeatcount {
+  / e:primary _ "*" _ count:repeatcount {
       Repeat(Box::new(e), count, None)
     }
-  / e:primary plus {
+  / e:primary _ "+" {
       Repeat(Box::new(e), BoundedRepeat::Plus, None)
-    }
+    }>
   / primary
 
 repeatcount -> BoundedRepeat
-  = lt n:repeatnum gt { BoundedRepeat::Exact(n) }
-  / lt min:repeatnum? comma max:repeatnum? gt { BoundedRepeat::Both(min, max) }
-  / "" { BoundedRepeat::None }
+  = "<" _ n:repeatnum _ ">" { BoundedRepeat::Exact(n) }
+  / "<" _ min:repeatnum? _ "," _ max:repeatnum? _ ">" { BoundedRepeat::Both(min, max) }
+  / { BoundedRepeat::None }
 
 repeatnum -> String
-  = i:integer __ { i.to_string() }
-  / lbrace e:rust_expr rbrace {e}
+  = i:integer { i.to_string() }
+  / "{" _ e:rust_expr _ "}" {e}
 
 #[cache]
-primary -> Expr
-  = name:identifier !lt !returns !equals {
+primary -> Spanned<Expr>
+  = spanned<
+   name:identifier !(_ ("<" / "->" / "=")) {
       RuleExpr(name)
     }
-  / name:identifier lt args:(expression ** comma) gt !equals {
+  / name:identifier _ "<" _ args:COMMASEP<expression> _ ">" !( _ "=") {
       TemplateInvoke(name, args)
     }
   / literal
   / class
-  / dot { AnyCharExpr }
-  / "#position" __ { PositionExpr }
-  / "#quiet" __ lt e:expression gt { QuietExpr(Box::new(e)) }
-  / "#expected" __ lparen s:doubleQuotedString rparen { FailExpr(s) }
-  / "#infix" __ lt atom:expression gt lbrace levels:infix_level+ rbrace
+  / "." { AnyCharExpr }
+  / "#position" { PositionExpr }
+  / "#quiet" _ "<" _ e:expression _ ">" { QuietExpr(Box::new(e)) }
+  / "#expected" _ "(" _ s:doubleQuotedString _ ")" { FailExpr(s) }
+  / "#infix" _ "<" _ atom:expression _ ">" _ "{" _ levels:infix_level++_ _ "}"
         { InfixExpr{ atom: Box::new(atom), levels:levels }}
-  / lparen expression:expression rparen { expression }
+  / "(" _ expression:expression _ ")" { expression.node }
+  >
 
 infix_level -> InfixLevel
-  = assoc:("#L" { InfixAssoc::Left } / "#R" { InfixAssoc::Right} ) __ operators:infix_op+
+  = assoc:("#L" { InfixAssoc::Left } / "#R" { InfixAssoc::Right} ) _ operators:infix_op++_
   { InfixLevel{ assoc: assoc, operators: operators} }
 
 infix_op -> InfixOperator
-  = l:identifier op:(var:identifier colon {var})? e:primary r:identifier lbrace action:rust_expr rbrace
+  = l:identifier _ op:(var:identifier _ ":" _ {var})? e:primary _ r:identifier _ "{" _ action:rust_expr _ "}"
   { InfixOperator{ operator:Box::new(e), action: action, l_arg:l, op_arg:op, r_arg:r } }
 
 /* "Lexical" elements */
@@ -167,58 +179,37 @@ rust_expr -> String
    = literal:$((braced / nonBraceCharacters)*) { format!("{{ {} }}", literal) }
 
 action -> (String, /*is conditional match?*/ bool)
-  = "{" cond:"?"? literal:rust_expr "}" __ {
+  = "{" cond:"?"? literal:rust_expr "}" {
      (literal, cond.is_some())
   }
 
 braced = "{" ((braced / nonBraceCharacters)*) "}"
 nonBraceCharacters = [^{}]+
 
-equals    = "="  __
-colon     = ":"  __
-semicolon = ";"  __
-slash     = "/"  __
-and       = "&"  __
-not       = "!"  __
-dollar    = "$"  __
-question  = "?"  __
-star      = "*"  __
-starstar  = "**" __
-plus      = "+"  __
-plusplus  = "++" __
-lparen    = "("  __
-rparen    = ")"  __
-dot       = "."  __
-returns   = "->" __
-lbrace    = "{"  __
-rbrace    = "}"  __
-comma     = ","  __
-lt        = "<"  __
-gt        = ">"  __
-
-KEYWORD<k> = k !([a-zA-Z0-9_]) __
+KEYWORD<k> = k !([a-zA-Z0-9_])
 USE = KEYWORD<"use">
 PUB = KEYWORD<"pub">
 
 keyword = USE / PUB
 
 integer -> usize
-  = i:$([0-9]+) __ { i.parse().unwrap() }
+  = i:$([0-9]+) { i.parse().unwrap() }
 
 identifier -> String
-  = #quiet<!keyword chars:$([a-zA-Z_][a-zA-Z0-9_]*) __ { chars.to_owned() }> / #expected("identifier")
+  = #quiet<!keyword chars:$([a-zA-Z_][a-zA-Z0-9_]*) { chars.to_owned() }> / #expected("identifier")
 
+COMMASEP<t> = list:t**(_ "," _) (_ ",")? { list }
 /*
  * Modeled after ECMA-262, 5th ed., 7.8.4. (syntax & semantics, rules only
  * vaguely).
  */
 literal -> Expr
-  = value:(doubleQuotedString / singleQuotedString) case_insensitive:"i"? __ {
+  = value:(doubleQuotedString / singleQuotedString) case_insensitive:"i"? {
       LiteralExpr(value,case_insensitive.is_some())
     }
 
 string -> String
-  = string:(doubleQuotedString / singleQuotedString) __ { string }
+  = string:(doubleQuotedString / singleQuotedString) { string }
 
 doubleQuotedString -> String
   = '"' s:doubleQuotedCharacter* '"' { s.into_iter().collect() }
@@ -249,7 +240,7 @@ simpleSingleQuotedCharacter -> char
   = !("'" / "\\" / eolChar) c:$. { c.chars().next().unwrap() }
 
 class -> Expr
-  = "[" inverted:"^"? parts:(classCharacterRange / classCharacter)* "]" flags:"i"? __ {
+  = "[" inverted:"^"? parts:(classCharacterRange / classCharacter)* "]" flags:"i"? {
       CharSetExpr(inverted.is_some(), parts)
     }
 
@@ -310,7 +301,7 @@ digit
 hexDigit
   = [0-9a-fA-F]
 
-__ = #quiet<(whitespace / eol / comment)*>
+_ = #quiet<(whitespace / eol / comment)*>
 
 /* Modeled after ECMA-262, 5th ed., 7.4. */
 comment
diff --git a/src/lib.rs b/src/lib.rs
index 0c03bda..3d33842 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2,6 +2,8 @@
 
 #[macro_use]
 extern crate quote;
+extern crate codemap;
+extern crate codemap_diagnostic;
 
 use std::io;
 use std::io::prelude::*;
@@ -11,21 +13,87 @@ use std::fs::File;
 use std::process::exit;
 use std::env;
 
+use codemap::{ CodeMap, Span };
+use codemap_diagnostic::{ Diagnostic, Level, SpanLabel, SpanStyle, Emitter, ColorConfig };
+
 mod translate;
 mod grammar;
 
-/// Compile a peg grammar to Rust source
-pub fn compile(input: &str) -> Result<String, String> {
-    let ast_items = match grammar::items(&input) {
-        Ok(g) => g,
-        Err(msg) => {
-            return Err(format!("Error parsing language specification: {}", msg))
+struct PegCompiler {
+    codemap: CodeMap,
+    diagnostics: Vec<codemap_diagnostic::Diagnostic>
+}
+
+impl PegCompiler {
+    fn new() -> PegCompiler {
+        PegCompiler {
+            codemap: CodeMap::new(),
+            diagnostics: vec![],
         }
-    };
+    }
+
+    fn has_error(&self) -> bool {
+        self.diagnostics.iter().any(|d| d.level == Level::Error || d.level == Level::Bug)
+    }
+
+    fn span_error(&mut self, error: String, span: Span, label: Option<String>) {
+        self.diagnostics.push(Diagnostic {
+            level: Level::Error,
+            message: error,
+            code: None,
+            spans: vec![SpanLabel { span, label, style: SpanStyle::Primary }]
+        });
+    }
+
+    fn span_warning(&mut self, error: String, span: Span, label: Option<String>) {
+        self.diagnostics.push(Diagnostic {
+            level: Level::Warning,
+            message: error,
+            code: None,
+            spans: vec![SpanLabel { span, label, style: SpanStyle::Primary }]
+        });
+    }
 
-    let grammar_def = translate::Grammar::from_ast(ast_items)?;
-    let output_tokens = translate::compile_grammar(&grammar_def);
-    Ok(output_tokens?.to_string())
+    fn print_diagnostics(&mut self) {
+        if !self.diagnostics.is_empty() {
+            let mut emitter = Emitter::stderr(ColorConfig::Auto, Some(&self.codemap));
+            emitter.emit(&self.diagnostics[..]);
+            self.diagnostics.clear();
+        }
+    }
+
+    fn compile(&mut self, filename: String, input: String) -> Result<String, ()> {
+        let file = self.codemap.add_file(filename, input);
+
+        let ast_items = match grammar::items(&file.source(), file.span) {
+            Ok(g) => g,
+            Err(e) => {
+                self.span_error(
+                    "Error parsing language specification".to_owned(),
+                    file.span.subspan(e.offset as u64, e.offset as u64),
+                    Some(format!("{}", e))
+                );
+                return Err(())
+            }
+        };
+
+        let grammar_def = translate::Grammar::from_ast(self, ast_items)?;
+        let output_tokens = translate::compile_grammar(self, &grammar_def);
+
+        if self.has_error() {
+            Err(())
+        } else {
+            Ok(output_tokens?.to_string())
+        }
+    }
+}
+
+/// Compile a peg grammar to Rust source, printing errors to stderr
+pub fn compile(filename: String, input: String) -> Result<String, ()> {
+    let mut compiler = PegCompiler::new();
+    let result = compiler.compile(filename, input);
+    compiler.print_diagnostics();
+    result
 }
 
 /// Compile the PEG grammar in the specified filename to cargo's OUT_DIR.
@@ -42,10 +110,14 @@ pub fn cargo_build<T: AsRef<Path> + ?Sized>(input_path: &T) {
 
     println!("cargo:rerun-if-changed={}", input_path.display());
 
-    let rust_source = match compile(&peg_source) {
+    let mut compiler = PegCompiler::new();
+    let result = compiler.compile(input_path.to_string_lossy().into_owned(), peg_source);
+    compiler.print_diagnostics();
+
+    let rust_source = match result {
         Ok(s) => s,
-        Err(e) => {
-            writeln!(stderr, "Error compiling PEG grammar `{}`:\n\t{}", input_path.display(), e).unwrap();
+        Err(()) => {
+            writeln!(stderr, "Error compiling PEG grammar").unwrap();
             exit(1);
         }
     };
diff --git a/src/translate.rs b/src/translate.rs
index 4d8c584..93cc013 100644
--- a/src/translate.rs
+++ b/src/translate.rs
@@ -2,17 +2,8 @@ use std::borrow::ToOwned;
 use std::collections::HashMap;
 use quote::Tokens;
 pub use self::Expr::*;
-
-#[derive(Debug)]
-pub struct Error {
-	message: String,
-}
-
-impl From<Error> for String {
-	fn from(e: Error) -> String {
-		e.message
-	}
-}
+use codemap::Spanned;
+use PegCompiler;
 
 fn raw(s: &str) -> Tokens {
 	let mut t = Tokens::new();
@@ -20,7 +11,7 @@ fn raw(s: &str) -> Tokens {
 	t
 }
 
-pub struct Grammar {
+pub(crate) struct Grammar {
 	pub imports: Vec<String>,
 	pub rules: Vec<Rule>,
 	pub templates: HashMap<String, Template>,
@@ -28,27 +19,50 @@ pub struct Grammar {
 }
 
 impl Grammar {
-	pub fn from_ast(items: Vec<Item>) -> Result<Grammar, Error> {
+	pub fn from_ast(compiler: &mut PegCompiler, items: Vec<Spanned<Item>>) -> Result<Grammar, ()> {
 		let mut imports = Vec::new();
-		let mut rules = Vec::new();
+		let mut rules: Vec<Rule> = Vec::new();
 		let mut templates = HashMap::new();
 
 		let mut grammar_args = None;
 
 		for item in items {
-			match item {
+			match item.node {
 				Item::Use(u) => { imports.push(u); }
-				Item::Rule(rule) => { rules.push(rule); }
-				Item::Template(template) => { templates.insert(template.name.clone(), template); }
+				Item::Rule(rule) => {
+					if rules.iter().any(|existing_rule| existing_rule.name == rule.name) {
+						compiler.span_error(
+							format!("Multiple rules named `{}`", rule.name),
+							item.span,
+							Some("duplicate declaration".to_owned())
+						)
+					}
+
+					rules.push(rule);
+				}
+				Item::Template(template) => {
+					if let Some(prev) = templates.insert(template.name.clone(), template) {
+						compiler.span_error(
+							format!("Multiple templates named `{}`", prev.name),
+							item.span,
+							Some("duplicate declaration".to_owned())
+						)
+					}
+				}
 				Item::GrammarArgs(args) => {
 					if grammar_args.is_none() {
 						grammar_args = Some(args);
 					} else {
-						Err(Error{ message: format!("Multiple #![grammar_args] attributes") })?
+						compiler.span_error(
+							"Grammar contains multiple #![grammar_args] attributes".to_owned(),
+							item.span,
+							Some("duplicate declaration".to_owned())
+						)
 					}
 				}
 			}
 		}
+
 		Ok(Grammar{ imports:imports, rules:rules, templates:templates, args: grammar_args.unwrap_or(vec![]) })
 	}
 
@@ -72,14 +86,6 @@ impl Grammar {
 		}).collect();
 		quote!(#(#args)*)
 	}
-
-	fn check_name(&self, name: &str) -> Result<(), Error> {
-		if self.args.iter().any(|x| x.0 == name) {
-			Err(Error{ message: format!("Capture variable `{}` shadows grammar argument", name) })?
-		}
-
-		Ok(())
-	}
 }
 
 pub enum Item {
@@ -91,7 +97,7 @@ pub enum Item {
 
 pub struct Rule {
 	pub name: String,
-	pub expr: Box<Expr>,
+	pub expr: Box<Spanned<Expr>>,
 	pub ret_type: String,
 	pub exported: bool,
 	pub cached: bool,
@@ -100,7 +106,7 @@ pub struct Rule {
 pub struct Template {
 	pub name: String,
 	pub params: Vec<String>,
-	pub expr: Box<Expr>,
+	pub expr: Box<Spanned<Expr>>,
 }
 
 #[derive(Clone)]
@@ -111,8 +117,8 @@ pub struct CharSetCase {
 
 #[derive(Clone)]
 pub struct TaggedExpr {
-	pub name: Option<String>,
-	pub expr: Box<Expr>,
+	pub name: Option<Spanned<String>>,
+	pub expr: Box<Spanned<Expr>>,
 }
 
 #[derive(Clone)]
@@ -121,19 +127,19 @@ pub enum Expr {
 	LiteralExpr(String,bool),
 	CharSetExpr(bool, Vec<CharSetCase>),
 	RuleExpr(String),
-	SequenceExpr(Vec<Expr>),
-	ChoiceExpr(Vec<Expr>),
-	OptionalExpr(Box<Expr>),
-	Repeat(Box<Expr>, BoundedRepeat, /*sep*/ Option<Box<Expr>>),
-	PosAssertExpr(Box<Expr>),
-	NegAssertExpr(Box<Expr>),
+	SequenceExpr(Vec<Spanned<Expr>>),
+	ChoiceExpr(Vec<Spanned<Expr>>),
+	OptionalExpr(Box<Spanned<Expr>>),
+	Repeat(Box<Spanned<Expr>>, BoundedRepeat, /*sep*/ Option<Box<Spanned<Expr>>>),
+	PosAssertExpr(Box<Spanned<Expr>>),
+	NegAssertExpr(Box<Spanned<Expr>>),
 	ActionExpr(Vec<TaggedExpr>, /*action*/ String, /*cond*/ bool),
-	MatchStrExpr(Box<Expr>),
+	MatchStrExpr(Box<Spanned<Expr>>),
 	PositionExpr,
-	TemplateInvoke(String, Vec<Expr>),
-	QuietExpr(Box<Expr>),
+	TemplateInvoke(String, Vec<Spanned<Expr>>),
+	QuietExpr(Box<Spanned<Expr>>),
 	FailExpr(String),
-	InfixExpr{ atom: Box<Expr>, levels: Vec<InfixLevel> }
+	InfixExpr{ atom: Box<Spanned<Expr>>, levels: Vec<InfixLevel> }
 }
 
 #[derive(Copy, Clone, PartialEq, Eq)]
@@ -147,7 +153,7 @@ pub struct InfixLevel {
 
 #[derive(Clone)]
 pub struct InfixOperator {
-	pub operator: Box<Expr>,
+	pub operator: Box<Spanned<Expr>>,
 	pub l_arg: String,
 	pub op_arg: Option<String>,
 	pub r_arg: String,
@@ -283,11 +289,11 @@ static HELPERS: &'static str = stringify! {
 	}
 };
 
-pub fn compile_grammar(grammar: &Grammar) -> Result<Tokens, Error> {
+pub(crate) fn compile_grammar(compiler: &mut PegCompiler, grammar: &Grammar) -> Result<Tokens, ()> {
 	let mut items = vec![make_parse_state(&grammar.rules)];
 
 	for rule in &grammar.rules {
-		items.push(compile_rule(grammar, rule)?)
+		items.push(compile_rule(compiler, grammar, rule))
 	}
 	items.extend(grammar.rules.iter().filter(|rule| rule.exported).map(|rule| {
 		compile_rule_export(grammar, rule)
@@ -342,7 +348,7 @@ fn make_parse_state(rules: &[Rule]) -> Tokens {
 }
 
 
-fn compile_rule(grammar: &Grammar, rule: &Rule) -> Result<Tokens, Error> {
+fn compile_rule(compiler: &mut PegCompiler, grammar: &Grammar, rule: &Rule) -> Tokens {
 	let ref rule_name = rule.name;
 	let name = raw(&format!("__parse_{}", rule.name));
 	let ret_ty = raw(&rule.ret_type);
@@ -352,7 +358,7 @@ fn compile_rule(grammar: &Grammar, rule: &Rule) -> Result<Tokens, Error> {
 		lexical: &LexicalContext { defs: HashMap::new() },
 	};
 
-	let body = compile_expr(context, &*rule.expr)?;
+	let body = compile_expr(compiler, context, &*rule.expr);
 
 	let wrapped_body = if cfg!(feature = "trace") {
 		quote!{{
@@ -373,7 +379,7 @@ fn compile_rule(grammar: &Grammar, rule: &Rule) -> Result<Tokens, Error> {
 	let nl = raw("\n\n"); // make output slightly more readable
 	let extra_args_def = grammar.extra_args_def();
 
-	Ok(if rule.cached {
+	if rule.cached {
 		let cache_field = raw(&format!("{}_cache", rule.name));
 
 		let cache_trace = if cfg!(feature = "trace") {
@@ -407,7 +413,7 @@ fn compile_rule(grammar: &Grammar, rule: &Rule) -> Result<Tokens, Error> {
 				#wrapped_body
 			}
 		}
-	})
+	}
 }
 
 fn compile_rule_export(grammar: &Grammar, rule: &Rule) -> Tokens {
@@ -443,20 +449,20 @@ fn compile_rule_export(grammar: &Grammar, rule: &Rule) -> Tokens {
 	}
 }
 
-fn compile_match_and_then(cx: Context, e: &Expr, value_name: Option<&str>, then: Tokens) -> Result<Tokens, Error> {
-	let seq_res = compile_expr(Context{ result_used: value_name.is_some(), ..cx }, e)?;
+fn compile_match_and_then(compiler: &mut PegCompiler, cx: Context, e: &Spanned<Expr>, value_name: Option<&str>, then: Tokens) -> Tokens {
+	let seq_res = compile_expr(compiler, Context{ result_used: value_name.is_some(), ..cx }, e);
 	let name_pat = match value_name {
 		Some(name) => raw(name),
 		None => raw("_")
 	};
 
-	Ok(quote! {{
+	quote! {{
 		let __seq_res = #seq_res;
 		match __seq_res {
 			Matched(__pos, #name_pat) => { #then }
 			Failed => Failed,
 		}
-	}})
+	}}
 }
 
 fn cond_swap<T>(swap: bool, tup: (T, T)) -> (T, T) {
@@ -487,7 +493,7 @@ fn format_char_set(invert: bool, cases: &[CharSetCase]) -> String {
 }
 
 struct LexicalContext<'a> {
-	defs: HashMap<&'a str, (&'a Expr, &'a LexicalContext<'a>)>
+	defs: HashMap<&'a str, (&'a Spanned<Expr>, &'a LexicalContext<'a>)>
 }
 
 #[derive(Copy, Clone)]
@@ -504,8 +510,8 @@ impl<'a> Context<'a> {
 }
 
 
-fn compile_expr(cx: Context, e: &Expr) -> Result<Tokens, Error> {
-	Ok(match *e {
+fn compile_expr(compiler: &mut PegCompiler, cx: Context, e: &Spanned<Expr>) -> Tokens {
+	match e.node {
 		AnyCharExpr => {
 			quote!{ any_char(__input, __state, __pos) }
 		}
@@ -557,10 +563,19 @@ fn compile_expr(cx: Context, e: &Expr) -> Result<Tokens, Error> {
 
 		RuleExpr(ref rule_name) => {
 			if let Some(&(template_arg, lexical_context)) = cx.lexical.defs.get(&rule_name[..]) {
-				compile_expr(Context{ lexical: lexical_context, ..cx }, template_arg)?
+				compile_expr(compiler, Context{ lexical: lexical_context, ..cx }, template_arg)
 			} else if let Some(rule) = cx.grammar.find_rule(rule_name) {
 				let func = raw(&format!("__parse_{}", rule_name));
 				let extra_args_call = cx.grammar.extra_args_call();
+
+				if cx.result_used && rule.ret_type == "()" {
+					compiler.span_warning(
+						format!("Tried to bind result of rule `{}`, which returns () - perhaps you forgot a return type?", rule_name),
+						e.span,
+						Some("does not return a value".to_owned())
+					);
+				}
+
 				if cx.result_used || rule.ret_type == "()" {
 					quote!{ #func(__input, __state, __pos #extra_args_call) }
 				} else {
@@ -572,66 +587,86 @@ fn compile_expr(cx: Context, e: &Expr) -> Result<Tokens, Error> {
 					}
 				}
 			} else {
-				Err(Error{ message: format!("No rule named `{}`", rule_name) })?
+				compiler.span_error(
+					format!("No rule named `{}`", rule_name),
+					e.span,
+					Some("rule not found".to_owned())
+				);
+				quote!()
 			}
 		}
 
 		TemplateInvoke(ref name, ref params) => {
-			let template = cx.grammar.templates.get(&name[..])
-				.ok_or_else(|| Error { message: format!("No template named `{}``", name) })?;
+			let template = match cx.grammar.templates.get(&name[..]) {
+				Some(x) => x,
+				None => {
+					compiler.span_error(
+						format!("No template named `{}`", name),
+						e.span,
+						Some("template not found".to_owned())
+					);
+					return quote!()
+				}
+			};
 
 			if template.params.len() != params.len() {
-				Err(Error { message: format!("Expected {} arguments to `{}`, found {}", template.params.len(), template.name, params.len())})?
+				compiler.span_error(
+					format!("Expected {} arguments to `{}`, found {}", template.params.len(), template.name, params.len()),
+					e.span,
+					Some("wrong number of arguments".to_owned())
+				);
+				return quote!()
 			}
 
 			let defs = template.params.iter().zip(params.iter())
 				.map(|(name, expr)| (&name[..], (expr, cx.lexical))).collect();
-			compile_expr(Context{ lexical: &LexicalContext { defs: defs }, ..cx }, &template.expr)?
+			compile_expr(compiler, Context{ lexical: &LexicalContext { defs: defs }, ..cx }, &template.expr)
 		}
 
 		SequenceExpr(ref exprs) => {
-			fn write_seq(cx: Context, exprs: &[Expr]) -> Result<Tokens, Error> {
+			fn write_seq(compiler: &mut PegCompiler, cx: Context, exprs: &[Spanned<Expr>]) -> Tokens {
 				if exprs.len() == 1 {
-					compile_expr(cx.result_used(false), &exprs[0])
+					compile_expr(compiler, cx.result_used(false), &exprs[0])
 				} else {
-					compile_match_and_then(cx, &exprs[0], None, write_seq(cx, &exprs[1..])?)
+					let seq = write_seq(compiler, cx, &exprs[1..]);
+					compile_match_and_then(compiler, cx, &exprs[0], None, seq)
 				}
 			}
 
 			if exprs.len() > 0 {
-				write_seq(cx, &exprs)?
+				write_seq(compiler, cx, &exprs)
 			} else {
 				quote!{ Matched(__pos, ()) }
 			}
 		}
 
 		ChoiceExpr(ref exprs) => {
-			fn write_choice(cx: Context, exprs: &[Expr]) -> Result<Tokens, Error>  {
+			fn write_choice(compiler: &mut PegCompiler, cx: Context, exprs: &[Spanned<Expr>]) -> Tokens  {
 				if exprs.len() == 1 {
-					compile_expr(cx, &exprs[0])
+					compile_expr(compiler, cx, &exprs[0])
 				} else {
-					let choice_res = compile_expr(cx, &exprs[0])?;
-					let next = write_choice(cx, &exprs[1..])?;
+					let choice_res = compile_expr(compiler, cx, &exprs[0]);
+					let next = write_choice(compiler, cx, &exprs[1..]);
 
-					Ok(quote! {{
+					quote! {{
 						let __choice_res = #choice_res;
 						match __choice_res {
 							Matched(__pos, __value) => Matched(__pos, __value),
 							Failed => #next
 						}
-					}})
+					}}
 				}
 			}
 
 			if exprs.len() > 0 {
-				write_choice(cx, &exprs)?
+				write_choice(compiler, cx, &exprs)
 			} else {
 				quote!{ Matched(__pos, ()) }
 			}
 		}
 
 		OptionalExpr(ref e) => {
-			let optional_res = compile_expr(cx, e)?;
+			let optional_res = compile_expr(compiler, cx, e);
 
 			if cx.result_used {
 				quote!{
@@ -651,7 +686,7 @@ fn compile_expr(cx: Context, e: &Expr) -> Result<Tokens, Error> {
 		}
 
 		Repeat(ref e, ref bounds, ref sep) => {
-			let inner = compile_expr(cx, e)?;
+			let inner = compile_expr(compiler, cx, e);
 
 			let (min, max) = match *bounds {
 				BoundedRepeat::None => (None, None),
@@ -661,7 +696,7 @@ fn compile_expr(cx: Context, e: &Expr) -> Result<Tokens, Error> {
 			};
 
 			let match_sep = if let &Some(ref sep) = sep {
-				let sep_inner = compile_expr(cx.result_used(false), &*sep)?;
+				let sep_inner = compile_expr(compiler, cx.result_used(false), &*sep);
 				quote! {
 					let __pos = if __repeat_value.len() > 0 {
 						let __sep_res = #sep_inner;
@@ -728,7 +763,7 @@ fn compile_expr(cx: Context, e: &Expr) -> Result<Tokens, Error> {
 		}
 
 		PosAssertExpr(ref e) => {
-			let assert_res = compile_expr(cx, e)?;
+			let assert_res = compile_expr(compiler, cx, e);
 			quote! {{
 				__state.suppress_fail += 1;
 				let __assert_res = #assert_res;
@@ -741,7 +776,7 @@ fn compile_expr(cx: Context, e: &Expr) -> Result<Tokens, Error> {
 		}
 
 		NegAssertExpr(ref e) => {
-			let assert_res = compile_expr(cx.result_used(false), e)?;
+			let assert_res = compile_expr(compiler, cx.result_used(false), e);
 			quote! {{
 				__state.suppress_fail += 1;
 				let __assert_res = #assert_res;
@@ -754,23 +789,35 @@ fn compile_expr(cx: Context, e: &Expr) -> Result<Tokens, Error> {
 		}
 
 		ActionExpr(ref exprs, ref code, is_cond) => {
-			fn write_seq(cx: Context, exprs: &[TaggedExpr], code: &str, is_cond: bool) -> Result<Tokens, Error> {
+			fn write_seq(compiler: &mut PegCompiler, cx: Context, exprs: &[TaggedExpr], code: &str, is_cond: bool) -> Tokens {
 				match exprs.first() {
 					Some(ref first) => {
-						let name = first.name.as_ref().map(|s| &s[..]);
+						if let Some(name) = first.name.as_ref() {
+							if cx.grammar.args.iter().any(|x| x.0 == name.node) {
+								compiler.span_error(
+									format!("Capture variable `{}` shadows grammar argument", name.node),
+									name.span,
+									Some("prohibited name".to_owned())
+								)
+							}
 
-						if let Some(name) = name {
-							cx.grammar.check_name(name)?;
+							if name.node.starts_with("__") {
+								compiler.span_error(
+									format!("Capture variable `{}` has reserved name", name.node),
+									name.span,
+									Some("prohibited name".to_owned())
+								)
+							}
 						}
 
-						compile_match_and_then(cx, &*first.expr, name,
-							write_seq(cx, &exprs[1..], code, is_cond)?
-						)
+						let name = first.name.as_ref().map(|s| &s[..]);
+						let seq = write_seq(compiler, cx, &exprs[1..], code, is_cond);
+						compile_match_and_then(compiler, cx, &*first.expr, name, seq)
 					}
 					None => {
 						let code_block = raw(code);
 
-						Ok(if is_cond {
+						if is_cond {
 							quote!{
 								match #code_block {
 									Ok(res) => Matched(__pos, res),
@@ -782,15 +829,15 @@ fn compile_expr(cx: Context, e: &Expr) -> Result<Tokens, Error> {
 							}
 						} else {
 							quote!{ Matched(__pos, #code_block) }
-						})
+						}
 					}
 				}
 			}
 
-			write_seq(cx, &exprs, &code, is_cond)?
+			write_seq(compiler, cx, &exprs, &code, is_cond)
 		}
 		MatchStrExpr(ref expr) => {
-			let inner = compile_expr(cx.result_used(false), expr)?;
+			let inner = compile_expr(compiler, cx.result_used(false), expr);
 			quote! {{
 				let str_start = __pos;
 				match #inner {
@@ -803,7 +850,7 @@ fn compile_expr(cx: Context, e: &Expr) -> Result<Tokens, Error> {
 			quote! { Matched(__pos, __pos) }
 		}
 		QuietExpr(ref expr) => {
-			let inner = compile_expr(cx, expr)?;
+			let inner = compile_expr(compiler, cx, expr);
 			quote! {{
 				__state.suppress_fail += 1;
 				let res = #inner;
@@ -816,15 +863,21 @@ fn compile_expr(cx: Context, e: &Expr) -> Result<Tokens, Error> {
 		}
 
 		InfixExpr{ ref atom, ref levels } => {
-			let match_atom = compile_expr(cx, atom)?;
-			let ty = if let RuleExpr(ref atom_rule_name) = **atom {
+			let match_atom = compile_expr(compiler, cx, atom);
+			let ty = if let RuleExpr(ref atom_rule_name) = atom.node {
 				if let Some(rule) = cx.grammar.find_rule(atom_rule_name) {
 					raw(&rule.ret_type[..])
 				} else {
-					Err(Error{ message: format!("No rule named `{}`", atom_rule_name) })?
+					// Error emitted by compile_expr
+					return quote!();
 				}
 			} else {
-				Err(Error{ message: format!("#infix atom must be a rule, not an arbitrary expression (so its return type can be inspected)") })?
+				compiler.span_error(
+					format!("#infix atom must be a rule, not an arbitrary expression (so its return type can be inspected)"),
+					atom.span,
+					Some("not allowed here".to_owned())
+				);
+				return quote!();
 			};
 
 			let mut level_code = Vec::new();
@@ -840,7 +893,7 @@ fn compile_expr(cx: Context, e: &Expr) -> Result<Tokens, Error> {
 
 				let mut rules = Vec::new();
 				for op in &level.operators {
-					let match_rule = compile_expr(cx.result_used(op.op_arg.is_some()), &*op.operator)?;
+					let match_rule = compile_expr(compiler, cx.result_used(op.op_arg.is_some()), &*op.operator);
 					let action = raw(&op.action[..]);
 
 					let l_arg = raw(&op.l_arg[..]);
@@ -892,7 +945,7 @@ fn compile_expr(cx: Context, e: &Expr) -> Result<Tokens, Error> {
 				__infix_parse(0, __input, __state, __pos #extra_args_call)
 			}}
 		}
-	})
+	}
 }
 
 #[test]


Test patch: