From 829f257d4c0064209102083dc9d692834e42a8c1 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 28 Sep 2018 12:39:15 +0200 Subject: Revert "parser::map(): Try to parse Action with a dependency on MapKind" This reverts commit 76ab45d4a5890c4c348b33c32775e45a7c320c58. See that commit for details. --- src/parser.rs | 66 ++++++++++++----------------------------------------------- 1 file 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, I::Error: ParseError, { - // ( - // 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(input: I) -> impl Parser -// where -// I: Stream, -// I::Error: ParseError, -// { -// } - fn map_collection() -> impl Parser where I: Stream, -- cgit v1.2.3