pair-mode 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,75 @@
1
+ filetype: javascript
2
+
3
+ detect:
4
+ filename: "(\\.(m|c)?js$|\\.es[5678]?$)"
5
+ header: "^#!.*/(env +)?node( |$)"
6
+
7
+ rules:
8
+ - constant.number: "\\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\\b"
9
+ - constant.number: "\\b[-+]?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
10
+ - constant.number: "\\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
11
+ #- identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
12
+ # ^ this is not correct usage of the identifier color
13
+ - symbol.brackets: "[(){}]|\\[|\\]"
14
+ - symbol.operator: "([-+/*=<>!~%?:&|]|[.]{3})"
15
+ - statement: "\\b(async|await|break|case|catch|const|continue|debugger|default)\\b"
16
+ - statement: "\\b(delete|do|else|export|finally|for|function\\*?|class|extends)\\b"
17
+ - statement: "\\b(get|if|import|from|in|of|instanceof|let|new|reject|resolve|return)\\b"
18
+ - statement: "\\b(set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\\b"
19
+ # reserved but unassigned
20
+ - error: "\\b(enum|implements|interface|package|private|protected|public)\\b"
21
+ - constant: "\\b(globalThis|Infinity|null|undefined|NaN)\\b"
22
+ - constant: "\\b(null|undefined|NaN)\\b"
23
+ - constant: "\\b(true|false)\\b"
24
+ - type: "\\b(Array|Boolean|Date|Enumerator|Error|Function|Generator|Map|Math)\\b"
25
+ - type: "\\b(Number|Object|Promise|Proxy|Reflect|RegExp|Set|String|Symbol|WeakMap|WeakSet)\\b"
26
+ - type: "\\b(BigInt64Array|BigUint64Array|Float32Array|Float64Array|Int16Array)\\b"
27
+
28
+ # - constant: "/[^*]([^/]|(\\\\/))*[^\\\\]/[gim]*"
29
+ - constant: "\\\\[0-7][0-7]?[0-7]?|\\\\x[0-9a-fA-F]+|\\\\[bfnrt'\"\\?\\\\]"
30
+ - comment: "^#!.*/(env +)?node( |$)"
31
+
32
+ - identifier: "\\b(alert|decodeURI|decodeURIComponent|document|encodeURI|encodeURIComponent|escape|eval|isFinite|isNaN|parseFloat|parseInt|unescape|uneval|window)\\b"
33
+ - identifier: "\\b(Intl|WebAssembly)\\b"
34
+ - identifier: "\\b(Arguments)\\b"
35
+
36
+ - constant.string:
37
+ start: '"'
38
+ end: '"'
39
+ skip: "\\\\."
40
+ rules:
41
+ - constant.specialChar: "\\\\."
42
+
43
+ - constant.string:
44
+ start: "'"
45
+ end: "'"
46
+ skip: "\\\\."
47
+ rules:
48
+ - constant.specialChar: "\\\\."
49
+
50
+ - constant.string:
51
+ start: "`"
52
+ end: "`"
53
+ rules:
54
+ - constant.specialChar: "\\\\."
55
+ - identifier: "\\x24\\{.*?\\}"
56
+
57
+ - constant.bool: "\\b(true|false)\\b"
58
+ - constant.bool.false: "\\b(false)\\b"
59
+ - constant.bool.true: "\\b(true)\\b"
60
+
61
+ - comment:
62
+ start: "//"
63
+ end: "$"
64
+ rules:
65
+ - todo: "(TODO|XXX|FIXME)"
66
+
67
+ - comment:
68
+ start: "/\\*"
69
+ end: "\\*/"
70
+ skip: "\\\\."
71
+ rules:
72
+ - constant.specialChar: "\\\\."
73
+ # function documentation
74
+ - identifier: "\\s\\*\\s.*"
75
+ - todo: "(TODO|XXX|FIXME)"
@@ -0,0 +1,39 @@
1
+ filetype: json
2
+
3
+ detect:
4
+ filename: "\\.json$"
5
+ header: "^\\{$"
6
+
7
+ rules:
8
+ - constant.number: "\\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\\b"
9
+ - constant.number: "\\b[-+]?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
10
+ - constant.number: "\\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
11
+ - constant: "\\b(null)\\b"
12
+ - constant: "\\b(true|false)\\b"
13
+ - constant.string:
14
+ start: '"'
15
+ end: '"'
16
+ skip: "\\\\."
17
+ rules:
18
+ - constant.specialChar: "\\\\."
19
+ - constant.string:
20
+ start: "'"
21
+ end: "'"
22
+ skip: "\\\\."
23
+ rules:
24
+ - constant.specialChar: "\\\\."
25
+
26
+ - statement: "\\\"(\\\\\"|[^\"])*\\\"[[:space:]]*:\" \"'(\\'|[^'])*'[[:space:]]*:"
27
+ - constant: "\\\\u[0-9a-fA-F]{4}|\\\\[bfnrt'\"/\\\\]"
28
+
29
+ - comment:
30
+ start: "//"
31
+ end: "$"
32
+ rules:
33
+ - todo: "(TODO|XXX|FIXME):?"
34
+
35
+ - comment:
36
+ start: "/\\*"
37
+ end: "\\*/"
38
+ rules:
39
+ - todo: "(TODO|XXX|FIXME):?"
@@ -0,0 +1,111 @@
1
+ filetype: lua
2
+
3
+ detect:
4
+ filename: "\\.lua$"
5
+
6
+ rules:
7
+ - statement: "\\b(do|end|while|break|repeat|until|if|elseif|then|else|for|in|function|local|return|goto)\\b"
8
+ - statement: "\\b(not|and|or)\\b"
9
+ - statement: "\\b(debug|string|math|table|io|coroutine|os|utf8|bit32)\\b\\."
10
+ - statement: "\\b(_ENV|_G|_VERSION|assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|load|loadfile|module|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\\s*\\("
11
+ - identifier: "io\\.\\b(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)\\b"
12
+ - identifier: "math\\.\\b(abs|acos|asin|atan2|atan|ceil|cosh|cos|deg|exp|floor|fmod|frexp|huge|ldexp|log10|log|max|maxinteger|min|mininteger|modf|pi|pow|rad|random|randomseed|sin|sqrt|tan|tointeger|type|ult)\\b"
13
+ - identifier: "os\\.\\b(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)\\b"
14
+ - identifier: "package\\.\\b(config|cpath|loaded|loadlib|path|preload|seeall|searchers|searchpath)\\b"
15
+ - identifier: "string\\.\\b(byte|char|dump|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper)\\b"
16
+ - identifier: "table\\.\\b(concat|insert|maxn|move|pack|remove|sort|unpack)\\b"
17
+ - identifier: "utf8\\.\\b(char|charpattern|codes|codepoint|len|offset)\\b"
18
+ - identifier: "coroutine\\.\\b(create|isyieldable|resume|running|status|wrap|yield)\\b"
19
+ - identifier: "debug\\.\\b(debug|getfenv|gethook|getinfo|getlocal|getmetatable|getregistry|getupvalue|getuservalue|setfenv|sethook|setlocal|setmetatable|setupvalue|setuservalue|traceback|upvalueid|upvaluejoin)\\b"
20
+ - identifier: "bit32\\.\\b(arshift|band|bnot|bor|btest|bxor|extract|replace|lrotate|lshift|rrotate|rshift)\\b"
21
+ - identifier: "\\:\\b(close|flush|lines|read|seek|setvbuf|write|byte|char|dump|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper)\\b"
22
+ - identifier: "\\b(self|arg)\\b"
23
+ - constant: "\\b(false|nil|true)\\b"
24
+ - statement: "(\\b(dofile|require|include)|%q|%!|%Q|%r|%x)\\b"
25
+
26
+ - symbol.brackets: "[(){}\\[\\]]"
27
+ - symbol: "(\\*|//|/|%|\\+|-|\\^|>|>=|<|<=|~=|=|[\\.]{2,3}|#)"
28
+
29
+ - constant.number: "\\b((0[xX](([0-9A-Fa-f]+\\.[0-9A-Fa-f]*)|(\\.?[0-9A-Fa-f]+))([pP][-+]?[0-9]+)?)|((([0-9]+\\.[0-9]*)|(\\.?[0-9]+))([eE][-+]?[0-9]+)?))"
30
+
31
+ - constant.string:
32
+ start: '"'
33
+ end: '"'
34
+ skip: "\\\\."
35
+ rules:
36
+ - constant.specialChar: "\\\\([abfnrtvz\\'\"]|[0-9]{1,3}|x[0-9a-fA-F][0-9a-fA-F]|u\\{[0-9a-fA-F]+\\})"
37
+
38
+ - constant.string:
39
+ start: "'"
40
+ end: "'"
41
+ skip: "\\\\."
42
+ rules:
43
+ - constant.specialChar: "\\\\([abfnrtvz\\'\"]|[0-9]{1,3}|x[0-9a-fA-F][0-9a-fA-F]|u\\{[0-9a-fA-F]+\\})"
44
+
45
+ - constant.string:
46
+ start: "\\[\\["
47
+ end: "\\]\\]"
48
+ rules: []
49
+
50
+ # support first few lengths of "long brackets" explicitly
51
+ # brackets longer than that will give false positives
52
+
53
+ - constant.string:
54
+ start: "\\[=\\["
55
+ end: "\\]=\\]"
56
+ rules: []
57
+
58
+ - constant.string:
59
+ start: "\\[==\\["
60
+ end: "\\]==\\]"
61
+ rules: []
62
+
63
+ - constant.string:
64
+ start: "\\[===\\["
65
+ end: "\\]===\\]"
66
+ rules: []
67
+
68
+ - constant.string:
69
+ start: "\\[====+\\["
70
+ end: "\\]====+\\]"
71
+ rules: []
72
+
73
+ - comment.block:
74
+ start: "\\-\\-\\[\\["
75
+ end: "\\]\\]"
76
+ rules:
77
+ - todo: "(TODO|NOTE|FIXME):?"
78
+
79
+ # support long brackets, same as with multiline strings
80
+
81
+ - comment.block:
82
+ start: "\\-\\-\\[=\\["
83
+ end: "\\]=\\]"
84
+ rules:
85
+ - todo: "(TODO|NOTE|FIXME):?"
86
+
87
+ - comment.block:
88
+ start: "\\-\\-\\[==\\["
89
+ end: "\\]==\\]"
90
+ rules:
91
+ - todo: "(TODO|NOTE|FIXME):?"
92
+
93
+ - comment.block:
94
+ start: "\\-\\-\\[===\\["
95
+ end: "\\]===\\]"
96
+ rules:
97
+ - todo: "(TODO|NOTE|FIXME):?"
98
+
99
+ - comment.block:
100
+ start: "\\-\\-\\[====+\\["
101
+ end: "\\]====+\\]"
102
+ rules:
103
+ - todo: "(TODO|NOTE|FIXME):?"
104
+
105
+ # this has to go after block comment or block comment does not work
106
+
107
+ - comment:
108
+ start: "\\-\\-"
109
+ end: "$"
110
+ rules:
111
+ - todo: "(TODO|NOTE|FIXME):?"
@@ -0,0 +1,49 @@
1
+ filetype: markdown
2
+
3
+ detect:
4
+ filename: "\\.(livemd|md|mkd|mkdn|markdown)$"
5
+
6
+ rules:
7
+ # Tables (Github extension)
8
+ - type: ".*[ :]\\|[ :].*"
9
+
10
+ # quotes
11
+ - statement: "^>.*"
12
+
13
+ # Emphasis
14
+ - type: "(^|[[:space:]])(_[^ ][^_]*_|\\*[^ ][^*]*\\*)"
15
+
16
+ # Strong emphasis
17
+ - type: "(^|[[:space:]])(__[^ ][^_]*__|\\*\\*[^ ][^*]*\\*\\*)"
18
+
19
+ # strike-through
20
+ - type: "(^|[[:space:]])~~[^ ][^~]*~~"
21
+
22
+ # horizontal rules
23
+ - special: "^(---+|===+|___+|\\*\\*\\*+)\\s*$"
24
+
25
+ # headlines
26
+ - special: "^#{1,6}.*"
27
+
28
+ # lists
29
+ - identifier: "^[[:space:]]*[\\*+-] |^[[:space:]]*[0-9]+\\. "
30
+
31
+ # misc
32
+ - preproc: "(\\(([CcRr]|[Tt][Mm])\\)|\\.{3}|(^|[[:space:]])\\-\\-($|[[:space:]]))"
33
+
34
+ # links
35
+ - constant: "\\[[^]]+\\]"
36
+ - constant: "\\[([^][]|\\[[^]]*\\])*\\]\\([^)]+\\)"
37
+
38
+ # images
39
+ - underlined: "!\\[[^][]*\\](\\([^)]+\\)|\\[[^]]+\\])"
40
+
41
+ # urls
42
+ - underlined: "https?://[^ )>]+"
43
+
44
+ - special: "^```$"
45
+
46
+ - special:
47
+ start: "`"
48
+ end: "`"
49
+ rules: []
@@ -0,0 +1,40 @@
1
+ filetype: proto
2
+
3
+ detect:
4
+ filename: "(\\.(proto)$$)"
5
+
6
+ rules:
7
+ - identifier: "\\b[A-Z_][0-9A-Z_]+\\b"
8
+ - type: "\\b(int(8|16|32|64))|string|bytes|repeated|bool|required|map|optional|oneof|union\\b"
9
+ - statement: "\\b(import|service|enum|syntax|package|option|message|rpc|returns|extensions|to)\\b"
10
+ - constant: "'\\\\(([0-3]?[0-7]{1,2}))'"
11
+ - constant: "'\\\\x[0-9A-Fa-f]{1,2}'"
12
+ - symbol.brackets: "[(){}]|\\[|\\]"
13
+ - constant.number: "(\\b[0-9]+\\b|\\b0x[0-9A-Fa-f]+\\b)"
14
+
15
+ - constant.string:
16
+ start: '"'
17
+ end: '"'
18
+ skip: "\\\\."
19
+ rules:
20
+ - constant.specialChar: "\\\\."
21
+
22
+ - constant.string:
23
+ start: "'"
24
+ end: "'"
25
+ skip: "\\\\."
26
+ rules:
27
+ - preproc: "..+"
28
+ - constant.specialChar: "\\\\."
29
+
30
+ - comment:
31
+ start: "//"
32
+ end: "$"
33
+ rules:
34
+ - todo: "(TODO|XXX|FIXME):?"
35
+
36
+ - comment:
37
+ start: "/\\*"
38
+ end: "\\*/"
39
+ rules:
40
+ - todo: "(TODO|XXX|FIXME):?"
@@ -0,0 +1,62 @@
1
+ filetype: python
2
+
3
+ detect:
4
+ filename: "\\.py(3|w)?$"
5
+ header: "^#!.*/(env +)?python(3)?$"
6
+
7
+ rules:
8
+ # built-in objects
9
+ - constant: "\\b(Ellipsis|None|self|cls|True|False)\\b"
10
+ # built-in attributes
11
+ - constant: "\\b(__bases__|__builtin__|__class__|__debug__|__dict__|__doc__|__file__|__members__|__methods__|__name__|__self__)\\b"
12
+ # built-in functions
13
+ - identifier: "\\b(abs|all|any|ascii|bin|bool|breakpoint|bytearray|bytes|callable|chr|classmethod|compile|complex|delattr|dir|divmod|eval|exec|format|getattr|globals|hasattr|hash|help|hex|id|input|isinstance|issubclass|iter|len|locals|max|min|next|nonlocal|oct|open|ord|pow|print|repr|round|setattr|sorted|sum|vars|__import__)\\b"
14
+ # special method names
15
+ - identifier: "\\b__(abs|add|and|call|cmp|coerce|complex|concat|contains|delattr|delitem|delslice|del|dict|divmod|div|float|getattr|getitem|getslice|hash|hex|iadd|iand|iconcat|ifloordiv|ilshift|imatmul|imod|imul|init|int|invert|inv|ior|ipow|irshift|isub|iter|itruediv|ixor|len|long|lshift|mod|mul|neg|next|nonzero|oct|or|pos|pow|radd|rand|rcmp|rdivmod|rdiv|repeat|repr|rlshift|rmod|rmul|ror|rpow|rrshift|rshift|rsub|rxor|setattr|setitem|setslice|str|sub|xor)__\\b"
16
+ # types
17
+ - type: "\\b(bool|bytearray|bytes|classmethod|complex|dict|enumerate|filter|float|frozenset|int|list|map|memoryview|object|property|range|reversed|set|slice|staticmethod|str|super|tuple|type|zip)\\b"
18
+ # definitions
19
+ - identifier: "def [a-zA-Z_0-9]+"
20
+ # keywords
21
+ - statement: "\\b(and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|raise|return|try|while|with|yield)\\b"
22
+ # decorators
23
+ - preproc: "^\\s*@[^(]*"
24
+ # operators
25
+ - symbol.operator: "([~^.:;,+*|=!\\%@]|<|>|/|-|&)"
26
+ # parentheses
27
+ - symbol.brackets: "([(){}]|\\[|\\])"
28
+ # numbers
29
+ - constant.number: "\\b[0-9](_?[0-9])*(\\.([0-9](_?[0-9])*)?)?(e[0-9](_?[0-9])*)?\\b" # decimal
30
+ - constant.number: "\\b0b(_?[01])+\\b" # bin
31
+ - constant.number: "\\b0o(_?[0-7])+\\b" # oct
32
+ - constant.number: "\\b0x(_?[0-9a-fA-F])+\\b" # hex
33
+
34
+ - constant.string:
35
+ start: '"""'
36
+ end: '"""'
37
+ rules: []
38
+
39
+ - constant.string:
40
+ start: "'''"
41
+ end: "'''"
42
+ rules: []
43
+
44
+ - constant.string:
45
+ start: '"'
46
+ end: '("|$)'
47
+ skip: "\\\\."
48
+ rules:
49
+ - constant.specialChar: "\\\\."
50
+
51
+ - constant.string:
52
+ start: "'"
53
+ end: "('|$)"
54
+ skip: "\\\\."
55
+ rules:
56
+ - constant.specialChar: "\\\\."
57
+
58
+ - comment:
59
+ start: "#"
60
+ end: "$"
61
+ rules: # AKA Code tags (PEP 350)
62
+ - todo: "(TODO|FIXME|HACK|BUG|NOTE|FAQ|MNEMONIC|REQ|RFE|IDEA|PORT|\\?\\?\\?|!!!|GLOSS|SEE|TODOC|STAT|RVD|CRED):?"
@@ -0,0 +1,73 @@
1
+ filetype: ruby
2
+
3
+ detect:
4
+ filename: '\.(rb|rake|gemspec)$|^(.*[\\/])?(Gemfile|config\.ru|Rakefile|Capfile|Vagrantfile|Guardfile|Appfile|Fastfile|Pluginfile|Podfile|\.?[Bb]rewfile)$'
5
+ header: "^#!.*/(env +)?ruby( |$)"
6
+
7
+ rules:
8
+ - comment.bright:
9
+ start: "##"
10
+ end: "$"
11
+ rules:
12
+ - todo: "(XXX|TODO|FIXME|BUG|\\?\\?\\?)"
13
+ - comment:
14
+ start: "#"
15
+ end: "$"
16
+ rules:
17
+ - todo: "(XXX|TODO|FIXME|BUG|\\?\\?\\?)"
18
+
19
+ - statement: "\\b(BEGIN|END|alias|and|begin|break|case|class|def|defined\\?|do|else|elsif|end|ensure|for|if|in|module|next|nil|not|or|private|protected|public|redo|rescue|retry|return|self|super|then|undef|unless|until|when|while|yield)\\b"
20
+ - constant: "(\\$|@|@@)?\\b[A-Z]+[0-9A-Z_a-z]*"
21
+ - constant.number: "(?i)\\b0x[0-9a-fA-F][0-9a-f_]*\\b"
22
+ - constant.number: "(?i)\\b0b[01][01_]*\\b"
23
+ - constant.number: "(?i)\\b[0-9][0-9_]*(['.'][0-9_]+)?(e[\\-]?[0-9_]+)?\\b"
24
+ # Predefined global variables
25
+ - constant:
26
+ start: "[$]([!@&`'+~=/\\\\,;.<>*$?:\"_]|-[A-Za-z0-9_]|[0-9]+)"
27
+ end: "\\B|\\b"
28
+ rules: []
29
+ # Ruby "Symbols"
30
+ - constant: "(i?)([ ]|^):[0-9A-Z_]+\\b"
31
+ - constant: "\\b(__FILE__|__LINE__)\\b"
32
+ - constant: "/([^/]|(\\\\/))*/[iomx]*|%r\\{([^}]|(\\\\}))*\\}[iomx]*"
33
+
34
+ - constant.string:
35
+ start: "'"
36
+ end: "'"
37
+ skip: "\\\\."
38
+ rules: []
39
+
40
+ - constant.string:
41
+ start: '"'
42
+ end: '"'
43
+ skip: "\\\\."
44
+ rules:
45
+ - symbol.brackets:
46
+ start: "#\\{"
47
+ end: "\\}"
48
+ rules:
49
+ - default: ".*"
50
+
51
+ - constant.string.exec:
52
+ start: "`"
53
+ end: "`"
54
+ skip: "\\\\."
55
+ rules:
56
+ - symbol.brackets:
57
+ start: "#\\{"
58
+ end: "\\}"
59
+ rules:
60
+ - default: ".*"
61
+
62
+ - constant.string: "%[QW]?\\{[^}]*\\}|%[QW]?\\([^)]*\\)|%[QW]?<[^>]*>|%[QW]?\\[[^]]*\\]|%[QW]?\\$[^$]*\\$|%[QW]?\\^[^^]*\\^|%[QW]?![^!]*!"
63
+ - constant.string: "%[qw]\\{[^}]*\\}|%[qw]\\([^)]*\\)|%[qw]<[^>]*>|%[qw]\\[[^]]*\\]|%[qw]\\$[^$]*\\$|%[qw]\\^[^^]*\\^|%[qw]![^!]*!"
64
+ - constant.string.exec: "%[x]\\{[^}]*\\}|%[x]\\([^)]*\\)|%[x]<[^>]*>|%[x]\\[[^]]*\\]|%[x]\\$[^$]*\\$|%[x]\\^[^^]*\\^|%[x]![^!]*!"
65
+ - constant.bool: "\\b(true|false|nil|TRUE|FALSE|NIL)\\b"
66
+ - symbol.operator: "[-+/*=<>!~%&|^]|\\b:"
67
+ - symbol.brackets: "([(){}]|\\[|\\])"
68
+ - constant.macro:
69
+ start: "<<-?'?EOT'?"
70
+ end: "^EOT"
71
+ rules: []
72
+
73
+ - preproc.shebang: "^#!.+?( |$)"
@@ -0,0 +1,78 @@
1
+ filetype: rust
2
+
3
+ detect:
4
+ filename: "\\.rs$"
5
+
6
+ rules:
7
+ # function definition
8
+ - identifier: "fn [a-z0-9_]+"
9
+ # Reserved words
10
+ - statement: "\\b(abstract|alignof|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|false|final|fn|for|gen|if|impl|in|let|loop|macro|match|mod|move|mut|offsetof|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|true|trait|type|typeof|try|union|unsafe|unsized|use|virtual|where|while|yield)\\b"
11
+ # macros
12
+ - special: "[a-z_]+!"
13
+ # Constants
14
+ - constant: "\\b[A-Z][A-Z_0-9]+\\b"
15
+ # Numbers
16
+ - constant.number: "\\b[0-9]+\\b"
17
+ # Booleans
18
+ - constant: "\\b(true|false)\\b"
19
+ # Traits/Enums/Structs/Types/etc.
20
+ - type: "\\b[A-Z]+[a-zA-Z_0-9]*[a-z]+[a-zA-Z_0-9]*\\b"
21
+ # Builtin types that start with lowercase.
22
+ - type: "\\b(bool|str|char|((i|u)(8|16|32|64|128|size))|f(16|32|64|128))\\b"
23
+
24
+ - constant.string:
25
+ start: '[bc]?"'
26
+ end: '"'
27
+ skip: '\\.'
28
+ rules:
29
+ - constant.specialChar: '\\.'
30
+
31
+ - constant.string:
32
+ start: '[bc]?r#"'
33
+ end: '"#'
34
+ rules: []
35
+
36
+ - constant.string:
37
+ start: '[bc]?r##"'
38
+ end: '"##'
39
+ rules: []
40
+
41
+ - constant.string:
42
+ start: '[bc]?r###"'
43
+ end: '"###'
44
+ rules: []
45
+
46
+ - constant.string:
47
+ start: '[bc]?r####+"'
48
+ end: '"####+'
49
+ rules: []
50
+
51
+ # Character literals
52
+ # NOTE: This is an ugly hack to work around the fact that rust uses
53
+ # single quotes both for character literals and lifetimes.
54
+ # Match all character literals.
55
+ - constant.string: "'(\\\\.|.)'"
56
+ # Match the '"' literal which would otherwise match
57
+ # as a double quoted string and destroy the highlighting.
58
+ - constant.string:
59
+ start: '''"'
60
+ end: "'"
61
+ rules: []
62
+
63
+ - comment:
64
+ start: "//"
65
+ end: "$"
66
+ rules:
67
+ - todo: "(TODO|XXX|FIXME):?"
68
+
69
+ - comment:
70
+ start: "/\\*"
71
+ end: "\\*/"
72
+ rules:
73
+ - todo: "(TODO|XXX|FIXME):?"
74
+
75
+ - special:
76
+ start: "#!\\["
77
+ end: "\\]"
78
+ rules: []
@@ -0,0 +1,69 @@
1
+ filetype: shell
2
+
3
+ # Detection based on filename is rather complicated as there are many
4
+ # different file extensions and special filenames in use.
5
+ # This expressions aims to capture them all while not matching
6
+ # filenames that coincidentally contain the same substring.
7
+ #
8
+ # File extensions:
9
+ # * .sh
10
+ # * .bash
11
+ # * .ash
12
+ # * .ebuild (Gentoo ebuild format)
13
+ #
14
+ # Special filenames:
15
+ # * .bashrc, .bash_aliases, .bash_functions .bash_profile
16
+ # * profile, .profile (/etc/profile or ~/.profile)
17
+ # * Pkgfile
18
+ # * pkgmk.conf
19
+ # * rc.conf
20
+ # * PKGBUILD (Arch Linux build scripts)
21
+ # * APKBUILD
22
+ #
23
+ # Fix command (fc) files:
24
+ # * bash-fc. (followed by a random string)
25
+ detect:
26
+ filename: "(\\.(sh|bash|ash|ebuild)$|(\\.bash(rc|_aliases|_functions|_profile)|\\.?profile|Pkgfile|pkgmk\\.conf|rc\\.conf|PKGBUILD|APKBUILD)$|bash-fc\\.)"
27
+ header: "^#!.*/(env +)?(ba)?(a)?(mk)?sh( |$)"
28
+
29
+ rules:
30
+ # Numbers
31
+ - constant.number: "\\b[0-9]+\\b"
32
+ # Conditionals and control flow
33
+ - statement: "\\b(break|case|continue|do|done|elif|else|esac|exec|exit|fi|for|function|if|in|return|select|then|trap|until|wait|while)\\b"
34
+ - special: "[`$<>!=&~^\\{\\}\\(\\)\\;\\]\\[]+"
35
+ # Shell commands
36
+ - type: "\\b(cd|command|echo|eval|export|getopts|let|local|read|set|shift|time|umask|unset)\\b"
37
+ # Common linux commands
38
+ - type: "\\b((g|ig)?awk|bash|dash|find|getopt|\\w{0,4}grep|kill|killall|\\w{0,4}less|make|pkill|sed|sh|tar)\\b"
39
+ # Coreutils commands
40
+ - type: "\\b(base64|basename|cat|chcon|chgrp|chmod|chown|chroot|cksum|comm|cp|csplit|cut|date|dd|df|dir|dircolors|dirname|du|env|expand|expr|factor|false|fmt|fold|head|hostid|id|install|join|link|ln|logname|ls|md5sum|mkdir|mkfifo|mknod|mktemp|mv|nice|nl|nohup|nproc|numfmt|od|paste|pathchk|pinky|pr|printenv|printf|ptx|pwd|readlink|realpath|rm|rmdir|runcon|seq|(sha1|sha224|sha256|sha384|sha512)sum|shred|shuf|sleep|sort|split|stat|stdbuf|stty|sum|sync|tac|tail|tee|test|time|timeout|touch|tr|true|truncate|tsort|tty|uname|unexpand|uniq|unlink|users|vdir|wc|who|whoami|yes)\\b"
41
+ # Conditional flags
42
+ - statement: "(\\s|^)(--?[A-Za-z0-9][\\w-]*)"
43
+
44
+ - identifier: "\\$\\{[\\w:!%&=+#~@*^$?, .\\-\\/\\[\\]]+\\}"
45
+ - identifier: "\\$([0-9!#@*$?-]|[A-Za-z_]\\w*)"
46
+
47
+ - constant.string:
48
+ start: '"'
49
+ end: '"'
50
+ skip: "\\\\."
51
+ rules: []
52
+
53
+ - constant.string:
54
+ start: "'"
55
+ end: "'"
56
+ skip: "\\\\."
57
+ rules: []
58
+
59
+ - constant.string:
60
+ start: "<<[^\\s]+[-~.]*[A-Za-z0-9]+$"
61
+ end: "^[^\\s]+[A-Za-z0-9]+$"
62
+ skip: "\\\\."
63
+ rules: []
64
+
65
+ - comment:
66
+ start: "(^|\\s)#"
67
+ end: "$"
68
+ rules:
69
+ - todo: "(TODO|XXX|FIXME):?"
@@ -0,0 +1,35 @@
1
+ filetype: sql
2
+
3
+ detect:
4
+ filename: "\\.sql$|sqliterc$"
5
+
6
+ rules:
7
+ - statement: "(?i)\\b(ALL|ASC|AS|ALTER|AND|ADD|AUTO_INCREMENT)\\b"
8
+ - statement: "(?i)\\b(BETWEEN|BINARY|BOTH|BY|BOOLEAN)\\b"
9
+ - statement: "(?i)\\b(CHANGE|CHECK|COLUMNS|COLUMN|CROSS|CREATE)\\b"
10
+ - statement: "(?i)\\b(DATABASES|DATABASE|DATA|DELAYED|DESCRIBE|DESC|DISTINCT|DELETE|DROP|DEFAULT)\\b"
11
+ - statement: "(?i)\\b(ENCLOSED|ESCAPED|EXISTS|EXPLAIN)\\b"
12
+ - statement: "(?i)\\b(FIELDS|FIELD|FLUSH|FOR|FOREIGN|FUNCTION|FROM)\\b"
13
+ - statement: "(?i)\\b(GROUP|GRANT|HAVING)\\b"
14
+ - statement: "(?i)\\b(IGNORE|INDEX|INFILE|INSERT|INNER|INTO|IDENTIFIED|IN|IS|IF)\\b"
15
+ - statement: "(?i)\\b(JOIN|KEYS|KILL|KEY)\\b"
16
+ - statement: "(?i)\\b(LEADING|LIKE|LIMIT|LINES|LOAD|LOCAL|LOCK|LOW_PRIORITY|LEFT|LANGUAGE)\\b"
17
+ - statement: "(?i)\\b(MODIFY|NATURAL|NOT|NULL|NEXTVAL)\\b"
18
+ - statement: "(?i)\\b(OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUTFILE|OR|OUTER|ON)\\b"
19
+ - statement: "(?i)\\b(PROCEDURE|PROCEDURAL|PRIMARY)\\b"
20
+ - statement: "(?i)\\b(READ|REFERENCES|REGEXP|RENAME|REPLACE|RETURN|REVOKE|RLIKE|RIGHT)\\b"
21
+ - statement: "(?i)\\b(SHOW|SONAME|STATUS|STRAIGHT_JOIN|SELECT|SETVAL|SET)\\b"
22
+ - statement: "(?i)\\b(TABLES|TERMINATED|TO|TRAILING|TRUNCATE|TABLE|TEMPORARY|TRIGGER|TRUSTED)\\b"
23
+ - statement: "(?i)\\b(UNIQUE|UNLOCK|USE|USING|UPDATE|VALUES|VARIABLES|VIEW)\\b"
24
+ - statement: "(?i)\\b(WITH|WRITE|WHERE|ZEROFILL|TYPE|XOR)\\b"
25
+ - type: "(?i)\\b(VARCHAR|TINYINT|TEXT|DATE|SMALLINT|MEDIUMINT|INT|INTEGER|BIGINT|FLOAT|DOUBLE|DECIMAL|DATETIME|TIMESTAMP|TIME|YEAR|UNSIGNED|CHAR|TINYBLOB|TINYTEXT|BLOB|MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|ENUM|BOOL|BINARY|VARBINARY)\\b"
26
+ - preproc: "(?i)\\.\\b(databases|dump|echo|exit|explain|header(s)?|help)\\b"
27
+ - preproc: "(?i)\\.\\b(import|indices|mode|nullvalue|output|prompt|quit|read)\\b"
28
+ - preproc: "(?i)\\.\\b(schema|separator|show|tables|timeout|width)\\b"
29
+ - constant.bool: "\\b(ON|OFF)\\b"
30
+ - constant.number: "\\b([0-9]+)\\b"
31
+ - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'"
32
+ - constant.string: "`(\\\\.|[^\\\\`])*`"
33
+ - comment: "\\-\\-.*$"
34
+ - indent-char.whitespace: "[[:space:]]+$"
35
+ - indent-char: " + +| + +"