aboutsummaryrefslogtreecommitdiffstats
path: root/src/parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.rs')
-rw-r--r--src/parser.rs22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/parser.rs b/src/parser.rs
index 05d7dd1..d82cdaf 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -207,19 +207,27 @@ where
(
many(
choice!(
- satisfy(|c| c != '<')
- .map(|c|
- KeyboardKeyWithModifiers::new(
- KeyboardKey::Character(Character::new(c)),
- None,
- )
- ),
+ action_character(),
special_key()
)
),
).map(|(keys,)| Action::Map(keys))
}
+fn action_character<I>() -> impl Parser<Input = I, Output = KeyboardKeyWithModifiers>
+where
+ I: Stream<Item = char>,
+ I::Error: ParseError<I::Item, I::Range, I::Position>,
+{
+ satisfy(|c| c != '<')
+ .map(|c|
+ KeyboardKeyWithModifiers::new(
+ KeyboardKey::Character(Character::new(c)),
+ None,
+ )
+ )
+}
+
fn special_key<I>() -> impl Parser<Input = I, Output = KeyboardKeyWithModifiers>
where
I: Stream<Item = char>,