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

Broken highlighting for macros #98

Open
glyh opened this issue Apr 1, 2022 · 1 comment
Open

Broken highlighting for macros #98

glyh opened this issue Apr 1, 2022 · 1 comment

Comments

@glyh
Copy link

glyh commented Apr 1, 2022

Here's the code

#define _vm_binop(op, wrap)\
    {\
        Janet op1 = stack[B];\
        Janet op2 = stack[C];\
        if (janet_checktype(op1, JANET_NUMBER) && janet_checktype(op2, JANET_NUMBER)) {\
            double x1 = janet_unwrap_number(op1);\
            double x2 = janet_unwrap_number(op2);\
            stack[A] = wrap(x1 op x2);\
            vm_pcnext();\
        } else {\
            vm_commit();\
            stack[A] = janet_binop_call(#op, "r" #op, op1, op2);\
            vm_checkgc_pcnext();\
        }\
    }

And the highlighting outcome on neovim:
image
Something is wrong after line 168.

@ObserverOfTime
Copy link
Member

The parser doesn't support stringizing (#foo) and concatenation (foo##bar).

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

2 participants