@@ -196,23 +196,23 @@ mod parser {
197 fn var<'a>() -> impl Parser<'a, Output = &'a str> {
197 fn var<'a>() -> impl Parser<'a, Output = &'a str> {
198 // var = [_a-zA-Z][_a-zA-Z0-9]*
198 // var = [_a-zA-Z][_a-zA-Z0-9]*
199− move |input: &'a str| match input
199+ move |input: &'a str| {
200− .char_indices()
201+ .char_indices()
201− .take_while(|(p, c)| {
202+ .take_while(|(p, c)| {
202− *c == '_'
203+ *c == '_'
203− || if *p == 0 {
204+ || if *p == 0 {
204− c.is_ascii_alphabetic()
205+ c.is_ascii_alphabetic()
205− } else {
206+ } else {
206− c.is_ascii_alphanumeric()
207+ c.is_ascii_alphanumeric()
211− Some((index, c)) if index >= 1 => {
211+ .map(|(index, c)| {
212− let index = index + c.len_utf8();
212+ let index = index + c.len_utf8();
213− Ok((&input[index..], &input[0..index]))
213+ (&input[index..], &input[0..index])
215− _ => Err(input),
215+ .ok_or(input)