aboutsummaryrefslogtreecommitdiffstats
path: root/example.dkmap
diff options
context:
space:
mode:
authorTeddy Wing2018-10-01 03:18:34 +0200
committerTeddy Wing2018-10-01 03:18:34 +0200
commit5ef2443642a2d8b223afdf169200a725d2809b76 (patch)
treea666db63c165db76c6016cbf084743f2df60dacf /example.dkmap
parent45e173176a0d4b44c9b1bf3cc7a880929d1360a6 (diff)
downloaddome-key-map-5ef2443642a2d8b223afdf169200a725d2809b76.tar.bz2
Add <Bslash> and <lt> escapes for action (WIP)
Trying to add new escape special keys for '\' and '<' but having a bit of trouble. Looks like I'm not using `and` `satisfy` correctly, as I'm getting this error: error[E0271]: type mismatch resolving `<(impl combine::Parser, combine::combinator::Satisfy<_, [closure@src/parser.rs:263:56: 263:68]>) as combine::Parser>::Output == char` --> src/parser.rs:260:18 | 260 | (choice!( | __________________^ 261 | | try(string_case_insensitive("Bslash")).map(|_| '\\'), 262 | | try(string_case_insensitive("lt")).map(|_| '<'), 263 | | try(action_character().and(satisfy(|c| c != '>'))) 264 | | ).map(|c| | |_________________^ expected tuple, found char | = note: expected type `(char, _)` found type `char` = note: required because of the requirements on the impl of `combine::Parser` for `combine::combinator::Try<(impl combine::Parser, combine::combinator::Satisfy<_, [closure@src/parser.rs:263:56: 263:68]>)>` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) I had added the `satisfy` not '>' after getting this test failure without it: ---- parser::tests::action_parses_map_with_bslash_and_lt_special_keys stdout ---- thread 'parser::tests::action_parses_map_with_bslash_and_lt_special_keys' panicked at 'assertion failed: `(left == right)` left: `Err(Errors { position: PointerOffset(4332007031), errors: [Unexpected(Token('l')), Expected(Token('>'))] })`, right: `Ok(Map([KeyboardKeyWithModifiers { key: Character(Character(Character('a'))), flags: None }, KeyboardKeyWithModifiers { key: Character(Character(Character('\\'))), flags: None }, KeyboardKeyWithModifiers { key: Character(Character(Character('A'))), flags: None }, KeyboardKeyWithModifiers { key: Character(Character(Character('N'))), flags: None }, KeyboardKeyWithModifiers { key: Character(Character(Character('D'))), flags: None }, KeyboardKeyWithModifiers { key: Character(Character(Character('<'))), flags: None }, KeyboardKeyWithModifiers { key: Character(Character(Character('>'))), flags: None }, KeyboardKeyWithModifiers { key: Character(Character(Character('\\'))), flags: Some([Control]) }, KeyboardKeyWithModifiers { key: Character(Character(Character('<'))), flags: Some([Meta, Shift]) }]))`', src/parser.rs:928:9 as I suspected this was a problem with `<lt>`. But now that I think about it, it could just as easily have been a problem with `<Bslash>`. Not sure. Anyway, I'm thinking of dropping these escapes because they're redundant (we already have '\' escaping) and because I'm tired of these errors.
Diffstat (limited to 'example.dkmap')
0 files changed, 0 insertions, 0 deletions