Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace purely hashmap based keymaps with function-based mappings (basically a parser-combinator style API?) #103

Open
elkowar opened this issue Jan 7, 2023 · 0 comments
Assignees
Labels
topic-inputmapper Things related to the input-mapper component

Comments

@elkowar
Copy link
Contributor

elkowar commented Jan 7, 2023

Currently, input-mapper expresses keymaps as nested hashmaps.
This has a few very key limitations:

  • It doesn't allow us to match on arbitrary keys by some property (as evidenced by the fact that we already have a special cased fallback "any_printable" case)
  • It means that for numbers and anything like that, we need to basically store all keymaps 10x
  • the api is kinda eh

Optimally, every keymap would just consist of a function that takes an input, does whatever to it, and returns a new submap (-> another function) or the leaf value.
This would simplify a lot of the more complex logic here, and should be possible to express relatively cleanly through a parser-combinator style API. However, it's not yet clear how we'd do descriptions with that...

This is a followup to the implementation of #86 done in #100

@elkowar elkowar converted this from a draft issue Jan 7, 2023
@elkowar elkowar added the topic-inputmapper Things related to the input-mapper component label Jan 7, 2023
@elkowar elkowar self-assigned this Jan 7, 2023
@elkowar elkowar added this to the Proper architecture milestone Jan 7, 2023
@elkowar elkowar moved this from Todo to In Progress in Bazed itor Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-inputmapper Things related to the input-mapper component
Projects
Status: In Progress
Development

No branches or pull requests

2 participants