Skip to content

Comments

fix: error in label followed by directive with single integer argument (ARMv7)#21

Merged
RubixDev merged 1 commit intoRubixDev:mainfrom
cfung89:fix_labels
Nov 6, 2025
Merged

fix: error in label followed by directive with single integer argument (ARMv7)#21
RubixDev merged 1 commit intoRubixDev:mainfrom
cfung89:fix_labels

Conversation

@cfung89
Copy link
Contributor

@cfung89 cfung89 commented Nov 1, 2025

Hello! There seems to be an error when there is a label followed by a directive (meta identifier) with only a single argument. The error does not happen with multiple arguments.

The following is an example of this issue with length: .word 4:

Before:

(program ; [0, 0] - [1, 0]
  (instruction ; [0, 0] - [0, 15]
    kind: (word) ; [0, 0] - [0, 6]
    (ERROR) ; [0, 6] - [0, 7]
    (ident ; [0, 8] - [0, 13]
      (meta_ident)) ; [0, 8] - [0, 13]
    (int))) ; [0, 14] - [0, 15]

Tree-sitter incorrectly identifies the length label as an instruction and thus has an ERROR node when parsing the : character.

After:

(program ; [0, 0] - [1, 0]
  (label ; [0, 0] - [0, 15]
    (ident) ; [0, 0] - [0, 6]
    (meta ; [0, 8] - [0, 15]
      kind: (meta_ident) ; [0, 8] - [0, 13]
      (int)))) ; [0, 14] - [0, 15]

Thanks!

@RubixDev
Copy link
Owner

RubixDev commented Nov 6, 2025

looks great, thanks!

@RubixDev RubixDev merged commit 805558b into RubixDev:main Nov 6, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants