Skip to content
New issue

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

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

Already on GitHub? # to your account

Idea: Keep an index of the maps already parsed #617

Open
wismill opened this issue Jan 25, 2025 · 0 comments
Open

Idea: Keep an index of the maps already parsed #617

wismill opened this issue Jan 25, 2025 · 0 comments
Labels
compile-keymap Indicates a need for improvements or additions to keymap compilation enhancement Indicates new feature requests needs info

Comments

@wismill
Copy link
Member

wismill commented Jan 25, 2025

When we resolve include statements, we may parse the same file multiple times, e.g.:

xkb_symbols "base" { … };
xkb_symbols "map1" { include "file(base)" };
xkb_symbols "map2" { include "file(map1)" };

I we want "file(map2)", we end up parsing "base" 3 times and "map1" 2 times, but also all the maps in between…

Caching all parsed maps could be costly, but what if we simply keep an index file/map → map position in file? Then when looking up for a map, we can first check this index and if the map was already parsed, start parsing exactly where the map is or start from scratch if the file or map was not parsed yet.

This would be useful mostly for symbols.

@wismill wismill added compile-keymap Indicates a need for improvements or additions to keymap compilation enhancement Indicates new feature requests needs info labels Jan 25, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
compile-keymap Indicates a need for improvements or additions to keymap compilation enhancement Indicates new feature requests needs info
Projects
None yet
Development

No branches or pull requests

1 participant