nim-lang / vscode-nim

A VS Code plugin for the Nim language
Other
63 stars 5 forks source link

syntax highlighting fails on an emit pragma after a nim symbol #53

Closed dwhall closed 3 months ago

dwhall commented 3 months ago

I'm using this emit pragma and syntax colorization is failing. It loses track of what is enclosed in quotes and renders everything after the pragma colorized as if it is a string (in the quotes).

proc foo(fieldVal: int, bitOffset: int, bitWidth: int) =
  {.emit: ["asm (\"bfi %0, %1, %2, %3\"\n\t: \"+r\" (", result, ")\n\t: \"r\" (", fieldVal, "), \"n\" (", bitOffset, "), \"n\" (", bitWidth, "));\n"].}
dwhall commented 3 months ago

This issue affects these simpler examples:

{.emit: [result, "fails"].}
{.emit: ["test", result, "fails"].}