diff options
| author | Teddy Wing | 2018-09-28 12:39:15 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2018-09-28 12:39:15 +0200 | 
| commit | 829f257d4c0064209102083dc9d692834e42a8c1 (patch) | |
| tree | 828a13eb704c85f54bf104075bb166e3d79a35e1 /src/parser.rs | |
| parent | 76ab45d4a5890c4c348b33c32775e45a7c320c58 (diff) | |
| download | dome-key-map-829f257d4c0064209102083dc9d692834e42a8c1.tar.bz2 | |
Revert "parser::map(): Try to parse Action with a dependency on MapKind"
This reverts commit 76ab45d4a5890c4c348b33c32775e45a7c320c58. See that
commit for details.
Diffstat (limited to 'src/parser.rs')
| -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>, | 
