diff --git a/src/lib.rs b/src/lib.rs index 1bd5fe7..3897f5f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -422,7 +422,7 @@ fn binding_parser(pair: Pair<'_, Rule>) -> Result, ParseError> { return Err(Box::new(err).into()); } - let bindings = bind_cartesian_product + let mut bindings: Vec = bind_cartesian_product .into_iter() .zip(command_cartesian_product) .map(|(definition, command)| Binding { @@ -435,5 +435,9 @@ fn binding_parser(pair: Pair<'_, Rule>) -> Result, ParseError> { .collect(), }) .collect(); + + for binding in bindings.iter_mut() { + binding.definition.modifiers.remove(&Modifier::Omission); + } Ok(bindings) } diff --git a/src/token.rs b/src/token.rs index 1a9cddf..75f6e03 100644 --- a/src/token.rs +++ b/src/token.rs @@ -23,6 +23,7 @@ pub enum Modifier { Control, Shift, Any, + Omission, } impl From for Modifier { @@ -37,7 +38,8 @@ impl From for Modifier { "mod5" => Modifier::Altgr, "shift" => Modifier::Shift, "any" => Modifier::Any, - _ => panic!("that's not a modifier"), + "_" => Modifier::Omission, + _ => panic!("{:?} is not a modifier", value), } } }