Open evakili opened 5 years ago
PR welcome. This is implemented here and I usually use the Monarch Playground to work on these things. Most likely, the single line comment case must become more involved, i.e. //
should enter a new state, in the new state, similar to how multi-line strings are implemented.
Here you can find an example for strings which support \
I will be glad if I could provide a PR.
But it seems it's different than multi-line strings. \
is a continuation character at end of every line. So
int mai\
n(int arg\
c, char** ar\
gv) {
}
is weird but, is a valid C++ program (although made Github highlighter confused too :stuck_out_tongue_winking_eye:)!
Better to say all \\\w*\r?\n
regex matches should be ignored.
oh, I always used \
in pragma statements, and have seen folks using \
sometimes in single line comments. I didn't realize \
can be used anywhere.
Me too!
Albeit it could be fixed only for comments for now (by the solution you've said), and could be fixed for all cases. What's your opinion?
monaco-editor version: 0.15.1 Browser: Chrome (maybe others) OS: Windows
In C/C++
\
is used as line continuation mark so defining macros in multi-line is possible:It is also possible to change a single line comment to multi-line with
\
:As you see in above snippet, Github syntax highlighter accept this syntax in comments and colorize line 2 and 3 as comments, but Monaco does not: