You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I'm having trouble writing a query for a new feature in asm-lsp. I'd like to be able to capture every piece of "data" underneath a given label. For example, with
some_label: // some comment .long 1,2,3 .section .text
I would like to capture some_label: along with .long 1, 2, 3. Using the tree-sitter-asm grammar, some_label: could be captured as a label node, and .long 1, 2, 3 could be captured using the query (meta (int)+). I've been running into issues capturing multiple data nodes under a label reliably, while also avoiding data nodes captures crossing over labels as well. To give a slightly longer example, I tried the following code
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi! I'm having trouble writing a query for a new feature in asm-lsp. I'd like to be able to capture every piece of "data" underneath a given label. For example, with
I would like to capture
some_label:
along with.long 1, 2, 3
. Using the tree-sitter-asm grammar,some_label:
could be captured as alabel
node, and.long 1, 2, 3
could be captured using the query(meta (int)+)
. I've been running into issues capturing multiple data nodes under a label reliably, while also avoiding data nodes captures crossing over labels as well. To give a slightly longer example, I tried the following codewith this query:
This yields the following captures, missing the
.asciz "hello", " ", "world!"
:Any help would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions