The grammar allows for \ continuation line marker, and i'm unable to carry the current scope of my grammar onto the next line:
The 'set' command allows for multiple option, 'args' being one. 'set args' have arguments which are anything blank separated until newline, unless the last char is \. In that case the next line is treated as part of the previous one. Fairly standard.
Here's a sample .tmLanguages examples that i've written to parse this expression.
"name": "meta.command.set.gdb",
"begin": "(?:^|\\G)[ \t]*(set)\\b[ \t]*",
"beginCaptures": { "1": { "name": "keyword.control.command.gdb" } },
"patterns":[
{
"name": "meta.command.set.args.gdb",
"begin": "\\b(args?)\\b[ \t]*",
"beginCaptures": { "1": { "name": "support.function.option.gdb" } },
"patterns": [
{
"match": "\\b(.*)",
"captures": { "1": { "name": "variable.other.variable.gdb" } }
}
],
"end": "$"
}
],
"end": "$"
This languages definition works for single line 'set args a b', a & b will correctly be highlighted in blue. In the previous image, one can see the \ symbol is taken as the args value, which i don't want.
How can tell TmLanguages that this symbol, which can be anywhere between words, means "handle nxt line" ? Obviously i can't handle all possibilities.
The regex engine is the one from VSCode so the syntax highlighter is fed one line at a time from what i understood.