mirror of https://github.com/onivim/oni.git
Feature/add several language grammars (#2068)
* add text mate grammar paths to config * fix typo in php name and rename objc filetypes and extensions * add python, sh, zsh * actually add the files * Fix incorrect dir paths for md syntaxes
This commit is contained in:
parent
48d55d9b74
commit
471244d57f
|
@ -213,6 +213,124 @@ const BaseConfiguration: IConfigurationValues = {
|
|||
"TypeScriptReact.tmLanguage.json",
|
||||
),
|
||||
},
|
||||
"language.lua.textMateGrammar": path.join(
|
||||
__dirname,
|
||||
"extensions",
|
||||
"lua",
|
||||
"syntaxes",
|
||||
"lua.tmLanguage.json",
|
||||
),
|
||||
"language.clojure.textMateGrammar": path.join(
|
||||
__dirname,
|
||||
"extensions",
|
||||
"clojure",
|
||||
"syntaxes",
|
||||
"clojure.tmLanguage.json",
|
||||
),
|
||||
"language.ruby.textMateGrammar": path.join(
|
||||
__dirname,
|
||||
"extensions",
|
||||
"ruby",
|
||||
"syntaxes",
|
||||
"ruby.tmLanguage.json",
|
||||
),
|
||||
"language.swift.textMateGrammar": path.join(
|
||||
__dirname,
|
||||
"extensions",
|
||||
"swift",
|
||||
"syntaxes",
|
||||
"swift.tmLanguage.json",
|
||||
),
|
||||
"language.rust.textMateGrammar": path.join(
|
||||
__dirname,
|
||||
"extensions",
|
||||
"rust",
|
||||
"syntaxes",
|
||||
"rust.tmLanguage.json",
|
||||
),
|
||||
"language.php.textMateGrammar": path.join(
|
||||
__dirname,
|
||||
"extensions",
|
||||
"php",
|
||||
"syntaxes",
|
||||
"php.tmLanguage.json",
|
||||
),
|
||||
"language.objc.textMateGrammar": {
|
||||
".m": path.join(
|
||||
__dirname,
|
||||
"extensions",
|
||||
"objective-c",
|
||||
"syntaxes",
|
||||
"objective-c.tmLanguage.json",
|
||||
),
|
||||
".h": path.join(
|
||||
__dirname,
|
||||
"extensions",
|
||||
"objective-c",
|
||||
"syntaxes",
|
||||
"objective-c.tmLanguage.json",
|
||||
),
|
||||
},
|
||||
"language.objcpp.textMateGrammar": {
|
||||
".mm": path.join(
|
||||
__dirname,
|
||||
"extensions",
|
||||
"objective-c++",
|
||||
"syntaxes",
|
||||
"objective-c++.tmLanguage.json",
|
||||
),
|
||||
},
|
||||
"language.python.textMateGrammar": path.join(
|
||||
__dirname,
|
||||
"extensions",
|
||||
"python",
|
||||
"syntaxes",
|
||||
"python.tmLanguage.json",
|
||||
),
|
||||
"language.sh.textMateGrammar": path.join(
|
||||
__dirname,
|
||||
"extensions",
|
||||
"shell",
|
||||
"syntaxes",
|
||||
"shell.tmLanguage.json",
|
||||
),
|
||||
"language.zsh.textMateGrammar": path.join(
|
||||
__dirname,
|
||||
"extensions",
|
||||
"shell",
|
||||
"syntaxes",
|
||||
"shell.tmLanguage.json",
|
||||
),
|
||||
"language.markdown.textMateGrammar": {
|
||||
".md": path.join(
|
||||
__dirname,
|
||||
"extensions",
|
||||
"markdown",
|
||||
"syntaxes",
|
||||
"markdown.tmLanguage.json",
|
||||
),
|
||||
".markdown": path.join(
|
||||
__dirname,
|
||||
"extensions",
|
||||
"markdown",
|
||||
"syntaxes",
|
||||
"markdown.tmLanguage.json",
|
||||
),
|
||||
".mkd": path.join(
|
||||
__dirname,
|
||||
"extensions",
|
||||
"markdown",
|
||||
"syntaxes",
|
||||
"markdown.tmLanguage.json",
|
||||
),
|
||||
".mdown": path.join(
|
||||
__dirname,
|
||||
"extensions",
|
||||
"markdown",
|
||||
"syntaxes",
|
||||
"markdown.tmLanguage.json",
|
||||
),
|
||||
},
|
||||
"language.java.textMateGrammar": {
|
||||
".java": path.join(__dirname, "extensions", "java", "syntaxes", "Java.tmLanguage.json"),
|
||||
".jar": path.join(__dirname, "extensions", "java", "syntaxes", "Java.tmLanguage.json"),
|
||||
|
|
|
@ -0,0 +1,444 @@
|
|||
{
|
||||
"information_for_contributors": [
|
||||
"This file has been converted from https://github.com/atom/language-clojure/blob/master/grammars/clojure.cson",
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version":
|
||||
"https://github.com/atom/language-clojure/commit/ecc790326bc8e14220e4d2d72a392a30876c3219",
|
||||
"name": "Clojure",
|
||||
"scopeName": "source.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#shebang-comment"
|
||||
},
|
||||
{
|
||||
"include": "#quoted-sexp"
|
||||
},
|
||||
{
|
||||
"include": "#sexp"
|
||||
},
|
||||
{
|
||||
"include": "#keyfn"
|
||||
},
|
||||
{
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"include": "#vector"
|
||||
},
|
||||
{
|
||||
"include": "#set"
|
||||
},
|
||||
{
|
||||
"include": "#map"
|
||||
},
|
||||
{
|
||||
"include": "#regexp"
|
||||
},
|
||||
{
|
||||
"include": "#var"
|
||||
},
|
||||
{
|
||||
"include": "#constants"
|
||||
},
|
||||
{
|
||||
"include": "#dynamic-variables"
|
||||
},
|
||||
{
|
||||
"include": "#metadata"
|
||||
},
|
||||
{
|
||||
"include": "#namespace-symbol"
|
||||
},
|
||||
{
|
||||
"include": "#symbol"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"comment": {
|
||||
"begin": "(?<!\\\\);",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.clojure"
|
||||
}
|
||||
},
|
||||
"end": "$",
|
||||
"name": "comment.line.semicolon.clojure"
|
||||
},
|
||||
"constants": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(nil)(?=(\\s|\\)|\\]|\\}))",
|
||||
"name": "constant.language.nil.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(true|false)",
|
||||
"name": "constant.language.boolean.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(-?\\d+/\\d+)",
|
||||
"name": "constant.numeric.ratio.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(-?\\d+[rR][0-9a-zA-Z]+)",
|
||||
"name": "constant.numeric.arbitrary-radix.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(-?0[xX][0-9a-fA-F]+)",
|
||||
"name": "constant.numeric.hexadecimal.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(-?0\\d+)",
|
||||
"name": "constant.numeric.octal.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(-?\\d+\\.\\d+([eE][+-]?\\d+)?M)",
|
||||
"name": "constant.numeric.bigdecimal.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(-?\\d+\\.\\d+([eE][+-]?\\d+)?)",
|
||||
"name": "constant.numeric.double.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(-?\\d+N)",
|
||||
"name": "constant.numeric.bigint.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(-?\\d+)",
|
||||
"name": "constant.numeric.long.clojure"
|
||||
},
|
||||
{
|
||||
"include": "#keyword"
|
||||
}
|
||||
]
|
||||
},
|
||||
"keyword": {
|
||||
"match":
|
||||
"(?<=(\\s|\\(|\\[|\\{)):[a-zA-Z0-9\\#\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}|\\,))",
|
||||
"name": "constant.keyword.clojure"
|
||||
},
|
||||
"keyfn": {
|
||||
"patterns": [
|
||||
{
|
||||
"match":
|
||||
"(?<=(\\s|\\(|\\[|\\{))(if(-[-a-z\\?]*)?|when(-[-a-z]*)?|for(-[-a-z]*)?|cond|do|let(-[-a-z\\?]*)?|binding|loop|recur|fn|throw[a-z\\-]*|try|catch|finally|([a-z]*case))(?=(\\s|\\)|\\]|\\}))",
|
||||
"name": "storage.control.clojure"
|
||||
},
|
||||
{
|
||||
"match":
|
||||
"(?<=(\\s|\\(|\\[|\\{))(declare-?|(in-)?ns|import|use|require|load|compile|(def[a-z\\-]*))(?=(\\s|\\)|\\]|\\}))",
|
||||
"name": "keyword.control.clojure"
|
||||
}
|
||||
]
|
||||
},
|
||||
"dynamic-variables": {
|
||||
"match": "\\*[\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\d]+\\*",
|
||||
"name": "meta.symbol.dynamic.clojure"
|
||||
},
|
||||
"map": {
|
||||
"begin": "(\\{)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.map.begin.clojure"
|
||||
}
|
||||
},
|
||||
"end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.map.end.trailing.clojure"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.section.map.end.clojure"
|
||||
}
|
||||
},
|
||||
"name": "meta.map.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
"metadata": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(\\^\\{)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.metadata.map.begin.clojure"
|
||||
}
|
||||
},
|
||||
"end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.metadata.map.end.trailing.clojure"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.section.metadata.map.end.clojure"
|
||||
}
|
||||
},
|
||||
"name": "meta.metadata.map.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(\\^)",
|
||||
"end": "(\\s)",
|
||||
"name": "meta.metadata.simple.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#keyword"
|
||||
},
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"quoted-sexp": {
|
||||
"begin": "(['``]\\()",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.expression.begin.clojure"
|
||||
}
|
||||
},
|
||||
"end": "(\\))$|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.expression.end.trailing.clojure"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.section.expression.end.trailing.clojure"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.section.expression.end.clojure"
|
||||
}
|
||||
},
|
||||
"name": "meta.quoted-expression.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp": {
|
||||
"begin": "#\"",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.regexp.begin.clojure"
|
||||
}
|
||||
},
|
||||
"end": "\"",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.regexp.end.clojure"
|
||||
}
|
||||
},
|
||||
"name": "string.regexp.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp_escaped_char"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp_escaped_char": {
|
||||
"match": "\\\\.",
|
||||
"name": "constant.character.escape.clojure"
|
||||
},
|
||||
"set": {
|
||||
"begin": "(\\#\\{)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.set.begin.clojure"
|
||||
}
|
||||
},
|
||||
"end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.set.end.trailing.clojure"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.section.set.end.clojure"
|
||||
}
|
||||
},
|
||||
"name": "meta.set.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sexp": {
|
||||
"begin": "(\\()",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.expression.begin.clojure"
|
||||
}
|
||||
},
|
||||
"end": "(\\))$|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.expression.end.trailing.clojure"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.section.expression.end.trailing.clojure"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.section.expression.end.clojure"
|
||||
}
|
||||
},
|
||||
"name": "meta.expression.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"begin":
|
||||
"(?<=\\()(ns|declare|def[\\w\\d._:+=><!?*-]*|[\\w._:+=><!?*-][\\w\\d._:+=><!?*-]*/def[\\w\\d._:+=><!?*-]*)\\s+",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.control.clojure"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\))",
|
||||
"name": "meta.definition.global.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#metadata"
|
||||
},
|
||||
{
|
||||
"include": "#dynamic-variables"
|
||||
},
|
||||
{
|
||||
"match":
|
||||
"([a-zA-Z\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)",
|
||||
"name": "entity.global.clojure"
|
||||
},
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#keyfn"
|
||||
},
|
||||
{
|
||||
"include": "#constants"
|
||||
},
|
||||
{
|
||||
"include": "#vector"
|
||||
},
|
||||
{
|
||||
"include": "#map"
|
||||
},
|
||||
{
|
||||
"include": "#set"
|
||||
},
|
||||
{
|
||||
"include": "#sexp"
|
||||
},
|
||||
{
|
||||
"match": "(?<=\\()(.+?)(?=\\s|\\))",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.name.function.clojure"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
"shebang-comment": {
|
||||
"begin": "^(#!)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.comment.shebang.clojure"
|
||||
}
|
||||
},
|
||||
"end": "$",
|
||||
"name": "comment.line.shebang.clojure"
|
||||
},
|
||||
"string": {
|
||||
"begin": "(?<!\\\\)(\")",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.string.begin.clojure"
|
||||
}
|
||||
},
|
||||
"end": "(\")",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.string.end.clojure"
|
||||
}
|
||||
},
|
||||
"name": "string.quoted.double.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\\\.",
|
||||
"name": "constant.character.escape.clojure"
|
||||
}
|
||||
]
|
||||
},
|
||||
"namespace-symbol": {
|
||||
"patterns": [
|
||||
{
|
||||
"match":
|
||||
"([a-zA-Z\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)/",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "meta.symbol.namespace.clojure"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"symbol": {
|
||||
"patterns": [
|
||||
{
|
||||
"match":
|
||||
"([a-zA-Z\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)",
|
||||
"name": "meta.symbol.clojure"
|
||||
}
|
||||
]
|
||||
},
|
||||
"var": {
|
||||
"match":
|
||||
"(?<=(\\s|\\(|\\[|\\{)\\#)'[a-zA-Z0-9\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}))",
|
||||
"name": "meta.var.clojure"
|
||||
},
|
||||
"vector": {
|
||||
"begin": "(\\[)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.vector.begin.clojure"
|
||||
}
|
||||
},
|
||||
"end": "(\\](?=[\\}\\]\\)\\s]*(?:;|$)))|(\\])",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.vector.end.trailing.clojure"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.section.vector.end.clojure"
|
||||
}
|
||||
},
|
||||
"name": "meta.vector.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,282 @@
|
|||
{
|
||||
"information_for_contributors": [
|
||||
"This file has been converted from https://github.com/textmate/lua.tmbundle/blob/master/Syntaxes/Lua.plist",
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version":
|
||||
"https://github.com/textmate/lua.tmbundle/commit/42da2c6ff5d86c068f72520f856190f413911a80",
|
||||
"name": "Lua",
|
||||
"scopeName": "source.lua",
|
||||
"comment": "Lua Syntax: version 0.8",
|
||||
"patterns": [
|
||||
{
|
||||
"begin":
|
||||
"\\b((local\\b)\\s+)?(function)\\s*(\\s+[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)*(:[a-zA-Z_][a-zA-Z0-9_]*)?\\s*)?(\\()",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.local.lua"
|
||||
},
|
||||
"3": {
|
||||
"name": "keyword.control.lua"
|
||||
},
|
||||
"4": {
|
||||
"name": "entity.name.function.lua"
|
||||
},
|
||||
"5": {
|
||||
"name": "punctuation.definition.parameters.begin.lua"
|
||||
}
|
||||
},
|
||||
"end": "\\)",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.parameters.end.lua"
|
||||
}
|
||||
},
|
||||
"name": "meta.function.lua",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "[a-zA-Z_][a-zA-Z0-9_]*",
|
||||
"name": "variable.parameter.function.lua"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": "(?<![\\w\\d.])0[xX][0-9A-Fa-f]+(?![pPeE.0-9])",
|
||||
"name": "constant.numeric.integer.hexadecimal.lua"
|
||||
},
|
||||
{
|
||||
"match":
|
||||
"(?<![\\w\\d.])0[xX][0-9A-Fa-f]+(\\.[0-9A-Fa-f]+)?([eE]-?\\d*)?([pP][-+]\\d+)?",
|
||||
"name": "constant.numeric.float.hexadecimal.lua"
|
||||
},
|
||||
{
|
||||
"match": "(?<![\\w\\d.])\\d+(?![pPeE.0-9])",
|
||||
"name": "constant.numeric.integer.lua"
|
||||
},
|
||||
{
|
||||
"match": "(?<![\\w\\d.])\\d+(\\.\\d+)?([eE]-?\\d*)?",
|
||||
"name": "constant.numeric.float.lua"
|
||||
},
|
||||
{
|
||||
"begin": "'",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.begin.lua"
|
||||
}
|
||||
},
|
||||
"end": "'",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.end.lua"
|
||||
}
|
||||
},
|
||||
"name": "string.quoted.single.lua",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#escaped_char"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "\"",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.begin.lua"
|
||||
}
|
||||
},
|
||||
"end": "\"",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.end.lua"
|
||||
}
|
||||
},
|
||||
"name": "string.quoted.double.lua",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#escaped_char"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=\\.cdef)\\s*(\\[(=*)\\[)",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "string.quoted.other.multiline.lua"
|
||||
},
|
||||
"1": {
|
||||
"name": "punctuation.definition.string.begin.lua"
|
||||
}
|
||||
},
|
||||
"contentName": "meta.embedded.lua",
|
||||
"end": "(\\]\\2\\])",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "string.quoted.other.multiline.lua"
|
||||
},
|
||||
"1": {
|
||||
"name": "punctuation.definition.string.end.lua"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.c"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<!--)\\[(=*)\\[",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.begin.lua"
|
||||
}
|
||||
},
|
||||
"end": "\\]\\1\\]",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.end.lua"
|
||||
}
|
||||
},
|
||||
"name": "string.quoted.other.multiline.lua"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.comment.lua"
|
||||
}
|
||||
},
|
||||
"match": "\\A(#!).*$\\n?",
|
||||
"name": "comment.line.shebang.lua"
|
||||
},
|
||||
{
|
||||
"begin": "(^[ \\t]+)?(?=--)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.whitespace.comment.leading.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?!\\G)((?!^)[ \\t]+\\n)?",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.whitespace.comment.trailing.lua"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "--\\[(=*)\\[",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.begin.lua"
|
||||
}
|
||||
},
|
||||
"end": "\\]\\1\\]",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.end.lua"
|
||||
}
|
||||
},
|
||||
"name": "comment.block.lua"
|
||||
},
|
||||
{
|
||||
"begin": "--",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.lua"
|
||||
}
|
||||
},
|
||||
"end": "\\n",
|
||||
"name": "comment.line.double-dash.lua"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.control.goto.lua"
|
||||
},
|
||||
"2": {
|
||||
"name": "constant.other.placeholder.lua"
|
||||
}
|
||||
},
|
||||
"match": "\\b(goto)\\s+([a-zA-Z_][a-zA-Z0-9_]*)"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.label.begin.lua"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.label.end.lua"
|
||||
}
|
||||
},
|
||||
"match": "(::)[a-zA-Z_][a-zA-Z0-9_]*(::)",
|
||||
"name": "constant.other.placeholder.lua"
|
||||
},
|
||||
{
|
||||
"match":
|
||||
"\\b(break|do|else|for|if|elseif|goto|return|then|repeat|while|until|end|function|local|in)\\b",
|
||||
"name": "keyword.control.lua"
|
||||
},
|
||||
{
|
||||
"match":
|
||||
"(?<![^.]\\.|:)\\b(false|nil|true|_G|_VERSION|math\\.(pi|huge))\\b|(?<![.])\\.{3}(?!\\.)",
|
||||
"name": "constant.language.lua"
|
||||
},
|
||||
{
|
||||
"match": "(?<![^.]\\.|:)\\b(self)\\b",
|
||||
"name": "variable.language.self.lua"
|
||||
},
|
||||
{
|
||||
"match":
|
||||
"(?<![^.]\\.|:)\\b(assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|loadfile|loadstring|module|next|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\\b(?=\\s*(?:[({\"']|\\[\\[))",
|
||||
"name": "support.function.lua"
|
||||
},
|
||||
{
|
||||
"match":
|
||||
"(?<![^.]\\.|:)\\b(coroutine\\.(create|resume|running|status|wrap|yield)|string\\.(byte|char|dump|find|format|gmatch|gsub|len|lower|match|rep|reverse|sub|upper)|table\\.(concat|insert|maxn|remove|sort)|math\\.(abs|acos|asin|atan2?|ceil|cosh?|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pow|rad|random|randomseed|sinh?|sqrt|tanh?)|io\\.(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)|os\\.(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\\.(cpath|loaded|loadlib|path|preload|seeall)|debug\\.(debug|[gs]etfenv|[gs]ethook|getinfo|[gs]etlocal|[gs]etmetatable|getregistry|[gs]etupvalue|traceback))\\b(?=\\s*(?:[({\"']|\\[\\[))",
|
||||
"name": "support.function.library.lua"
|
||||
},
|
||||
{
|
||||
"match": "\\b(and|or|not)\\b",
|
||||
"name": "keyword.operator.lua"
|
||||
},
|
||||
{
|
||||
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?=\\s*(?:[({\"']|\\[\\[))",
|
||||
"name": "support.function.any-method.lua"
|
||||
},
|
||||
{
|
||||
"match": "(?<=[^.]\\.|:)\\b([a-zA-Z_][a-zA-Z0-9_]*)",
|
||||
"name": "variable.other.lua"
|
||||
},
|
||||
{
|
||||
"match": "\\+|-|%|#|\\*|\\/|\\^|==?|~=|<=?|>=?|(?<!\\.)\\.{2}(?!\\.)",
|
||||
"name": "keyword.operator.lua"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"escaped_char": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\\\[abfnrtvz\\\\\"'\\n]",
|
||||
"name": "constant.character.escape.lua"
|
||||
},
|
||||
{
|
||||
"match": "\\\\\\d{1,3}",
|
||||
"name": "constant.character.escape.byte.lua"
|
||||
},
|
||||
{
|
||||
"match": "\\\\x[0-9A-Fa-f][0-9A-Fa-f]",
|
||||
"name": "constant.character.escape.byte.lua"
|
||||
},
|
||||
{
|
||||
"match": "\\\\u\\{[0-9A-Fa-f]+\\}",
|
||||
"name": "constant.character.escape.unicode.lua"
|
||||
},
|
||||
{
|
||||
"match": "\\\\.",
|
||||
"name": "invalid.illegal.character.escape.lua"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"information_for_contributors": [
|
||||
"This file has been converted from https://github.com/atom/language-objective-c/blob/master/grammars/objective-c%2B%2B.cson",
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version":
|
||||
"https://github.com/atom/language-objective-c/commit/7fdf0c40ec1d592a902ed6a7cf5565bdf12e2ae8",
|
||||
"name": "Objective-C++",
|
||||
"scopeName": "source.objcpp",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.cpp"
|
||||
},
|
||||
{
|
||||
"include": "source.objc"
|
||||
}
|
||||
]
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,89 @@
|
|||
{
|
||||
"information_for_contributors": [
|
||||
"This file has been converted from https://github.com/atom/language-php/blob/master/grammars/html.cson",
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version":
|
||||
"https://github.com/atom/language-php/commit/29c140e1531e0b5e842e5bfd4377f879d8b79cd4",
|
||||
"name": "PHP",
|
||||
"scopeName": "text.html.php",
|
||||
"injections": {
|
||||
"text.html.php - (meta.embedded | meta.tag), L:text.html.php meta.tag, L:text.html.php source.js": {
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#php-tag"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\A#!",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.php"
|
||||
}
|
||||
},
|
||||
"end": "$",
|
||||
"name": "comment.line.shebang.php"
|
||||
},
|
||||
{
|
||||
"include": "text.html.basic"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"php-tag": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "<\\?(?i:php|=)?(?![^?]*\\?>)",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.embedded.begin.php"
|
||||
}
|
||||
},
|
||||
"end": "(\\?)>",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.embedded.end.php"
|
||||
},
|
||||
"1": {
|
||||
"name": "source.php"
|
||||
}
|
||||
},
|
||||
"name": "meta.embedded.block.php",
|
||||
"contentName": "source.php",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.php"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "<\\?(?i:php|=)?",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.embedded.begin.php"
|
||||
}
|
||||
},
|
||||
"end": "(\\?)>",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.embedded.end.php"
|
||||
},
|
||||
"1": {
|
||||
"name": "source.php"
|
||||
}
|
||||
},
|
||||
"name": "meta.embedded.line.php",
|
||||
"contentName": "source.php",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.php"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,662 @@
|
|||
{
|
||||
"information_for_contributors": [
|
||||
"This file has been converted from https://github.com/zargony/atom-language-rust/blob/master/grammars/rust.cson",
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version":
|
||||
"https://github.com/zargony/atom-language-rust/commit/179f449a69182cae4fcdf644d59d842b7e445f89",
|
||||
"name": "Rust",
|
||||
"scopeName": "source.rust",
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "Implementation",
|
||||
"begin": "\\b(impl)\\b",
|
||||
"end": "\\{",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.type.rust"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#block_comment"
|
||||
},
|
||||
{
|
||||
"include": "#line_comment"
|
||||
},
|
||||
{
|
||||
"include": "#sigils"
|
||||
},
|
||||
{
|
||||
"include": "#mut"
|
||||
},
|
||||
{
|
||||
"include": "#ref_lifetime"
|
||||
},
|
||||
{
|
||||
"include": "#core_types"
|
||||
},
|
||||
{
|
||||
"include": "#core_marker"
|
||||
},
|
||||
{
|
||||
"include": "#core_traits"
|
||||
},
|
||||
{
|
||||
"include": "#std_types"
|
||||
},
|
||||
{
|
||||
"include": "#std_traits"
|
||||
},
|
||||
{
|
||||
"include": "#type_params"
|
||||
},
|
||||
{
|
||||
"include": "#where"
|
||||
},
|
||||
{
|
||||
"name": "storage.type.rust",
|
||||
"match": "\\bfor\\b"
|
||||
},
|
||||
{
|
||||
"include": "#type"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#block_doc_comment"
|
||||
},
|
||||
{
|
||||
"include": "#block_comment"
|
||||
},
|
||||
{
|
||||
"include": "#line_doc_comment"
|
||||
},
|
||||
{
|
||||
"include": "#line_comment"
|
||||
},
|
||||
{
|
||||
"comment": "Attribute",
|
||||
"name": "meta.attribute.rust",
|
||||
"begin": "#\\!?\\[",
|
||||
"end": "\\]",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#string_literal"
|
||||
},
|
||||
{
|
||||
"include": "#block_doc_comment"
|
||||
},
|
||||
{
|
||||
"include": "#block_comment"
|
||||
},
|
||||
{
|
||||
"include": "#line_doc_comment"
|
||||
},
|
||||
{
|
||||
"include": "#line_comment"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "Single-quote string literal (character)",
|
||||
"name": "string.quoted.single.rust",
|
||||
"match":
|
||||
"b?'([^'\\\\]|\\\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.))'"
|
||||
},
|
||||
{
|
||||
"include": "#string_literal"
|
||||
},
|
||||
{
|
||||
"include": "#raw_string_literal"
|
||||
},
|
||||
{
|
||||
"comment": "Floating point literal (fraction)",
|
||||
"name": "constant.numeric.float.rust",
|
||||
"match": "\\b[0-9][0-9_]*\\.[0-9][0-9_]*([eE][+-]?[0-9_]+)?(f32|f64)?\\b"
|
||||
},
|
||||
{
|
||||
"comment": "Floating point literal (exponent)",
|
||||
"name": "constant.numeric.float.rust",
|
||||
"match": "\\b[0-9][0-9_]*(\\.[0-9][0-9_]*)?[eE][+-]?[0-9_]+(f32|f64)?\\b"
|
||||
},
|
||||
{
|
||||
"comment": "Floating point literal (typed)",
|
||||
"name": "constant.numeric.float.rust",
|
||||
"match": "\\b[0-9][0-9_]*(\\.[0-9][0-9_]*)?([eE][+-]?[0-9_]+)?(f32|f64)\\b"
|
||||
},
|
||||
{
|
||||
"comment": "Integer literal (decimal)",
|
||||
"name": "constant.numeric.integer.decimal.rust",
|
||||
"match": "\\b[0-9][0-9_]*([ui](8|16|32|64|128|s|size))?\\b"
|
||||
},
|
||||
{
|
||||
"comment": "Integer literal (hexadecimal)",
|
||||
"name": "constant.numeric.integer.hexadecimal.rust",
|
||||
"match": "\\b0x[a-fA-F0-9_]+([ui](8|16|32|64|128|s|size))?\\b"
|
||||
},
|
||||
{
|
||||
"comment": "Integer literal (octal)",
|
||||
"name": "constant.numeric.integer.octal.rust",
|
||||
"match": "\\b0o[0-7_]+([ui](8|16|32|64|128|s|size))?\\b"
|
||||
},
|
||||
{
|
||||
"comment": "Integer literal (binary)",
|
||||
"name": "constant.numeric.integer.binary.rust",
|
||||
"match": "\\b0b[01_]+([ui](8|16|32|64|128|s|size))?\\b"
|
||||
},
|
||||
{
|
||||
"comment": "Static storage modifier",
|
||||
"name": "storage.modifier.static.rust",
|
||||
"match": "\\bstatic\\b"
|
||||
},
|
||||
{
|
||||
"comment": "Boolean constant",
|
||||
"name": "constant.language.boolean.rust",
|
||||
"match": "\\b(true|false)\\b"
|
||||
},
|
||||
{
|
||||
"comment": "Control keyword",
|
||||
"name": "keyword.control.rust",
|
||||
"match": "\\b(break|continue|else|if|in|for|loop|match|return|while)\\b"
|
||||
},
|
||||
{
|
||||
"comment": "Keyword",
|
||||
"name": "keyword.other.rust",
|
||||
"match": "\\b(crate|extern|mod|let|ref|use|super|move)\\b"
|
||||
},
|
||||
{
|
||||
"comment": "Reserved keyword",
|
||||
"name": "invalid.deprecated.rust",
|
||||
"match":
|
||||
"\\b(abstract|alignof|become|do|final|macro|offsetof|override|priv|proc|pure|sizeof|typeof|virtual|yield)\\b"
|
||||
},
|
||||
{
|
||||
"include": "#unsafe"
|
||||
},
|
||||
{
|
||||
"include": "#sigils"
|
||||
},
|
||||
{
|
||||
"include": "#self"
|
||||
},
|
||||
{
|
||||
"include": "#mut"
|
||||
},
|
||||
{
|
||||
"include": "#box"
|
||||
},
|
||||
{
|
||||
"include": "#lifetime"
|
||||
},
|
||||
{
|
||||
"include": "#ref_lifetime"
|
||||
},
|
||||
{
|
||||
"include": "#const"
|
||||
},
|
||||
{
|
||||
"include": "#pub"
|
||||
},
|
||||
{
|
||||
"comment": "Miscellaneous operator",
|
||||
"name": "keyword.operator.misc.rust",
|
||||
"match": "(=>|::|\\bas\\b)"
|
||||
},
|
||||
{
|
||||
"comment": "Comparison operator",
|
||||
"name": "keyword.operator.comparison.rust",
|
||||
"match": "(&&|\\|\\||==|!=)"
|
||||
},
|
||||
{
|
||||
"comment": "Assignment operator",
|
||||
"name": "keyword.operator.assignment.rust",
|
||||
"match": "(\\+=|-=|/=|\\*=|%=|\\^=|&=|\\|=|<<=|>>=|=)"
|
||||
},
|
||||
{
|
||||
"comment": "Arithmetic operator",
|
||||
"name": "keyword.operator.arithmetic.rust",
|
||||
"match": "(!|\\+|-|/|\\*|%|\\^|&|\\||<<|>>)"
|
||||
},
|
||||
{
|
||||
"comment": "Comparison operator (second group because of regex precedence)",
|
||||
"name": "keyword.operator.comparison.rust",
|
||||
"match": "(<=|>=|<|>)"
|
||||
},
|
||||
{
|
||||
"include": "#core_types"
|
||||
},
|
||||
{
|
||||
"include": "#core_vars"
|
||||
},
|
||||
{
|
||||
"include": "#core_marker"
|
||||
},
|
||||
{
|
||||
"include": "#core_traits"
|
||||
},
|
||||
{
|
||||
"include": "#std_types"
|
||||
},
|
||||
{
|
||||
"include": "#std_traits"
|
||||
},
|
||||
{
|
||||
"comment": "Built-in macro",
|
||||
"name": "support.function.builtin.rust",
|
||||
"match":
|
||||
"\\b(macro_rules|compile_error|format_args|env|option_env|concat_idents|concat|line|column|file|stringify|include|include_str|include_bytes|module_path|cfg)!"
|
||||
},
|
||||
{
|
||||
"comment": "Core macro",
|
||||
"name": "support.function.core.rust",
|
||||
"match":
|
||||
"\\b(panic|assert|assert_eq|assert_ne|debug_assert|debug_assert_eq|debug_assert_ne|try|write|writeln|unreachable|unimplemented)!"
|
||||
},
|
||||
{
|
||||
"comment": "Standard library macro",
|
||||
"name": "support.function.std.rust",
|
||||
"match": "\\b(format|print|println|eprint|eprintln|select|vec)!"
|
||||
},
|
||||
{
|
||||
"comment": "Logging macro",
|
||||
"name": "support.function.log.rust",
|
||||
"match": "\\b(log|error|warn|info|debug|trace|log_enabled)!"
|
||||
},
|
||||
{
|
||||
"comment": "Invokation of a macro",
|
||||
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*\\!)\\s*[({\\[]",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.name.function.macro.rust"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Function call",
|
||||
"match": "\\b([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_]+)\\s*\\(",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.name.function.rust"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Function call with type parameters",
|
||||
"begin": "\\b([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_]+)\\s*(::)(?=\\s*<.*>\\s*\\()",
|
||||
"end": "\\(",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.name.function.rust"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.operator.misc.rust"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#type_params"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "Function definition",
|
||||
"begin": "\\b(fn)\\s+([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_]+)",
|
||||
"end": "[\\{;]",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.other.fn.rust"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.function.rust"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#block_comment"
|
||||
},
|
||||
{
|
||||
"include": "#line_comment"
|
||||
},
|
||||
{
|
||||
"include": "#sigils"
|
||||
},
|
||||
{
|
||||
"include": "#self"
|
||||
},
|
||||
{
|
||||
"include": "#mut"
|
||||
},
|
||||
{
|
||||
"include": "#ref_lifetime"
|
||||
},
|
||||
{
|
||||
"include": "#core_types"
|
||||
},
|
||||
{
|
||||
"include": "#core_marker"
|
||||
},
|
||||
{
|
||||
"include": "#core_traits"
|
||||
},
|
||||
{
|
||||
"include": "#std_types"
|
||||
},
|
||||
{
|
||||
"include": "#std_traits"
|
||||
},
|
||||
{
|
||||
"include": "#type_params"
|
||||
},
|
||||
{
|
||||
"include": "#const"
|
||||
},
|
||||
{
|
||||
"include": "#where"
|
||||
},
|
||||
{
|
||||
"include": "#unsafe"
|
||||
},
|
||||
{
|
||||
"comment": "Function arguments",
|
||||
"match": "\bfn\b",
|
||||
"name": "keyword.other.fn.rust"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "Type declaration",
|
||||
"begin": "\\b(enum|struct|trait|union)\\s+([a-zA-Z_][a-zA-Z0-9_]*)",
|
||||
"end": "[\\{\\(;]",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.type.rust"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.type.rust"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#block_comment"
|
||||
},
|
||||
{
|
||||
"include": "#line_comment"
|
||||
},
|
||||
{
|
||||
"include": "#core_traits"
|
||||
},
|
||||
{
|
||||
"include": "#std_traits"
|
||||
},
|
||||
{
|
||||
"include": "#type_params"
|
||||
},
|
||||
{
|
||||
"include": "#core_types"
|
||||
},
|
||||
{
|
||||
"include": "#pub"
|
||||
},
|
||||
{
|
||||
"include": "#where"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "Type alias",
|
||||
"begin": "\\b(type)\\s+([a-zA-Z_][a-zA-Z0-9_]*)",
|
||||
"end": ";",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.type.rust"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.type.rust"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#block_comment"
|
||||
},
|
||||
{
|
||||
"include": "#line_comment"
|
||||
},
|
||||
{
|
||||
"include": "#sigils"
|
||||
},
|
||||
{
|
||||
"include": "#mut"
|
||||
},
|
||||
{
|
||||
"include": "#lifetime"
|
||||
},
|
||||
{
|
||||
"include": "#ref_lifetime"
|
||||
},
|
||||
{
|
||||
"include": "#core_types"
|
||||
},
|
||||
{
|
||||
"include": "#core_marker"
|
||||
},
|
||||
{
|
||||
"include": "#core_traits"
|
||||
},
|
||||
{
|
||||
"include": "#std_types"
|
||||
},
|
||||
{
|
||||
"include": "#std_traits"
|
||||
},
|
||||
{
|
||||
"include": "#type_params"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"block_doc_comment": {
|
||||
"comment": "Block documentation comment",
|
||||
"name": "comment.block.documentation.rust",
|
||||
"begin": "/\\*[\\*!](?![\\*/])",
|
||||
"end": "\\*/",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#block_doc_comment"
|
||||
},
|
||||
{
|
||||
"include": "#block_comment"
|
||||
}
|
||||
]
|
||||
},
|
||||
"block_comment": {
|
||||
"comment": "Block comment",
|
||||
"name": "comment.block.rust",
|
||||
"begin": "/\\*",
|
||||
"end": "\\*/",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#block_doc_comment"
|
||||
},
|
||||
{
|
||||
"include": "#block_comment"
|
||||
}
|
||||
]
|
||||
},
|
||||
"line_doc_comment": {
|
||||
"comment": "Single-line documentation comment",
|
||||
"name": "comment.line.documentation.rust",
|
||||
"begin": "//[!/](?=[^/])",
|
||||
"end": "$"
|
||||
},
|
||||
"line_comment": {
|
||||
"comment": "Single-line comment",
|
||||
"name": "comment.line.double-slash.rust",
|
||||
"begin": "//",
|
||||
"end": "$"
|
||||
},
|
||||
"escaped_character": {
|
||||
"name": "constant.character.escape.rust",
|
||||
"match": "\\\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)"
|
||||
},
|
||||
"string_literal": {
|
||||
"comment": "Double-quote string literal",
|
||||
"name": "string.quoted.double.rust",
|
||||
"begin": "b?\"",
|
||||
"end": "\"",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#escaped_character"
|
||||
}
|
||||
]
|
||||
},
|
||||
"raw_string_literal": {
|
||||
"comment": "Raw double-quote string literal",
|
||||
"name": "string.quoted.double.raw.rust",
|
||||
"begin": "b?r(#*)\"",
|
||||
"end": "\"\\1"
|
||||
},
|
||||
"sigils": {
|
||||
"comment": "Sigil",
|
||||
"name": "keyword.operator.sigil.rust",
|
||||
"match": "[&*](?=[a-zA-Z0-9_\\(\\[\\|\\\"]+)"
|
||||
},
|
||||
"self": {
|
||||
"comment": "Self variable",
|
||||
"name": "variable.language.rust",
|
||||
"match": "\\bself\\b"
|
||||
},
|
||||
"mut": {
|
||||
"comment": "Mutable storage modifier",
|
||||
"name": "storage.modifier.mut.rust",
|
||||
"match": "\\bmut\\b"
|
||||
},
|
||||
"box": {
|
||||
"comment": "Box storage modifier",
|
||||
"name": "storage.modifier.box.rust",
|
||||
"match": "\\bbox\\b"
|
||||
},
|
||||
"const": {
|
||||
"comment": "Const storage modifier",
|
||||
"name": "storage.modifier.const.rust",
|
||||
"match": "\\bconst\\b"
|
||||
},
|
||||
"pub": {
|
||||
"comment": "Visibility modifier",
|
||||
"name": "storage.modifier.visibility.rust",
|
||||
"match": "\\bpub\\b"
|
||||
},
|
||||
"unsafe": {
|
||||
"comment": "Unsafe code keyword",
|
||||
"name": "keyword.other.unsafe.rust",
|
||||
"match": "\\bunsafe\\b"
|
||||
},
|
||||
"where": {
|
||||
"comment": "Generic where clause",
|
||||
"name": "keyword.other.where.rust",
|
||||
"match": "\\bwhere\\b"
|
||||
},
|
||||
"lifetime": {
|
||||
"comment": "Named lifetime",
|
||||
"name": "storage.modifier.lifetime.rust",
|
||||
"match": "'([a-zA-Z_][a-zA-Z0-9_]*)\\b",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.name.lifetime.rust"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ref_lifetime": {
|
||||
"comment": "Reference with named lifetime",
|
||||
"match": "&('([a-zA-Z_][a-zA-Z0-9_]*))\\b",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.lifetime.rust"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.lifetime.rust"
|
||||
}
|
||||
}
|
||||
},
|
||||
"core_types": {
|
||||
"comment": "Built-in/core type",
|
||||
"name": "storage.type.core.rust",
|
||||
"match":
|
||||
"\\b(bool|char|usize|isize|u8|u16|u32|u64|u128|i8|i16|i32|i64|i128|f32|f64|str|Self|Option|Result)\\b"
|
||||
},
|
||||
"core_vars": {
|
||||
"comment": "Core type variant",
|
||||
"name": "support.constant.core.rust",
|
||||
"match": "\\b(Some|None|Ok|Err)\\b"
|
||||
},
|
||||
"core_marker": {
|
||||
"comment": "Core trait (marker)",
|
||||
"name": "support.type.marker.rust",
|
||||
"match": "\\b(Copy|Send|Sized|Sync)\\b"
|
||||
},
|
||||
"core_traits": {
|
||||
"comment": "Core trait",
|
||||
"name": "support.type.core.rust",
|
||||
"match":
|
||||
"\\b(Drop|Fn|FnMut|FnOnce|Clone|PartialEq|PartialOrd|Eq|Ord|AsRef|AsMut|Into|From|Default|Iterator|Extend|IntoIterator|DoubleEndedIterator|ExactSizeIterator)\\b"
|
||||
},
|
||||
"std_types": {
|
||||
"comment": "Standard library type",
|
||||
"name": "storage.class.std.rust",
|
||||
"match": "\\b(Box|String|Vec|Path|PathBuf)\\b"
|
||||
},
|
||||
"std_traits": {
|
||||
"comment": "Standard library trait",
|
||||
"name": "support.type.std.rust",
|
||||
"match": "\\b(ToOwned|ToString)\\b"
|
||||
},
|
||||
"type": {
|
||||
"comment": "A type",
|
||||
"name": "entity.name.type.rust",
|
||||
"match": "\\b([A-Za-z][_A-Za-z0-9]*|_[_A-Za-z0-9]+)\\b"
|
||||
},
|
||||
"type_params": {
|
||||
"comment": "Type parameters",
|
||||
"name": "meta.type_params.rust",
|
||||
"begin": "<(?![=<])",
|
||||
"end": "(?<![-])>",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#block_comment"
|
||||
},
|
||||
{
|
||||
"include": "#line_comment"
|
||||
},
|
||||
{
|
||||
"include": "#sigils"
|
||||
},
|
||||
{
|
||||
"include": "#mut"
|
||||
},
|
||||
{
|
||||
"include": "#lifetime"
|
||||
},
|
||||
{
|
||||
"include": "#core_types"
|
||||
},
|
||||
{
|
||||
"include": "#core_marker"
|
||||
},
|
||||
{
|
||||
"include": "#core_traits"
|
||||
},
|
||||
{
|
||||
"include": "#std_types"
|
||||
},
|
||||
{
|
||||
"include": "#std_traits"
|
||||
},
|
||||
{
|
||||
"include": "#type_params"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,229 @@
|
|||
{
|
||||
"information_for_contributors": [
|
||||
"This file has been converted from https://github.com/freebroccolo/atom-language-swift/blob/master/grammars/swift.cson",
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version":
|
||||
"https://github.com/freebroccolo/atom-language-swift/commit/fb7c93e0174dea69c8685c00deeb53d480d1d202",
|
||||
"name": "Swift",
|
||||
"scopeName": "source.swift",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "keyword.others.swift",
|
||||
"match":
|
||||
"^\\s*(#if|#else|#endif|#elseif|@warn_unused_result|@discardableResult|@IBAction|@IBOutlet|@IBDesignable|@IBInspectable)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.declaration.swift",
|
||||
"match": "\\b(deinit|import|init|subscript)\\b"
|
||||
},
|
||||
{
|
||||
"name": "storage.type.swift",
|
||||
"match":
|
||||
"\\b(precedencegroup|class|struct|enum|extension|protocol|let|var|typealias)\\b"
|
||||
},
|
||||
{
|
||||
"name": "storage.modifier.swift",
|
||||
"match":
|
||||
"\\b(final|internal|private|fileprivate|public|open|static|required|convenience)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.statement.swift",
|
||||
"match":
|
||||
"\\b(try|catch|repeat|break|case|continue|default|do|else|fallthrough|if|in|for|return|switch|where|while|guard|defer)\\b"
|
||||
},
|
||||
{
|
||||
"name": "support.type.swift",
|
||||
"match":
|
||||
"(?x) \\b(Character|U?Int|U?Int(8|16|32|64) |Float|Double|Float(32|64)|Bool|String|Date|Data|URL |(double|float)[234]|(double|float)[234]x[234] |Any |AnyObject |Error |Equatable |Hashable |Comparable |CustomDebugStringConvertible |CustomStringConvertible |OptionSet |ManagedBuffer |ManagedBufferPointer |BitwiseOperations |CountedSet |Counter |Directions |ExpressibleByArrayLiteral |ExpressibleByBooleanLiteral |ExpressibleByDictionaryLiteral |ExpressibleByExtendedGraphemeClusterLiteral |ExpressibleByFloatLitera |ExpressibleByIntegerLiteral |ExpressibleByNilLiteral |ExpressibleByStringInterpolation |ExpressibleByStringLiteral |ExpressibleByUnicodeScalarLiteral |OrderedSet |PaperSize |RawRepresentable |(UI|NS|CF|CG)[A-Z][a-zA-Z0-9]+ |Stream |(In|Out)putStream |FileManager |Array |Unsafe[a-zA-Z]*Pointer |Bundle |Jex)\\b"
|
||||
},
|
||||
{
|
||||
"name": "support.function.swift",
|
||||
"match": "\\b(assert|assertionFailure|print)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.expressions-and-types.swift",
|
||||
"match":
|
||||
"\\b(as|dynamicType|is|new|super|self|Self|Type|#column|#file|#function|#line)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.reserved.swift",
|
||||
"match":
|
||||
"\\b(associativity|didSet|get|infix|inout|left|mutating|nonmutating|operator|override|postfix|precedence|prefix|right|set|unowned|unowned(safe)|unowned(unsafe)|weak|willSet)\\b"
|
||||
},
|
||||
{
|
||||
"name": "constant.language.swift",
|
||||
"match": "\\b(true|false|nil|none)\\b"
|
||||
},
|
||||
{
|
||||
"name": "entity.name.function.swift",
|
||||
"match": "\\bfunc\\s+([^\\t\\n\\x20\\x28]+)"
|
||||
},
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#literal"
|
||||
},
|
||||
{
|
||||
"include": "#operator"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"comment": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "comment.block.swift",
|
||||
"begin": "/\\*",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.begin.swift"
|
||||
}
|
||||
},
|
||||
"end": "\\*/",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.end.swift"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(^[ \\t]+)?(?=//)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.whitespace.comment.leading.swift"
|
||||
}
|
||||
},
|
||||
"end": "(?!\\G)",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "comment.line.double-slash.swift",
|
||||
"begin": "//",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.swift"
|
||||
}
|
||||
},
|
||||
"end": "\\n",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "punctuation.separator.continuation.swift",
|
||||
"match": "(?>\\\\\\s*\\n)"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"escaped-char": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "constant.character.escape.swift",
|
||||
"match": "\\\\[0\\\\tnr\"']"
|
||||
},
|
||||
{
|
||||
"name": "constant.character.escape.swift",
|
||||
"match": "\\\\(x\\h{2}|u\\h{4}|U\\h{8})"
|
||||
},
|
||||
{
|
||||
"name": "invalid.illegal.constant.character.escape.swift",
|
||||
"match": "\\\\[^uxU]"
|
||||
}
|
||||
]
|
||||
},
|
||||
"identifier": {
|
||||
"match":
|
||||
"(?x) (?<identifier> \\g<identifier-head> \\g<identifier-characters>? | ` \\g<identifier-head> \\g<identifier-characters>? ` ){0} (?<identifier-head> [ a-z A-Z ] | [ \\u00A8 \\u00AA \\u00AD \\u00AF \\u00B2-\\u00B5 \\u00B7-\\u00BA ] | [ \\u00BC-\\u00BE \\u00C0-\\u00D6 \\u00D8-\\u00F6 \\u00F8-\\u00FF ] | [ \\u0100-\\u02FF \\u0370-\\u167F \\u1681-\\u180D \\u180F-\\u1DBF ] | [ \\u1E00-\\u1FFF ] | [ \\u200B-\\u200D \\u202A-\\u202E \\u203F-\\u2040 \\u2054 \\u2060-\\u206F ] | [ \\u2070-\\u20CF \\u2100-\\u218F \\u2460-\\u24FF \\u2776-\\u2793 ] | [ \\u2C00-\\u2DFF \\u2E80-\\u2FFF ] | [ \\u3004-\\u3007 \\u3021-\\u302F \\u3031-\\u303F \\u3040-\\uD7FF ] | [ \\uF900-\\uFD3D \\uFD40-\\uFDCF \\uFDF0-\\uFE1F \\uFE30-\\uFE44 ] | [ \\uFE47-\\uFFFD ] | [ \\u10000-\\u1FFFD \\u20000-\\u2FFFD \\u30000-\\u3FFFD \\u40000-\\u4FFFD ] | [ \\u50000-\\u5FFFD \\u60000-\\u6FFFD \\u70000-\\u7FFFD \\u80000-\\u8FFFD ] | [ \\u90000-\\u9FFFD \\uA0000-\\uAFFFD \\uB0000-\\uBFFFD \\uC0000-\\uCFFFD ] | [ \\uD0000-\\uDFFFD \\uE0000-\\uEFFFD ] ){0} (?<identifier-character> \\d | [ \\u0300-\\u036F \\u1DC0-\\u1DFF \\u20D0-\\u20FF \\uFE20-\\uFE2F ] | \\g<identifier-head> ){0} (?<identifier-characters> \\g<identifier-character> \\g<identifier-characters>? ){0} (?<implicit-parameter-name> (?<!\\g<identifier-head>) \\$ \\d+ (?!\\g<identifier-head>) (?# FIXME) ){0} \\g<identifier> | \\g<implicit-parameter-name>",
|
||||
"captures": {
|
||||
"5": {
|
||||
"name": "variable.other.positional.swift"
|
||||
}
|
||||
}
|
||||
},
|
||||
"literal": {
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#literal-number"
|
||||
},
|
||||
{
|
||||
"include": "#literal-string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"literal-number": {
|
||||
"name": "constant.numeric.swift",
|
||||
"match":
|
||||
"(?x) (?### INTEGER ###) (?<integer-literal> \\g<binary-literal> | \\g<octal-literal> | \\g<hexadecimal-literal> | \\g<decimal-literal> ){0} (?### BINARY ###) (?<binary-literal> \\b 0b \\g<binary-digit> \\g<binary-literal-characters>? \\b ){0} (?<binary-digit> [0-1] ){0} (?<binary-literal-character> \\g<binary-digit> | _ ){0} (?<binary-literal-characters> \\g<binary-literal-character> \\g<binary-literal-characters>? ){0} (?### OCTAL ###) (?<octal-literal> \\b 0o \\g<octal-digit> \\g<octal-literal-characters>? \\b ){0} (?<octal-digit> [0-7] ){0} (?<octal-literal-character> \\g<octal-digit> | _ ){0} (?<octal-literal-characters> \\g<octal-literal-character> \\g<octal-literal-characters>? ){0} (?### DECIMAL ###) (?<decimal-literal> \\b \\g<decimal-digit> \\g<decimal-literal-characters>? \\b ){0} (?<decimal-digit> \\d ){0} (?<decimal-literal-character> \\g<decimal-digit> | _ ){0} (?<decimal-literal-characters> \\g<decimal-literal-character> \\g<decimal-literal-characters>? ){0} (?### HEXADECIMAL ###) (?<hexadecimal-literal> \\b 0x \\g<hexadecimal-digit> \\g<hexadecimal-literal-characters>? \\b ){0} (?<hexadecimal-digit> \\h ){0} (?<hexadecimal-literal-character> \\g<hexadecimal-digit> | _ ){0} (?<hexadecimal-literal-characters> \\g<hexadecimal-literal-character> \\g<hexadecimal-literal-characters>? ){0} (?### FLOATING POINT ###) (?<floating-point-literal> \\b \\g<decimal-literal> \\g<decimal-fraction>? \\g<decimal-exponent>? \\b | \\b \\g<hexadecimal-literal> \\g<hexadecimal-fraction>? \\g<hexadecimal-exponent> \\b ){0} (?<decimal-fraction> \\. \\g<decimal-literal> ){0} (?<decimal-exponent> \\g<floating-point-e> \\g<sign>? \\g<decimal-literal> ){0} (?<hexadecimal-fraction> \\. \\g<hexadecimal-literal>? ){0} (?<hexadecimal-exponent> \\g<floating-point-p> \\g<sign>? \\g<hexadecimal-literal> ){0} (?<floating-point-e> [eE] ){0} (?<floating-point-p> [pP] ){0} (?<sign> [+-] ){0} (?!0[box]) \\g<floating-point-literal> | \\g<integer-literal>"
|
||||
},
|
||||
"literal-string": {
|
||||
"name": "string.quoted.double.swift",
|
||||
"begin": "\"",
|
||||
"end": "\"",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.begin.swift"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.end.swift"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#quoted-text"
|
||||
}
|
||||
]
|
||||
},
|
||||
"operator": {
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#operator-character"
|
||||
}
|
||||
]
|
||||
},
|
||||
"operator-character": {
|
||||
"name": "keyword.operator.swift",
|
||||
"match": "[\\/=\\-+!*%<>&|^~,\\?:\\[\\]]"
|
||||
},
|
||||
"quoted-text": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "meta.embedded.line.swift",
|
||||
"contentName": "source.swift",
|
||||
"begin": "\\\\\\(",
|
||||
"end": "\\)",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.embedded.begin.swift"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.embedded.end.swift"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#escaped-char"
|
||||
}
|
||||
]
|
||||
},
|
||||
"whitespace": {
|
||||
"match":
|
||||
"(?x) [ \\u0020 (?# space) \\u000A (?# line-feed) \\u000D (?# carriage-return) \\u0009 (?# horizontal-tab) \\u000B (?# vertical-tab) \\u000C (?# form-feed) \\u0000 (?# null) ]"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue