vscode-arm icon indicating copy to clipboard operation
vscode-arm copied to clipboard

extension breaks inline assembly (C/C++) if semicolon is used

Open shuffle2 opened this issue 4 years ago • 3 comments

static void int_restore(const u32 int_state) {
    asm volatile(
        "msr    CPSR_c, %0;"
        :
        : "r" (int_state)
    );
}

This breaks C syntax highlighting for the rest of the file. The problem appears to be the ;. If it's escaped with \;, then highlighting works (for both arm and C) altho the compiler complains. Removing the ; solves the problem, but I think it's not compatible with all compiler versions. It would be nice to support this in the syntax highlighter.

shuffle2 avatar Sep 18 '20 05:09 shuffle2

Hey - I think this might be related to #15. If you want to add your case to that issue and the linked issue?

dan-c-underwood avatar Sep 24 '20 19:09 dan-c-underwood

yea, interesting. i can confirm asm(";") similarly works as a minimal repro for this.

shuffle2 avatar Sep 25 '20 09:09 shuffle2

Still seem to be an issue. Took a while to figure out that this extension was the culprit.

elupus avatar Feb 01 '24 12:02 elupus