diff options
| author | Teddy Wing | 2018-09-30 09:02:37 +0200 |
|---|---|---|
| committer | Teddy Wing | 2018-09-30 09:33:13 +0200 |
| commit | 544bedbd452d6e9448b414aac9be4bfaa8df0d3b (patch) | |
| tree | 7698faed99890a481a37dbc95ac41836885ce048 /src/lib.rs | |
| parent | d73107314398e9aeb4540d96854d58728b874dbe (diff) | |
| download | dome-key-map-544bedbd452d6e9448b414aac9be4bfaa8df0d3b.tar.bz2 | |
parser: Add `key_code` and `special_key` parsers
Still need to test them though. They'll be used in conjunction with
another new parser, `action_map`, which will parser map-type action
strings.
`key_code` parses `autopilot::key::KeyCode`s, basically all special keys
and modifiers. `special_key` parses key codes inside `<` `>` braces.
Change the test to use `easy_parse` to give a clear error message.
Add `recursion_limit` to the crate on the advice of the compiler in
order for the `choice!` macro in `key_code()` to work properly.
Otherwise it spits out a giant error message complaining about
`rustc --explain E0277`. If I remove a handful of elements from the
`choice!`, it compiles, so it seems there's an upper bound restricted by
the recursion limit.
Modifier keys are included in a commented section as these are part of
the 'autopilot' `KeyCode` enum, but they'll be handled in a separate
parser.
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1,3 +1,5 @@ +#![recursion_limit="128"] + extern crate autopilot; // extern crate cocoa; |
