@spader/spall-tui 1.0.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.
- package/dist/App.js +3636 -0
- package/dist/App.js.map +39 -0
- package/dist/bash-nbhfht5r.scm +56 -0
- package/dist/c-4zy7d3fw.scm +81 -0
- package/dist/c_sharp-tb7n62t2.scm +212 -0
- package/dist/cpp-stxr9ffp.scm +77 -0
- package/dist/css-b1p1h6ys.scm +76 -0
- package/dist/dart-t89b32ej.scm +13 -0
- package/dist/elisp-ax9wx1b9.scm +72 -0
- package/dist/elixir-77300bss.scm +223 -0
- package/dist/elm-k2q5knqb.scm +76 -0
- package/dist/embedded_template-k7ypjkba.scm +12 -0
- package/dist/go-9wx8m64k.scm +123 -0
- package/dist/html-g95aq3vw.scm +13 -0
- package/dist/index.js +3635 -0
- package/dist/index.js.map +39 -0
- package/dist/java-wasz6t7a.scm +149 -0
- package/dist/javascript-cswtymww.scm +204 -0
- package/dist/json-pf4aw8w1.scm +16 -0
- package/dist/kotlin-m6cj2y7m.scm +380 -0
- package/dist/lib/git.js +117 -0
- package/dist/lib/git.js.map +10 -0
- package/dist/lua-7h6jk3pd.scm +204 -0
- package/dist/objc-6yjdwy1z.scm +216 -0
- package/dist/ocaml-jfj520qk.scm +148 -0
- package/dist/parsers/index.d.ts +8 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/php-bds7v5h1.scm +203 -0
- package/dist/python-k2cbtg72.scm +137 -0
- package/dist/ql-qs2vxbeq.scm +154 -0
- package/dist/ruby-3ybh5bp2.scm +154 -0
- package/dist/rust-edtnatpk.scm +161 -0
- package/dist/scala-91f2sb1z.scm +260 -0
- package/dist/src/App.d.ts +6 -0
- package/dist/src/App.d.ts.map +1 -0
- package/dist/src/Review.d.ts +6 -0
- package/dist/src/Review.d.ts.map +1 -0
- package/dist/src/components/CommandPalette.d.ts +2 -0
- package/dist/src/components/CommandPalette.d.ts.map +1 -0
- package/dist/src/components/DiffPanel.d.ts +16 -0
- package/dist/src/components/DiffPanel.d.ts.map +1 -0
- package/dist/src/components/EditorPanel.d.ts +9 -0
- package/dist/src/components/EditorPanel.d.ts.map +1 -0
- package/dist/src/components/ErrorFallback.d.ts +6 -0
- package/dist/src/components/ErrorFallback.d.ts.map +1 -0
- package/dist/src/components/HalfLineShadow.d.ts +18 -0
- package/dist/src/components/HalfLineShadow.d.ts.map +1 -0
- package/dist/src/components/index.d.ts +7 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/components/sidebar/CommentList.d.ts +10 -0
- package/dist/src/components/sidebar/CommentList.d.ts.map +1 -0
- package/dist/src/components/sidebar/FileList.d.ts +13 -0
- package/dist/src/components/sidebar/FileList.d.ts.map +1 -0
- package/dist/src/components/sidebar/PatchList.d.ts +14 -0
- package/dist/src/components/sidebar/PatchList.d.ts.map +1 -0
- package/dist/src/components/sidebar/ProjectStatus.d.ts +7 -0
- package/dist/src/components/sidebar/ProjectStatus.d.ts.map +1 -0
- package/dist/src/components/sidebar/Section.d.ts +12 -0
- package/dist/src/components/sidebar/Section.d.ts.map +1 -0
- package/dist/src/components/sidebar/ServerStatus.d.ts +2 -0
- package/dist/src/components/sidebar/ServerStatus.d.ts.map +1 -0
- package/dist/src/components/sidebar/index.d.ts +7 -0
- package/dist/src/components/sidebar/index.d.ts.map +1 -0
- package/dist/src/context/command.d.ts +10 -0
- package/dist/src/context/command.d.ts.map +1 -0
- package/dist/src/context/dialog.d.ts +11 -0
- package/dist/src/context/dialog.d.ts.map +1 -0
- package/dist/src/context/exit.d.ts +10 -0
- package/dist/src/context/exit.d.ts.map +1 -0
- package/dist/src/context/review.d.ts +47 -0
- package/dist/src/context/review.d.ts.map +1 -0
- package/dist/src/context/server.d.ts +10 -0
- package/dist/src/context/server.d.ts.map +1 -0
- package/dist/src/context/sidebar.d.ts +13 -0
- package/dist/src/context/sidebar.d.ts.map +1 -0
- package/dist/src/context/theme.d.ts +47 -0
- package/dist/src/context/theme.d.ts.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/lib/diff.d.ts +24 -0
- package/dist/src/lib/diff.d.ts.map +1 -0
- package/dist/src/lib/git.d.ts +15 -0
- package/dist/src/lib/git.d.ts.map +1 -0
- package/dist/src/lib/keybind.d.ts +23 -0
- package/dist/src/lib/keybind.d.ts.map +1 -0
- package/dist/src/lib/tree.d.ts +39 -0
- package/dist/src/lib/tree.d.ts.map +1 -0
- package/dist/src/store/comment.d.ts +20 -0
- package/dist/src/store/comment.d.ts.map +1 -0
- package/dist/src/store/db.d.ts +6 -0
- package/dist/src/store/db.d.ts.map +1 -0
- package/dist/src/store/index.d.ts +7 -0
- package/dist/src/store/index.d.ts.map +1 -0
- package/dist/src/store/patch.d.ts +22 -0
- package/dist/src/store/patch.d.ts.map +1 -0
- package/dist/src/store/repo.d.ts +8 -0
- package/dist/src/store/repo.d.ts.map +1 -0
- package/dist/src/store/review.d.ts +18 -0
- package/dist/src/store/review.d.ts.map +1 -0
- package/dist/store/index.js +303 -0
- package/dist/store/index.js.map +14 -0
- package/dist/swift-a4tt704b.scm +336 -0
- package/dist/toml-hcqfz0bg.scm +53 -0
- package/dist/tsx-c3k3mmc9.scm +239 -0
- package/dist/typescript-hz4pg6ze.scm +239 -0
- package/dist/vue-xbeea1aj.scm +9 -0
- package/dist/yaml-mbfb25g0.scm +79 -0
- package/dist/zig-ds3q8m26.scm +283 -0
- package/package.json +74 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
; inherits: c
|
|
2
|
+
|
|
3
|
+
; Preprocs
|
|
4
|
+
|
|
5
|
+
(preproc_undef
|
|
6
|
+
name: (_) @constant) @preproc
|
|
7
|
+
|
|
8
|
+
; Includes
|
|
9
|
+
|
|
10
|
+
(module_import "@import" @include path: (identifier) @namespace)
|
|
11
|
+
|
|
12
|
+
((preproc_include
|
|
13
|
+
_ @include path: (_))
|
|
14
|
+
(#any-of? @include "#include" "#import"))
|
|
15
|
+
|
|
16
|
+
; Type Qualifiers
|
|
17
|
+
|
|
18
|
+
[
|
|
19
|
+
"@optional"
|
|
20
|
+
"@required"
|
|
21
|
+
"__covariant"
|
|
22
|
+
"__contravariant"
|
|
23
|
+
(visibility_specification)
|
|
24
|
+
] @type.qualifier
|
|
25
|
+
|
|
26
|
+
; Storageclasses
|
|
27
|
+
|
|
28
|
+
[
|
|
29
|
+
"@autoreleasepool"
|
|
30
|
+
"@synthesize"
|
|
31
|
+
"@dynamic"
|
|
32
|
+
"volatile"
|
|
33
|
+
(protocol_qualifier)
|
|
34
|
+
] @storageclass
|
|
35
|
+
|
|
36
|
+
; Keywords
|
|
37
|
+
|
|
38
|
+
[
|
|
39
|
+
"@protocol"
|
|
40
|
+
"@interface"
|
|
41
|
+
"@implementation"
|
|
42
|
+
"@compatibility_alias"
|
|
43
|
+
"@property"
|
|
44
|
+
"@selector"
|
|
45
|
+
"@defs"
|
|
46
|
+
"availability"
|
|
47
|
+
"@end"
|
|
48
|
+
] @keyword
|
|
49
|
+
|
|
50
|
+
(class_declaration "@" @keyword "class" @keyword) ; I hate Obj-C for allowing "@ class" :)
|
|
51
|
+
|
|
52
|
+
(method_definition ["+" "-"] @keyword.function)
|
|
53
|
+
(method_declaration ["+" "-"] @keyword.function)
|
|
54
|
+
|
|
55
|
+
[
|
|
56
|
+
"__typeof__"
|
|
57
|
+
"__typeof"
|
|
58
|
+
"typeof"
|
|
59
|
+
"in"
|
|
60
|
+
] @keyword.operator
|
|
61
|
+
|
|
62
|
+
[
|
|
63
|
+
"@synchronized"
|
|
64
|
+
"oneway"
|
|
65
|
+
] @keyword.coroutine
|
|
66
|
+
|
|
67
|
+
; Exceptions
|
|
68
|
+
|
|
69
|
+
[
|
|
70
|
+
"@try"
|
|
71
|
+
"__try"
|
|
72
|
+
"@catch"
|
|
73
|
+
"__catch"
|
|
74
|
+
"@finally"
|
|
75
|
+
"__finally"
|
|
76
|
+
"@throw"
|
|
77
|
+
] @exception
|
|
78
|
+
|
|
79
|
+
; Variables
|
|
80
|
+
|
|
81
|
+
((identifier) @variable.builtin
|
|
82
|
+
(#any-of? @variable.builtin "self" "super"))
|
|
83
|
+
|
|
84
|
+
; Functions & Methods
|
|
85
|
+
|
|
86
|
+
[
|
|
87
|
+
"objc_bridge_related"
|
|
88
|
+
"@available"
|
|
89
|
+
"__builtin_available"
|
|
90
|
+
"va_arg"
|
|
91
|
+
"asm"
|
|
92
|
+
] @function.builtin
|
|
93
|
+
|
|
94
|
+
(method_definition (identifier) @method)
|
|
95
|
+
|
|
96
|
+
(method_declaration (identifier) @method)
|
|
97
|
+
|
|
98
|
+
(method_identifier (identifier)? @method ":" @method (identifier)? @method)
|
|
99
|
+
|
|
100
|
+
(message_expression method: (identifier) @method.call)
|
|
101
|
+
|
|
102
|
+
; Constructors
|
|
103
|
+
|
|
104
|
+
((message_expression method: (identifier) @constructor)
|
|
105
|
+
(#eq? @constructor "init"))
|
|
106
|
+
|
|
107
|
+
; Attributes
|
|
108
|
+
|
|
109
|
+
(availability_attribute_specifier
|
|
110
|
+
[
|
|
111
|
+
"CF_FORMAT_FUNCTION" "NS_AVAILABLE" "__IOS_AVAILABLE" "NS_AVAILABLE_IOS"
|
|
112
|
+
"API_AVAILABLE" "API_UNAVAILABLE" "API_DEPRECATED" "NS_ENUM_AVAILABLE_IOS"
|
|
113
|
+
"NS_DEPRECATED_IOS" "NS_ENUM_DEPRECATED_IOS" "NS_FORMAT_FUNCTION" "DEPRECATED_MSG_ATTRIBUTE"
|
|
114
|
+
"__deprecated_msg" "__deprecated_enum_msg" "NS_SWIFT_NAME" "NS_SWIFT_UNAVAILABLE"
|
|
115
|
+
"NS_EXTENSION_UNAVAILABLE_IOS" "NS_CLASS_AVAILABLE_IOS" "NS_CLASS_DEPRECATED_IOS" "__OSX_AVAILABLE_STARTING"
|
|
116
|
+
"NS_ROOT_CLASS" "NS_UNAVAILABLE" "NS_REQUIRES_NIL_TERMINATION" "CF_RETURNS_RETAINED"
|
|
117
|
+
"CF_RETURNS_NOT_RETAINED" "DEPRECATED_ATTRIBUTE" "UI_APPEARANCE_SELECTOR" "UNAVAILABLE_ATTRIBUTE"
|
|
118
|
+
]) @attribute
|
|
119
|
+
|
|
120
|
+
; Macros
|
|
121
|
+
|
|
122
|
+
(type_qualifier
|
|
123
|
+
[
|
|
124
|
+
"_Complex"
|
|
125
|
+
"_Nonnull"
|
|
126
|
+
"_Nullable"
|
|
127
|
+
"_Nullable_result"
|
|
128
|
+
"_Null_unspecified"
|
|
129
|
+
"__autoreleasing"
|
|
130
|
+
"__block"
|
|
131
|
+
"__bridge"
|
|
132
|
+
"__bridge_retained"
|
|
133
|
+
"__bridge_transfer"
|
|
134
|
+
"__complex"
|
|
135
|
+
"__kindof"
|
|
136
|
+
"__nonnull"
|
|
137
|
+
"__nullable"
|
|
138
|
+
"__ptrauth_objc_class_ro"
|
|
139
|
+
"__ptrauth_objc_isa_pointer"
|
|
140
|
+
"__ptrauth_objc_super_pointer"
|
|
141
|
+
"__strong"
|
|
142
|
+
"__thread"
|
|
143
|
+
"__unsafe_unretained"
|
|
144
|
+
"__unused"
|
|
145
|
+
"__weak"
|
|
146
|
+
]) @function.macro.builtin
|
|
147
|
+
|
|
148
|
+
[ "__real" "__imag" ] @function.macro.builtin
|
|
149
|
+
|
|
150
|
+
((call_expression function: (identifier) @function.macro)
|
|
151
|
+
(#eq? @function.macro "testassert"))
|
|
152
|
+
|
|
153
|
+
; Types
|
|
154
|
+
|
|
155
|
+
(class_declaration (identifier) @type)
|
|
156
|
+
|
|
157
|
+
(class_interface "@interface" . (identifier) @type superclass: _? @type category: _? @namespace)
|
|
158
|
+
|
|
159
|
+
(class_implementation "@implementation" . (identifier) @type superclass: _? @type category: _? @namespace)
|
|
160
|
+
|
|
161
|
+
(protocol_forward_declaration (identifier) @type) ; @interface :(
|
|
162
|
+
|
|
163
|
+
(protocol_reference_list (identifier) @type) ; ^
|
|
164
|
+
|
|
165
|
+
[
|
|
166
|
+
"BOOL"
|
|
167
|
+
"IMP"
|
|
168
|
+
"SEL"
|
|
169
|
+
"Class"
|
|
170
|
+
"id"
|
|
171
|
+
] @type.builtin
|
|
172
|
+
|
|
173
|
+
; Constants
|
|
174
|
+
|
|
175
|
+
(property_attribute (identifier) @constant "="?)
|
|
176
|
+
|
|
177
|
+
[ "__asm" "__asm__" ] @constant.macro
|
|
178
|
+
|
|
179
|
+
; Properties
|
|
180
|
+
|
|
181
|
+
(property_implementation "@synthesize" (identifier) @property)
|
|
182
|
+
|
|
183
|
+
((identifier) @property
|
|
184
|
+
(#has-ancestor? @property struct_declaration))
|
|
185
|
+
|
|
186
|
+
; Parameters
|
|
187
|
+
|
|
188
|
+
(method_parameter ":" @method (identifier) @parameter)
|
|
189
|
+
|
|
190
|
+
(method_parameter declarator: (identifier) @parameter)
|
|
191
|
+
|
|
192
|
+
(parameter_declaration
|
|
193
|
+
declarator: (function_declarator
|
|
194
|
+
declarator: (parenthesized_declarator
|
|
195
|
+
(block_pointer_declarator
|
|
196
|
+
declarator: (identifier) @parameter))))
|
|
197
|
+
|
|
198
|
+
"..." @parameter.builtin
|
|
199
|
+
|
|
200
|
+
; Operators
|
|
201
|
+
|
|
202
|
+
[
|
|
203
|
+
"^"
|
|
204
|
+
] @operator
|
|
205
|
+
|
|
206
|
+
; Literals
|
|
207
|
+
|
|
208
|
+
(platform) @string.special
|
|
209
|
+
|
|
210
|
+
(version_number) @text.uri @number
|
|
211
|
+
|
|
212
|
+
; Punctuation
|
|
213
|
+
|
|
214
|
+
"@" @punctuation.special
|
|
215
|
+
|
|
216
|
+
[ "<" ">" ] @punctuation.bracket
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
; Punctuation
|
|
2
|
+
;------------
|
|
3
|
+
|
|
4
|
+
[
|
|
5
|
+
"," "." ";" ":" "=" "|" "~" "?" "+" "-" "!" ">" "&"
|
|
6
|
+
"->" ";;" ":>" "+=" ":=" ".."
|
|
7
|
+
] @punctuation.delimiter
|
|
8
|
+
|
|
9
|
+
["(" ")" "[" "]" "{" "}" "[|" "|]" "[<" "[>"] @punctuation.bracket
|
|
10
|
+
|
|
11
|
+
(object_type ["<" ">"] @punctuation.bracket)
|
|
12
|
+
|
|
13
|
+
"%" @punctuation.special
|
|
14
|
+
|
|
15
|
+
(attribute ["[@" "]"] @punctuation.special)
|
|
16
|
+
(item_attribute ["[@@" "]"] @punctuation.special)
|
|
17
|
+
(floating_attribute ["[@@@" "]"] @punctuation.special)
|
|
18
|
+
(extension ["[%" "]"] @punctuation.special)
|
|
19
|
+
(item_extension ["[%%" "]"] @punctuation.special)
|
|
20
|
+
(quoted_extension ["{%" "}"] @punctuation.special)
|
|
21
|
+
(quoted_item_extension ["{%%" "}"] @punctuation.special)
|
|
22
|
+
|
|
23
|
+
; Keywords
|
|
24
|
+
;---------
|
|
25
|
+
|
|
26
|
+
[
|
|
27
|
+
"and" "as" "assert" "begin" "class" "constraint" "do" "done" "downto" "effect"
|
|
28
|
+
"else" "end" "exception" "external" "for" "fun" "function" "functor" "if" "in"
|
|
29
|
+
"include" "inherit" "initializer" "lazy" "let" "match" "method" "module"
|
|
30
|
+
"mutable" "new" "nonrec" "object" "of" "open" "private" "rec" "sig" "struct"
|
|
31
|
+
"then" "to" "try" "type" "val" "virtual" "when" "while" "with"
|
|
32
|
+
] @keyword
|
|
33
|
+
|
|
34
|
+
; Operators
|
|
35
|
+
;----------
|
|
36
|
+
|
|
37
|
+
[
|
|
38
|
+
(prefix_operator)
|
|
39
|
+
(sign_operator)
|
|
40
|
+
(pow_operator)
|
|
41
|
+
(mult_operator)
|
|
42
|
+
(add_operator)
|
|
43
|
+
(concat_operator)
|
|
44
|
+
(rel_operator)
|
|
45
|
+
(and_operator)
|
|
46
|
+
(or_operator)
|
|
47
|
+
(assign_operator)
|
|
48
|
+
(hash_operator)
|
|
49
|
+
(indexing_operator)
|
|
50
|
+
(let_operator)
|
|
51
|
+
(let_and_operator)
|
|
52
|
+
(match_operator)
|
|
53
|
+
] @operator
|
|
54
|
+
|
|
55
|
+
(match_expression (match_operator) @keyword)
|
|
56
|
+
|
|
57
|
+
(value_definition [(let_operator) (let_and_operator)] @keyword)
|
|
58
|
+
|
|
59
|
+
["*" "#" "::" "<-"] @operator
|
|
60
|
+
|
|
61
|
+
; Constants
|
|
62
|
+
;----------
|
|
63
|
+
|
|
64
|
+
(boolean) @constant
|
|
65
|
+
|
|
66
|
+
[(number) (signed_number)] @number
|
|
67
|
+
|
|
68
|
+
[(string) (character)] @string
|
|
69
|
+
|
|
70
|
+
(quoted_string "{" @string "}" @string) @string
|
|
71
|
+
|
|
72
|
+
(escape_sequence) @escape
|
|
73
|
+
|
|
74
|
+
(conversion_specification) @string.special
|
|
75
|
+
|
|
76
|
+
; Variables
|
|
77
|
+
;----------
|
|
78
|
+
|
|
79
|
+
[(value_name) (type_variable)] @variable
|
|
80
|
+
|
|
81
|
+
(value_pattern) @variable.parameter
|
|
82
|
+
|
|
83
|
+
; Properties
|
|
84
|
+
;-----------
|
|
85
|
+
|
|
86
|
+
[(label_name) (field_name) (instance_variable_name)] @property
|
|
87
|
+
|
|
88
|
+
; Functions
|
|
89
|
+
;----------
|
|
90
|
+
|
|
91
|
+
(let_binding
|
|
92
|
+
pattern: (value_name) @function
|
|
93
|
+
(parameter))
|
|
94
|
+
|
|
95
|
+
(let_binding
|
|
96
|
+
pattern: (value_name) @function
|
|
97
|
+
body: [(fun_expression) (function_expression)])
|
|
98
|
+
|
|
99
|
+
(value_specification (value_name) @function)
|
|
100
|
+
|
|
101
|
+
(external (value_name) @function)
|
|
102
|
+
|
|
103
|
+
(method_name) @function.method
|
|
104
|
+
|
|
105
|
+
(application_expression
|
|
106
|
+
function: (value_path (value_name) @function))
|
|
107
|
+
|
|
108
|
+
(infix_expression
|
|
109
|
+
left: (value_path (value_name) @function)
|
|
110
|
+
operator: (concat_operator) @operator
|
|
111
|
+
(#eq? @operator "@@"))
|
|
112
|
+
|
|
113
|
+
(infix_expression
|
|
114
|
+
operator: (rel_operator) @operator
|
|
115
|
+
right: (value_path (value_name) @function)
|
|
116
|
+
(#eq? @operator "|>"))
|
|
117
|
+
|
|
118
|
+
(
|
|
119
|
+
(value_name) @function.builtin
|
|
120
|
+
(#match? @function.builtin "^(raise(_notrace)?|failwith|invalid_arg)$")
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
; Types
|
|
124
|
+
;------
|
|
125
|
+
|
|
126
|
+
[(class_name) (class_type_name) (type_constructor)] @type
|
|
127
|
+
|
|
128
|
+
(
|
|
129
|
+
(type_constructor) @type.builtin
|
|
130
|
+
(#match? @type.builtin "^(int|char|bytes|string|float|bool|unit|exn|array|list|option|int32|int64|nativeint|format6|lazy_t)$")
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
[(constructor_name) (tag)] @constructor
|
|
134
|
+
|
|
135
|
+
; Modules
|
|
136
|
+
;--------
|
|
137
|
+
|
|
138
|
+
[(module_name) (module_type_name)] @module
|
|
139
|
+
|
|
140
|
+
; Attributes
|
|
141
|
+
;-----------
|
|
142
|
+
|
|
143
|
+
(attribute_id) @tag
|
|
144
|
+
|
|
145
|
+
; Comments
|
|
146
|
+
;---------
|
|
147
|
+
|
|
148
|
+
[(comment) (line_number_directive) (directive) (shebang)] @comment
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../parsers/index.ts"],"names":[],"mappings":"AAwEA,eAAO,MAAM,OAAO;;;;;;GAqJnB,CAAC"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
[
|
|
2
|
+
(php_tag)
|
|
3
|
+
(php_end_tag)
|
|
4
|
+
] @tag
|
|
5
|
+
|
|
6
|
+
; Keywords
|
|
7
|
+
|
|
8
|
+
[
|
|
9
|
+
"and"
|
|
10
|
+
"as"
|
|
11
|
+
"break"
|
|
12
|
+
"case"
|
|
13
|
+
"catch"
|
|
14
|
+
"class"
|
|
15
|
+
"clone"
|
|
16
|
+
"const"
|
|
17
|
+
"continue"
|
|
18
|
+
"declare"
|
|
19
|
+
"default"
|
|
20
|
+
"do"
|
|
21
|
+
"echo"
|
|
22
|
+
"else"
|
|
23
|
+
"elseif"
|
|
24
|
+
"enddeclare"
|
|
25
|
+
"endfor"
|
|
26
|
+
"endforeach"
|
|
27
|
+
"endif"
|
|
28
|
+
"endswitch"
|
|
29
|
+
"endwhile"
|
|
30
|
+
"enum"
|
|
31
|
+
"exit"
|
|
32
|
+
"extends"
|
|
33
|
+
"finally"
|
|
34
|
+
"fn"
|
|
35
|
+
"for"
|
|
36
|
+
"foreach"
|
|
37
|
+
"function"
|
|
38
|
+
"global"
|
|
39
|
+
"goto"
|
|
40
|
+
"if"
|
|
41
|
+
"implements"
|
|
42
|
+
"include"
|
|
43
|
+
"include_once"
|
|
44
|
+
"instanceof"
|
|
45
|
+
"insteadof"
|
|
46
|
+
"interface"
|
|
47
|
+
"match"
|
|
48
|
+
"namespace"
|
|
49
|
+
"new"
|
|
50
|
+
"or"
|
|
51
|
+
"print"
|
|
52
|
+
"require"
|
|
53
|
+
"require_once"
|
|
54
|
+
"return"
|
|
55
|
+
"switch"
|
|
56
|
+
"throw"
|
|
57
|
+
"trait"
|
|
58
|
+
"try"
|
|
59
|
+
"use"
|
|
60
|
+
"while"
|
|
61
|
+
"xor"
|
|
62
|
+
"yield"
|
|
63
|
+
"yield from"
|
|
64
|
+
(abstract_modifier)
|
|
65
|
+
(final_modifier)
|
|
66
|
+
(readonly_modifier)
|
|
67
|
+
(static_modifier)
|
|
68
|
+
(visibility_modifier)
|
|
69
|
+
] @keyword
|
|
70
|
+
|
|
71
|
+
(function_static_declaration "static" @keyword)
|
|
72
|
+
|
|
73
|
+
; Namespace
|
|
74
|
+
|
|
75
|
+
(namespace_definition
|
|
76
|
+
name: (namespace_name
|
|
77
|
+
(name) @module))
|
|
78
|
+
|
|
79
|
+
(namespace_name
|
|
80
|
+
(name) @module)
|
|
81
|
+
|
|
82
|
+
(namespace_use_clause
|
|
83
|
+
[
|
|
84
|
+
(name) @type
|
|
85
|
+
(qualified_name
|
|
86
|
+
(name) @type)
|
|
87
|
+
alias: (name) @type
|
|
88
|
+
])
|
|
89
|
+
|
|
90
|
+
(namespace_use_clause
|
|
91
|
+
type: "function"
|
|
92
|
+
[
|
|
93
|
+
(name) @function
|
|
94
|
+
(qualified_name
|
|
95
|
+
(name) @function)
|
|
96
|
+
alias: (name) @function
|
|
97
|
+
])
|
|
98
|
+
|
|
99
|
+
(namespace_use_clause
|
|
100
|
+
type: "const"
|
|
101
|
+
[
|
|
102
|
+
(name) @constant
|
|
103
|
+
(qualified_name
|
|
104
|
+
(name) @constant)
|
|
105
|
+
alias: (name) @constant
|
|
106
|
+
])
|
|
107
|
+
|
|
108
|
+
(relative_name "namespace" @module.builtin)
|
|
109
|
+
|
|
110
|
+
; Variables
|
|
111
|
+
|
|
112
|
+
(relative_scope) @variable.builtin
|
|
113
|
+
|
|
114
|
+
(variable_name) @variable
|
|
115
|
+
|
|
116
|
+
(method_declaration name: (name) @constructor
|
|
117
|
+
(#eq? @constructor "__construct"))
|
|
118
|
+
|
|
119
|
+
(object_creation_expression [
|
|
120
|
+
(name) @constructor
|
|
121
|
+
(qualified_name (name) @constructor)
|
|
122
|
+
(relative_name (name) @constructor)
|
|
123
|
+
])
|
|
124
|
+
|
|
125
|
+
((name) @constant
|
|
126
|
+
(#match? @constant "^_?[A-Z][A-Z\\d_]+$"))
|
|
127
|
+
((name) @constant.builtin
|
|
128
|
+
(#match? @constant.builtin "^__[A-Z][A-Z\d_]+__$"))
|
|
129
|
+
(const_declaration (const_element (name) @constant))
|
|
130
|
+
|
|
131
|
+
; Types
|
|
132
|
+
|
|
133
|
+
(primitive_type) @type.builtin
|
|
134
|
+
(cast_type) @type.builtin
|
|
135
|
+
(named_type [
|
|
136
|
+
(name) @type
|
|
137
|
+
(qualified_name (name) @type)
|
|
138
|
+
(relative_name (name) @type)
|
|
139
|
+
]) @type
|
|
140
|
+
(named_type (name) @type.builtin
|
|
141
|
+
(#any-of? @type.builtin "static" "self"))
|
|
142
|
+
|
|
143
|
+
(scoped_call_expression
|
|
144
|
+
scope: [
|
|
145
|
+
(name) @type
|
|
146
|
+
(qualified_name (name) @type)
|
|
147
|
+
(relative_name (name) @type)
|
|
148
|
+
])
|
|
149
|
+
|
|
150
|
+
; Functions
|
|
151
|
+
|
|
152
|
+
(array_creation_expression "array" @function.builtin)
|
|
153
|
+
(list_literal "list" @function.builtin)
|
|
154
|
+
(exit_statement "exit" @function.builtin "(")
|
|
155
|
+
|
|
156
|
+
(method_declaration
|
|
157
|
+
name: (name) @function.method)
|
|
158
|
+
|
|
159
|
+
(function_call_expression
|
|
160
|
+
function: [
|
|
161
|
+
(qualified_name (name))
|
|
162
|
+
(relative_name (name))
|
|
163
|
+
(name)
|
|
164
|
+
] @function)
|
|
165
|
+
|
|
166
|
+
(scoped_call_expression
|
|
167
|
+
name: (name) @function)
|
|
168
|
+
|
|
169
|
+
(member_call_expression
|
|
170
|
+
name: (name) @function.method)
|
|
171
|
+
|
|
172
|
+
(function_definition
|
|
173
|
+
name: (name) @function)
|
|
174
|
+
|
|
175
|
+
; Member
|
|
176
|
+
|
|
177
|
+
(property_element
|
|
178
|
+
(variable_name) @property)
|
|
179
|
+
|
|
180
|
+
(member_access_expression
|
|
181
|
+
name: (variable_name (name)) @property)
|
|
182
|
+
(member_access_expression
|
|
183
|
+
name: (name) @property)
|
|
184
|
+
|
|
185
|
+
; Basic tokens
|
|
186
|
+
[
|
|
187
|
+
(string)
|
|
188
|
+
(string_content)
|
|
189
|
+
(encapsed_string)
|
|
190
|
+
(heredoc)
|
|
191
|
+
(heredoc_body)
|
|
192
|
+
(nowdoc_body)
|
|
193
|
+
] @string
|
|
194
|
+
(boolean) @constant.builtin
|
|
195
|
+
(null) @constant.builtin
|
|
196
|
+
(integer) @number
|
|
197
|
+
(float) @number
|
|
198
|
+
(comment) @comment
|
|
199
|
+
|
|
200
|
+
((name) @variable.builtin
|
|
201
|
+
(#eq? @variable.builtin "this"))
|
|
202
|
+
|
|
203
|
+
"$" @operator
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
; Identifier naming conventions
|
|
2
|
+
|
|
3
|
+
(identifier) @variable
|
|
4
|
+
|
|
5
|
+
((identifier) @constructor
|
|
6
|
+
(#match? @constructor "^[A-Z]"))
|
|
7
|
+
|
|
8
|
+
((identifier) @constant
|
|
9
|
+
(#match? @constant "^[A-Z][A-Z_]*$"))
|
|
10
|
+
|
|
11
|
+
; Function calls
|
|
12
|
+
|
|
13
|
+
(decorator) @function
|
|
14
|
+
(decorator
|
|
15
|
+
(identifier) @function)
|
|
16
|
+
|
|
17
|
+
(call
|
|
18
|
+
function: (attribute attribute: (identifier) @function.method))
|
|
19
|
+
(call
|
|
20
|
+
function: (identifier) @function)
|
|
21
|
+
|
|
22
|
+
; Builtin functions
|
|
23
|
+
|
|
24
|
+
((call
|
|
25
|
+
function: (identifier) @function.builtin)
|
|
26
|
+
(#match?
|
|
27
|
+
@function.builtin
|
|
28
|
+
"^(abs|all|any|ascii|bin|bool|breakpoint|bytearray|bytes|callable|chr|classmethod|compile|complex|delattr|dict|dir|divmod|enumerate|eval|exec|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|isinstance|issubclass|iter|len|list|locals|map|max|memoryview|min|next|object|oct|open|ord|pow|print|property|range|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|vars|zip|__import__)$"))
|
|
29
|
+
|
|
30
|
+
; Function definitions
|
|
31
|
+
|
|
32
|
+
(function_definition
|
|
33
|
+
name: (identifier) @function)
|
|
34
|
+
|
|
35
|
+
(attribute attribute: (identifier) @property)
|
|
36
|
+
(type (identifier) @type)
|
|
37
|
+
|
|
38
|
+
; Literals
|
|
39
|
+
|
|
40
|
+
[
|
|
41
|
+
(none)
|
|
42
|
+
(true)
|
|
43
|
+
(false)
|
|
44
|
+
] @constant.builtin
|
|
45
|
+
|
|
46
|
+
[
|
|
47
|
+
(integer)
|
|
48
|
+
(float)
|
|
49
|
+
] @number
|
|
50
|
+
|
|
51
|
+
(comment) @comment
|
|
52
|
+
(string) @string
|
|
53
|
+
(escape_sequence) @escape
|
|
54
|
+
|
|
55
|
+
(interpolation
|
|
56
|
+
"{" @punctuation.special
|
|
57
|
+
"}" @punctuation.special) @embedded
|
|
58
|
+
|
|
59
|
+
[
|
|
60
|
+
"-"
|
|
61
|
+
"-="
|
|
62
|
+
"!="
|
|
63
|
+
"*"
|
|
64
|
+
"**"
|
|
65
|
+
"**="
|
|
66
|
+
"*="
|
|
67
|
+
"/"
|
|
68
|
+
"//"
|
|
69
|
+
"//="
|
|
70
|
+
"/="
|
|
71
|
+
"&"
|
|
72
|
+
"&="
|
|
73
|
+
"%"
|
|
74
|
+
"%="
|
|
75
|
+
"^"
|
|
76
|
+
"^="
|
|
77
|
+
"+"
|
|
78
|
+
"->"
|
|
79
|
+
"+="
|
|
80
|
+
"<"
|
|
81
|
+
"<<"
|
|
82
|
+
"<<="
|
|
83
|
+
"<="
|
|
84
|
+
"<>"
|
|
85
|
+
"="
|
|
86
|
+
":="
|
|
87
|
+
"=="
|
|
88
|
+
">"
|
|
89
|
+
">="
|
|
90
|
+
">>"
|
|
91
|
+
">>="
|
|
92
|
+
"|"
|
|
93
|
+
"|="
|
|
94
|
+
"~"
|
|
95
|
+
"@="
|
|
96
|
+
"and"
|
|
97
|
+
"in"
|
|
98
|
+
"is"
|
|
99
|
+
"not"
|
|
100
|
+
"or"
|
|
101
|
+
"is not"
|
|
102
|
+
"not in"
|
|
103
|
+
] @operator
|
|
104
|
+
|
|
105
|
+
[
|
|
106
|
+
"as"
|
|
107
|
+
"assert"
|
|
108
|
+
"async"
|
|
109
|
+
"await"
|
|
110
|
+
"break"
|
|
111
|
+
"class"
|
|
112
|
+
"continue"
|
|
113
|
+
"def"
|
|
114
|
+
"del"
|
|
115
|
+
"elif"
|
|
116
|
+
"else"
|
|
117
|
+
"except"
|
|
118
|
+
"exec"
|
|
119
|
+
"finally"
|
|
120
|
+
"for"
|
|
121
|
+
"from"
|
|
122
|
+
"global"
|
|
123
|
+
"if"
|
|
124
|
+
"import"
|
|
125
|
+
"lambda"
|
|
126
|
+
"nonlocal"
|
|
127
|
+
"pass"
|
|
128
|
+
"print"
|
|
129
|
+
"raise"
|
|
130
|
+
"return"
|
|
131
|
+
"try"
|
|
132
|
+
"while"
|
|
133
|
+
"with"
|
|
134
|
+
"yield"
|
|
135
|
+
"match"
|
|
136
|
+
"case"
|
|
137
|
+
] @keyword
|