如何为字符串嵌入评估代码

时间:2017-01-12 09:19:57

标签: syntax visual-studio-code sublimetext grammar tmlanguage

我尝试为客户语言编写vscode语法文件

我使用photoshop绘制自定义语言的示例语法。

syntax-wxml

如何编写tmLanguage的语法?

评估代码规则

{
    "begin": "\\{\\{",
    "beginCaptures": {
        "0": {
            "name": "punctuation.definition.brace.curly.start"
        }
    },
    "end": "\\}\\}",
    "endCaptures": {
        "0": {
            "name": "punctuation.definition.brace.curly.end"
        }
    },
    "patterns": [
        {
            "include": "source.js#expression"
        }
    ]
}

将它用于子字符串实体模式但环绕字符串不匹配

标签

属性的双引号内容规则
{
    "begin": "\"",
    "beginCaptures": {
        "0": {
            "name": "punctuation.definition.string.begin.wxml"
        }
    },
    "end": "\"",
    "endCaptures": {
        "0": {
            "name": "punctuation.definition.string.end.wxml"
        }
    },
    "name": "string.quoted.double  <===============********||||",
    "patterns": [
        {
            "include": " the up pattern  ↑"
        }
    ]
}

如果name存在,则所有双引号内容都是字符串的颜色

否则环绕声字符串是纯文本颜色。

0 个答案:

没有答案