aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeddy Wing2018-10-01 03:25:47 +0200
committerTeddy Wing2018-10-01 03:25:47 +0200
commit8dc7accbec1aaf73ac3d34a0f659e7e361e612ad (patch)
treec45d21ef5ea14910b809095b8b4ce8ef4a5b325e /src
parent5ef2443642a2d8b223afdf169200a725d2809b76 (diff)
downloaddome-key-map-8dc7accbec1aaf73ac3d34a0f659e7e361e612ad.tar.bz2
Revert "Add <Bslash> and <lt> escapes for action (WIP)"
This reverts commit 5ef2443642a2d8b223afdf169200a725d2809b76. See that commit for details.
Diffstat (limited to 'src')
-rw-r--r--src/parser.rs56
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'";
}