diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/parser.rs | 66 | 
1 files changed, 13 insertions, 53 deletions
| diff --git a/src/parser.rs b/src/parser.rs index f034784..57abbbb 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -138,61 +138,21 @@ where      I: Stream<Item = char>,      I::Error: ParseError<I::Item, I::Range, I::Position>,  { -    // ( -    //     map_kind(), -    //     whitespace_separator(), -    //     trigger(), -    //     whitespace_separator(), -    //     action() -    // ).map(|(kind, _, trigger, _, action)| -    //     Map { -    //         trigger: trigger, -    //         action: action, -    //         kind: kind, -    //     } -    // ) - -    // --- -    take_until(newline()).flat_map(|line| { -        map_kind().parse(line).map(|t| { -            let map_kind = t.0; -            let rest = t.1; - -            ( -                whitespace_separator(), -                trigger(), -                whitespace_separator(), -                action() -            ) -                .map(|(_, trigger, _, action)| -                    Map { -                        trigger: trigger, -                        action: action, -                        kind: map_kind, -                    } -                ) -                .parse(rest) - -            // map_kind - -            // match map_kind { -            //     MapKind::Map => { -            //     }, -            //     MapKind::Command => { -            //     }, -            // } -        }) -    }) +    ( +        map_kind(), +        whitespace_separator(), +        trigger(), +        whitespace_separator(), +        action() +    ).map(|(kind, _, trigger, _, action)| +        Map { +            trigger: trigger, +            action: action, +            kind: kind, +        } +    )  } - -// fn real_action<I>(input: I) -> impl Parser<Input = I, Output = Action2> -// where -//     I: Stream<Item = char>, -//     I::Error: ParseError<I::Item, I::Range, I::Position>, -// { -// } -  fn map_collection<I>() -> impl Parser<Input = I, Output = MapCollection>  where      I: Stream<Item = char>, | 
