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

Parser error when escaping backslash in a macro #22

Closed
dansalvato opened this issue Jul 24, 2024 · 0 comments
Closed

Parser error when escaping backslash in a macro #22

dansalvato opened this issue Jul 24, 2024 · 0 comments

Comments

@dansalvato
Copy link
Contributor

Another instance of macros defeating the parser with their strange syntax exceptions.

Basically, vasm lets you access local labels from out of scope using the convention global_label\.local_label. In macros, the backslash is used for special macro parameters, so it needs to be escaped for other uses. That means in macros, local labels are referenced like global_label\\.local_label, which results in the LSP parser error.

SETLOCAL    MACRO
_LOCAL      SET         \1\\.local    ; Parser error
            ENDM

test_function:
            nop
.local:     nop
            rts

test_function2:
            SETLOCAL    test_function
            lea         _LOCAL,a0
            rts
grahambates added a commit to grahambates/tree-sitter-m68k that referenced this issue Jul 24, 2024
Support both single and single backslash, for use inside macro
see grahambates/m68k-lsp#22
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