79faf99b53
This CL fixes an issue where a comment was not highlighted correctly after a class definition. Bug: v8:7793 Notry: true Change-Id: I378a1373c8f4a6c8d48c4bb2ee4a4c3b39b2341f Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585733 Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Auto-Submit: Sigurd Schneider <sigurds@chromium.org> Cr-Commit-Position: refs/heads/master@{#61067}
178 lines
4.2 KiB
JSON
178 lines
4.2 KiB
JSON
{
|
|
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
|
"name": "Torque",
|
|
"patterns": [
|
|
{
|
|
"name": "comment.line.double-slash.torque",
|
|
"begin": "//",
|
|
"end": "$"
|
|
},
|
|
{
|
|
"name": "comment.block.torque",
|
|
"begin": "/\\*",
|
|
"end": "\\*/"
|
|
},
|
|
{
|
|
"name": "support.function.torque",
|
|
"match": "\\b(assert|check|debug|unreachable|Cast|Convert|FromConstexpr|UnsafeCast)\\b"
|
|
},
|
|
{
|
|
"name": "constant.other.torque",
|
|
"match": "\\b(true|True|false|False|Undefined|Hole|Null|k[A-Z][A-Za-z0-9]+)\\b"
|
|
},
|
|
{
|
|
"begin": "\\b<(?=[A-Za-z][0-9A-Za-z_|, ]*>)",
|
|
"end": ">",
|
|
"patterns": [
|
|
{
|
|
"include": "#common"
|
|
},
|
|
{
|
|
"name": "support.type.torque",
|
|
"match": "([A-Za-z][0-9A-Za-z_]*)"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"begin": "\\b(?=(macro|runtime|builtin)\\b)",
|
|
"end": ";|\\{",
|
|
"patterns": [
|
|
{
|
|
"begin": "\\(",
|
|
"end": "\\)",
|
|
"patterns": [
|
|
{
|
|
"include": "#common"
|
|
},
|
|
{
|
|
"match": "(([A-Za-z][0-9A-Za-z_]*):\\s*)?([A-Za-z][0-9A-Za-z_]*)",
|
|
"captures":{
|
|
"3": {"name": "support.type.torque"}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"include": "#common"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"begin": "\\b(type)\\b",
|
|
"end": ";",
|
|
"captures": {
|
|
"1": {
|
|
"name": "keyword.other.torque"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#common"
|
|
},
|
|
{
|
|
"name": "support.type.torque",
|
|
"match": "\\b([A-Za-z][0-9A-Za-z_]*)\\b"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "keyword.control.torque",
|
|
"match": "#include"
|
|
},
|
|
{
|
|
"include": "#common"
|
|
}
|
|
],
|
|
"repository": {
|
|
"common": {
|
|
"patterns": [
|
|
{
|
|
"match": "\\b(extends)\\s+([A-Za-z0-9]+)",
|
|
"captures": {
|
|
"1": {
|
|
"name": "keyword.other.torque"
|
|
},
|
|
"2": {
|
|
"name": "support.type.torque"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "keyword.control.torque",
|
|
"match": "\\b(if|else|while|for|return|continue|break|goto|otherwise|try|label|catch)\\b"
|
|
},
|
|
{
|
|
"name": "keyword.other.torque",
|
|
"match": "\\b(constexpr|macro|builtin|runtime|intrinsic|javascript|implicit|deferred|label|labels|tail|let|generates|weak|extern|const|typeswitch|case|transient|transitioning|operator|namespace)\\b"
|
|
},
|
|
{
|
|
"name": "keyword.operator.torque",
|
|
"match": "\\b(=|\\*=)\\b"
|
|
},
|
|
{
|
|
"match": "\\b(class)\\s+([A-Za-z0-9]+)",
|
|
"captures": {
|
|
"1": {
|
|
"name": "keyword.other.torque"
|
|
},
|
|
"2": {
|
|
"name": "support.type.torque"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"match": "\\b(struct)\\s+([A-Za-z0-9]+)",
|
|
"captures": {
|
|
"1": {
|
|
"name": "keyword.other.torque"
|
|
},
|
|
"2": {
|
|
"name": "support.type.torque"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "string.quoted.double.torque",
|
|
"begin": "\"",
|
|
"end": "\"",
|
|
"patterns": [
|
|
{
|
|
"name": "constant.character.escape.torque",
|
|
"match": "\\\\."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "string.quoted.single.torque",
|
|
"begin": "'",
|
|
"end": "'",
|
|
"patterns": [
|
|
{
|
|
"name": "constant.character.escape.torque",
|
|
"match": "\\\\."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"begin": ":(\\s*)?",
|
|
"end": "(?=(generates|[^0-9A-Za-z_| ]))",
|
|
"patterns": [
|
|
{
|
|
"include": "#common"
|
|
},
|
|
{
|
|
"name": "support.type.torque",
|
|
"match": "([A-Za-z][0-9A-Za-z_]*)"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "support.function.torque",
|
|
"match": "\\b[A-Za-z0-9_]+\\b(?=(<[ ,:A-Za-z0-9_]+>)?\\()"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"scopeName": "source.torque"
|
|
}
|