strings
This commit is contained in:
@@ -29,6 +29,118 @@
|
||||
"strings": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "#string GLSL heredoc — embedded GLSL highlighting",
|
||||
"begin": "(#string)\\s+(GLSL|VERT|FRAG|VERTEX|FRAGMENT)\\s*$",
|
||||
"end": "^(\\2)",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "keyword.other.directive.sx" },
|
||||
"2": { "name": "entity.name.tag.sx" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": { "name": "entity.name.tag.sx" }
|
||||
},
|
||||
"contentName": "meta.embedded.block.glsl",
|
||||
"patterns": [
|
||||
{ "include": "source.glsl" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "#string SQL heredoc — embedded SQL highlighting",
|
||||
"begin": "(#string)\\s+(SQL)\\s*$",
|
||||
"end": "^(\\2)",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "keyword.other.directive.sx" },
|
||||
"2": { "name": "entity.name.tag.sx" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": { "name": "entity.name.tag.sx" }
|
||||
},
|
||||
"contentName": "meta.embedded.block.sql",
|
||||
"patterns": [
|
||||
{ "include": "source.sql" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "#string HTML heredoc — embedded HTML highlighting",
|
||||
"begin": "(#string)\\s+(HTML)\\s*$",
|
||||
"end": "^(\\2)",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "keyword.other.directive.sx" },
|
||||
"2": { "name": "entity.name.tag.sx" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": { "name": "entity.name.tag.sx" }
|
||||
},
|
||||
"contentName": "meta.embedded.block.html",
|
||||
"patterns": [
|
||||
{ "include": "text.html.basic" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "#string JSON heredoc — embedded JSON highlighting",
|
||||
"begin": "(#string)\\s+(JSON)\\s*$",
|
||||
"end": "^(\\2)",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "keyword.other.directive.sx" },
|
||||
"2": { "name": "entity.name.tag.sx" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": { "name": "entity.name.tag.sx" }
|
||||
},
|
||||
"contentName": "meta.embedded.block.json",
|
||||
"patterns": [
|
||||
{ "include": "source.json" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "#string heredoc — generic (no embedded language)",
|
||||
"begin": "(#string)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*$",
|
||||
"end": "^(\\2)",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "keyword.other.directive.sx" },
|
||||
"2": { "name": "entity.name.tag.sx" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": { "name": "entity.name.tag.sx" }
|
||||
},
|
||||
"contentName": "string.unquoted.heredoc.sx"
|
||||
},
|
||||
{
|
||||
"comment": "Backtick multi-line string",
|
||||
"begin": "`",
|
||||
"end": "`",
|
||||
"beginCaptures": {
|
||||
"0": { "name": "punctuation.definition.string.begin.sx" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"0": { "name": "punctuation.definition.string.end.sx" }
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"name": "constant.character.escape.sx",
|
||||
"match": "\\\\[ntr`\"\\\\{}0]"
|
||||
},
|
||||
{
|
||||
"begin": "\\{",
|
||||
"end": "\\}",
|
||||
"beginCaptures": {
|
||||
"0": { "name": "punctuation.definition.template-expression.begin.sx" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"0": { "name": "punctuation.definition.template-expression.end.sx" }
|
||||
},
|
||||
"patterns": [
|
||||
{ "include": "$self" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "string.quoted.other.sx",
|
||||
"match": "[^`\\\\{}]+"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "Double-quoted string",
|
||||
"begin": "\"",
|
||||
"end": "\"",
|
||||
"beginCaptures": {
|
||||
@@ -40,7 +152,7 @@
|
||||
"patterns": [
|
||||
{
|
||||
"name": "constant.character.escape.sx",
|
||||
"match": "\\\\[ntr\"\\\\{}]"
|
||||
"match": "\\\\[ntr\"\\\\{}0]"
|
||||
},
|
||||
{
|
||||
"begin": "\\{",
|
||||
@@ -67,7 +179,7 @@
|
||||
"patterns": [
|
||||
{
|
||||
"name": "keyword.other.directive.sx",
|
||||
"match": "#run"
|
||||
"match": "#(?:run|import|insert|builtin|foreign|library)\\b"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user