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

Attached and Detached Modifier Abstractions #49

Open
rt-kill opened this issue Mar 27, 2023 · 0 comments
Open

Attached and Detached Modifier Abstractions #49

rt-kill opened this issue Mar 27, 2023 · 0 comments

Comments

@rt-kill
Copy link

rt-kill commented Mar 27, 2023

Modifier Extensions

Disclaimer: I am not very familiar with Treesitter or parser's in general, and I'm just putting this here as a consideration.

I am new to Neorg and have been reading through wiki/specifications. I when messing around with it I noticed that detached modifier extensions are not implemented at the moment. Here is a screen shot of the queries/norg/highlights.scm file over in the Neorg repo.

image

I thought it was a cool concept and looked a little into how much effort writing up a PR would take, and that landed me here. This is where my inexperience with Treesitter/parser's comes into play. I'm curious if it would make sense to have some more abstract nodes that encompass the more specific nodes.

If I understand correctly, the node-types.json defines the different tokens that can appear in a norg file and the grammar.json defines a strict left to right unambiguous grammar that can be used to construct any "valid" norg file. I see we have some general nodes such as _word and _lowercase, but don't have ones such as _modifier, _attached_modifier, and _detached_modifier.

If these make sense to add, I would assume it could make an implementation of detached_modifier_extensions more elegant by allowing for a more general reference to preceding nodes.

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

1 participant