165 lines
4.5 KiB
JSON
165 lines
4.5 KiB
JSON
|
{
|
||
|
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
||
|
"name": "Outrun",
|
||
|
"fileTypes": [
|
||
|
"outrun"
|
||
|
],
|
||
|
"patterns": [{
|
||
|
"comment": "Multi-line documentation",
|
||
|
"begin": "```doc\r?\n",
|
||
|
"end": "\\s*```",
|
||
|
"name": "comment.block.documentation.outrun"
|
||
|
},
|
||
|
{
|
||
|
"begin": "\"",
|
||
|
"beginCaptures": {
|
||
|
"0": {
|
||
|
"name": "punctuation.definition.string.begin.outrun"
|
||
|
}
|
||
|
},
|
||
|
"comment": "double quoted string (allows for interpolation)",
|
||
|
"end": "\"",
|
||
|
"endCaptures": {
|
||
|
"0": {
|
||
|
"name": "punctuation.definition.string.end.outrun"
|
||
|
}
|
||
|
},
|
||
|
"name": "string.quoted.double.outrun"
|
||
|
},
|
||
|
{
|
||
|
"comment": "`use` keyword",
|
||
|
"match": "(use)\\s+",
|
||
|
"captures": {
|
||
|
"1": {
|
||
|
"name": "keyword.other.use.outrun"
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"comment": "`struct` keyword",
|
||
|
"match": "(struct)\\s+",
|
||
|
"captures": {
|
||
|
"1": {
|
||
|
"name": "keyword.other.struct.outrun"
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"comment": "`protocol` keyword",
|
||
|
"match": "(protocol)\\s+",
|
||
|
"captures": {
|
||
|
"1": {
|
||
|
"name": "keyword.other.protocol.outrun"
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"comment": "`impl` keyword",
|
||
|
"match": "(impl)\\s+",
|
||
|
"captures": {
|
||
|
"1": {
|
||
|
"name": "keyword.other.impl.outrun"
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"comment": "function definition",
|
||
|
"match": "(defp?)\\s+(_?[a-z]\\w*[?]?)",
|
||
|
"captures": {
|
||
|
"1": {
|
||
|
"name": "keyword.other.def.outrun"
|
||
|
},
|
||
|
"2": {
|
||
|
"name": "entity.name.function.outrun"
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"comment": "A type name",
|
||
|
"match": "(([A-Z]\\w*\\s*(\\.)\\s*)*[A-Z]\\w*)",
|
||
|
"captures": {
|
||
|
"1": {
|
||
|
"name": "entity.name.type.outrun"
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"comment": "Keyword argument",
|
||
|
"match": "(,\\s*)?(_?[a-z]\\w*[?!]?):",
|
||
|
"captures": {
|
||
|
"2": {
|
||
|
"name": "variable.parameter.outrun"
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"comment": "Block",
|
||
|
"begin": "(do)\\s*",
|
||
|
"beginCaptures": {
|
||
|
"1": {
|
||
|
"name": "keyword.other.do.outrun"
|
||
|
}
|
||
|
},
|
||
|
"end": "\\s*(end)",
|
||
|
"endCaptures": {
|
||
|
"1": {
|
||
|
"name": "keyword.other.end.outrun"
|
||
|
}
|
||
|
},
|
||
|
"patterns": [{
|
||
|
"include": "$self"
|
||
|
}]
|
||
|
},
|
||
|
{
|
||
|
"comment": "Local function call",
|
||
|
"begin": "(_?[a-z]\\w*[?!]?)\\s*\\(",
|
||
|
"beginCaptures": {
|
||
|
"1": {
|
||
|
"name": "entity.name.function.outrun"
|
||
|
}
|
||
|
},
|
||
|
"end": "\\s*\\)",
|
||
|
"patterns": [{
|
||
|
"include": "$self"
|
||
|
}]
|
||
|
},
|
||
|
{
|
||
|
"comment": "Indexed function call",
|
||
|
"begin": "\\.(_?[a-z]\\w*[?!]?)\\s*\\(",
|
||
|
"beginCaptures": {
|
||
|
"1": {
|
||
|
"name": "entity.name.function.outrun"
|
||
|
}
|
||
|
},
|
||
|
"end": "\\s*\\)",
|
||
|
"patterns": [{
|
||
|
"include": "$self"
|
||
|
}]
|
||
|
},
|
||
|
{
|
||
|
"comment": "Struct index",
|
||
|
"match": "\\.(_?[a-z]\\w*[?!]?)",
|
||
|
"name": "entity.other.attribute-name.outrun"
|
||
|
},
|
||
|
{
|
||
|
"comment": "boolean literals",
|
||
|
"match": "(true|false)",
|
||
|
"captures": {
|
||
|
"1": {
|
||
|
"name": "constant.language.boolean.outrun"
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"comment": "local variables",
|
||
|
"match": "(_?[a-z]\\w*[?]?)",
|
||
|
"captures": {
|
||
|
"1": {
|
||
|
"name": "variable.name.outrun"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
],
|
||
|
"repository": {},
|
||
|
"scopeName": "source.outrun"
|
||
|
}
|