diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/parser.rs | 56 |
1 files changed, 1 insertions, 55 deletions
diff --git a/src/parser.rs b/src/parser.rs index 4b1f83e..a84aba1 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -257,11 +257,7 @@ where )), try(( many1(key_modifier()), - choice!( - try(string_case_insensitive("Bslash")).map(|_| '\\'), - try(string_case_insensitive("lt")).map(|_| '<'), - try(action_character().and(satisfy(|c| c != '>'))) - ).map(|c| + action_character().map(|c| KeyboardKey::Character(Character::new(c)) ), )) @@ -879,56 +875,6 @@ mod tests { } #[test] - fn action_parses_map_with_bslash_and_lt_special_keys() { - let text = "a<Bslash>AND<lt>><C-Bslash><D-S-lt>"; - - let expected = Action::Map(vec![ - KeyboardKeyWithModifiers::new( - KeyboardKey::Character(Character::new('a')), - None, - ), - KeyboardKeyWithModifiers::new( - KeyboardKey::Character(Character::new('\\')), - None, - ), - KeyboardKeyWithModifiers::new( - KeyboardKey::Character(Character::new('A')), - None, - ), - KeyboardKeyWithModifiers::new( - KeyboardKey::Character(Character::new('N')), - None, - ), - KeyboardKeyWithModifiers::new( - KeyboardKey::Character(Character::new('D')), - None, - ), - KeyboardKeyWithModifiers::new( - KeyboardKey::Character(Character::new('<')), - None, - ), - KeyboardKeyWithModifiers::new( - KeyboardKey::Character(Character::new('>')), - None, - ), - KeyboardKeyWithModifiers::new( - KeyboardKey::Character(Character::new('\\')), - Some(vec![Flag::Control]), - ), - KeyboardKeyWithModifiers::new( - KeyboardKey::Character(Character::new('<')), - Some(vec![ - Flag::Meta, - Flag::Shift, - ]), - ), - ]); - let result = action_map().easy_parse(text).map(|t| t.0); - - assert_eq!(result, Ok(expected)); - } - - #[test] fn action_parses_command_to_vec_of_words() { let text = "/usr/bin/say 'hello'"; } |
