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

can't generate cradio layout for default keymap #12

Open
dstudzinski opened this issue Feb 1, 2023 · 4 comments
Open

can't generate cradio layout for default keymap #12

dstudzinski opened this issue Feb 1, 2023 · 4 comments

Comments

@dstudzinski
Copy link

Hi,

I'm trying to generate layout for Cradio with default keymap.
I downloaded default keymap from https://github.com/zmkfirmware/zmk/blob/main/app/boards/shields/cradio/cradio.keymap
and I try to generate layout with zmk-viewer generate cradio -f ./cradio.keymap

I get

ERR  error="/Users/dawidstudzinski/Projects/zmk-config/cradio.keymap:9:13: unexpected token \"(\" (expected (<ident> | <int>))"

error and empty layout (same like without -f flag).

Am I doing something wrong or is it problem with keymap file?

@sqdbruh
Copy link

sqdbruh commented Feb 8, 2023

Same. Probably some issue with the parser.

@MrMarble
Copy link
Owner

MrMarble commented Mar 14, 2023

Sorry for the delay, It's in part related to #14 but also the Home rows, as @sqdrck said, the parser is broken.

I'll fix it as soon as I can


Diving deeper into the issue, it isn't the #define itself but the custom home row function, I can't ignore part of the file with the parser I'm using. I'm trying to make my own parser which should be easier to read and maintain

@bakerbrandond
Copy link

Sorry for the delay, It's in part related to #14 but also the Home rows, as @sqdrck said, the parser is broken.

I'll fix it as soon as I can

Diving deeper into the issue, it isn't the #define itself but the custom home row function, I can't ignore part of the file with the parser I'm using. I'm trying to make my own parser which should be easier to read and maintain

have you looked into treesitter? there is a devicetree grammar already, can maybe reuse the treesitter parser?
https://github.com/joelspadin/tree-sitter-devicetree

@llama0815
Copy link

I'm not sure if it needs another ticket, but it's an issue with define as well:

I've got this line #include "keys_de.h" for local German characters and this error:
unexpected token \"#\" (expected \"/\" \"{\" Device \"}\" \";\")"

when I change the line to #include <keys_de.h> it works but is obviously wrong.

@MrMarble MrMarble mentioned this issue May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants