|
60 | 60 | 'name': 'meta.class.js'
|
61 | 61 | }
|
62 | 62 | {
|
63 |
| - 'begin': '([a-zA-Z_?.$][\\w?.$]*)\\.(prototype)\\.([a-zA-Z_?.$][\\w?.$]*)\\s*(=)\\s*(?:(async)(?:\\s+))?(function\\*?)\\s*(\\*?)(\\()' |
| 63 | + 'begin': '([a-zA-Z_?.$][\\w?.$]*)\\.(prototype)\\.([a-zA-Z_?.$][\\w?.$]*)\\s*(=)\\s*(?:(async)(?:\\s+))?(function\\*?)\\s*(\\*?)(?=\\()' |
64 | 64 | 'beginCaptures':
|
65 | 65 | '1':
|
66 | 66 | 'name': 'support.class.js'
|
|
76 | 76 | 'name': 'storage.type.function.js'
|
77 | 77 | '7':
|
78 | 78 | 'name': 'storage.type.function.js'
|
79 |
| - '8': |
80 |
| - 'name': 'punctuation.definition.parameters.begin.js' |
81 | 79 | 'comment': 'match stuff like: Sound.prototype.play = function() { … }'
|
82 |
| - 'end': '(\\))' |
| 80 | + 'end': '\\}' |
83 | 81 | 'endCaptures':
|
84 |
| - '1': |
85 |
| - 'name': 'punctuation.definition.parameters.end.js' |
| 82 | + '0': |
| 83 | + 'name': 'punctuation.definition.function.body.end.js' |
86 | 84 | 'name': 'meta.function.prototype.js'
|
87 | 85 | 'patterns': [
|
88 | 86 | {
|
89 | 87 | 'include': '#function-params'
|
90 | 88 | }
|
| 89 | + { |
| 90 | + 'include': '#function-body' |
| 91 | + } |
91 | 92 | ]
|
92 | 93 | }
|
93 | 94 | {
|
|
105 | 106 | 'name': 'meta.function.js'
|
106 | 107 | }
|
107 | 108 | {
|
108 |
| - 'begin': '([a-zA-Z_?.$][\\w?.$]*)\\.([a-zA-Z_?.$][\\w?.$]*)\\s*(=)\\s*(?:(async)(?:\\s+))?(function\\*?)\\s*(\\*?)\\s*([a-zA-Z_?$][\\w?$]*)?\\s*(\\()' |
| 109 | + 'begin': '([a-zA-Z_?.$][\\w?.$]*)\\.([a-zA-Z_?.$][\\w?.$]*)\\s*(=)\\s*(?:(async)(?:\\s+))?(function\\*?)\\s*(\\*?)\\s*([a-zA-Z_?$][\\w?$]*)?\\s*(?=\\()' |
109 | 110 | 'beginCaptures':
|
110 | 111 | '1':
|
111 | 112 | 'name': 'support.class.js'
|
|
124 | 125 | '8':
|
125 | 126 | 'name': 'punctuation.definition.parameters.begin.js'
|
126 | 127 | 'comment': 'match stuff like: Sound.play = function() { … }'
|
127 |
| - 'end': '(\\))' |
| 128 | + 'end': '\\}' |
128 | 129 | 'endCaptures':
|
129 |
| - '1': |
130 |
| - 'name': 'punctuation.definition.parameters.end.js' |
| 130 | + '0': |
| 131 | + 'name': 'punctuation.definition.function.body.end.js' |
131 | 132 | 'name': 'meta.function.js'
|
132 | 133 | 'patterns': [
|
133 | 134 | {
|
134 | 135 | 'include': '#function-params'
|
135 | 136 | }
|
| 137 | + { |
| 138 | + 'include': '#function-body' |
| 139 | + } |
136 | 140 | ]
|
137 | 141 | }
|
138 | 142 | {
|
139 |
| - 'begin': '([a-zA-Z_?$][\\w?$]*)\\s*(=)\\s*(?:(async)(?:\\s+))?(function\\*?)\\s*(\\*?)\\s*([a-zA-Z_?$][\\w?$]*)?\\s*(\\()' |
| 143 | + 'begin': '([a-zA-Z_?$][\\w?$]*)\\s*(=)\\s*(?:(async)(?:\\s+))?(function\\*?)\\s*(\\*?)\\s*([a-zA-Z_?$][\\w?$]*)?\\s*(?=\\()' |
140 | 144 | 'beginCaptures':
|
141 | 145 | '1':
|
142 | 146 | 'name': 'entity.name.function.js'
|
|
153 | 157 | '7':
|
154 | 158 | 'name': 'punctuation.definition.parameters.begin.js'
|
155 | 159 | 'comment': 'match stuff like: play = function() { … }'
|
156 |
| - 'end': '(\\))' |
| 160 | + 'end': '\\}' |
157 | 161 | 'endCaptures':
|
158 |
| - '1': |
159 |
| - 'name': 'punctuation.definition.parameters.end.js' |
| 162 | + '0': |
| 163 | + 'name': 'punctuation.definition.function.body.end.js' |
160 | 164 | 'name': 'meta.function.js'
|
161 | 165 | 'patterns': [
|
162 | 166 | {
|
163 | 167 | 'include': '#function-params'
|
164 | 168 | }
|
| 169 | + { |
| 170 | + 'include': '#function-body' |
| 171 | + } |
165 | 172 | ]
|
166 | 173 | }
|
167 | 174 | {
|
168 |
| - 'begin': '\\b(?:(async)(?:\\s+))?(function\\*?)\\s*((\\*)|(?:(?:\\s+)(\\*?[a-zA-Z_$]\\w*)))?\\s*(\\()' |
| 175 | + 'begin': '\\b(?:(async)(?:\\s+))?(function\\*?)\\s*((\\*)|(?:(?:\\s+)(\\*?[a-zA-Z_$]\\w*)))?\\s*(?=\\()' |
169 | 176 | 'beginCaptures':
|
170 | 177 | '1':
|
171 | 178 | 'name': 'storage.modifier.js'
|
|
178 | 185 | '6':
|
179 | 186 | 'name': 'punctuation.definition.parameters.begin.js'
|
180 | 187 | 'comment': 'match regular function like: function myFunc(arg) { … }'
|
181 |
| - 'end': '(\\))' |
| 188 | + 'end': '\\}' |
182 | 189 | 'endCaptures':
|
183 |
| - '1': |
184 |
| - 'name': 'punctuation.definition.parameters.end.js' |
| 190 | + '0': |
| 191 | + 'name': 'punctuation.definition.function.body.end.js' |
185 | 192 | 'name': 'meta.function.js'
|
186 | 193 | 'patterns': [
|
187 | 194 | {
|
188 | 195 | 'include': '#function-params'
|
189 | 196 | }
|
| 197 | + { |
| 198 | + 'include': '#function-body' |
| 199 | + } |
190 | 200 | ]
|
191 | 201 | }
|
192 | 202 | {
|
193 |
| - 'begin': '\\b([a-zA-Z_?.$][\\w?.$]*)\\s*(:)\\s*\\b(?:(async)(?:\\s+))?(function\\*?)\\s*(\\*?)\\s*([a-zA-Z_?$][\\w?$]*)?\\s*(\\()' |
| 203 | + 'begin': '\\b([a-zA-Z_?.$][\\w?.$]*)\\s*(:)\\s*\\b(?:(async)(?:\\s+))?(function\\*?)\\s*(\\*?)\\s*([a-zA-Z_?$][\\w?$]*)?\\s*(?=\\()' |
194 | 204 | 'beginCaptures':
|
195 | 205 | '1':
|
196 | 206 | 'name': 'entity.name.function.js'
|
|
207 | 217 | '7':
|
208 | 218 | 'name': 'punctuation.definition.parameters.begin.js'
|
209 | 219 | 'comment': 'match stuff like: foobar: function() { … }'
|
210 |
| - 'end': '(\\))' |
| 220 | + 'end': '\\}' |
211 | 221 | 'endCaptures':
|
212 |
| - '1': |
213 |
| - 'name': 'punctuation.definition.parameters.end.js' |
| 222 | + '0': |
| 223 | + 'name': 'punctuation.definition.function.body.end.js' |
214 | 224 | 'name': 'meta.function.json.js'
|
215 | 225 | 'patterns': [
|
216 | 226 | {
|
217 | 227 | 'include': '#function-params'
|
218 | 228 | }
|
| 229 | + { |
| 230 | + 'include': '#function-body' |
| 231 | + } |
219 | 232 | ]
|
220 | 233 | }
|
221 | 234 | {
|
222 |
| - 'begin': '(?:((\')([^\']*?)(\'))|((")([^"]*?)(")))\\s*(:)\\s*\\b(?:(async)(?:\\s+))?(function\\*?)\\s*(\\*?)\\s*([a-zA-Z_?$][\\w?$]*)?\\s*(\\()' |
| 235 | + 'begin': '(?:((\')([^\']*?)(\'))|((")([^"]*?)(")))\\s*(:)\\s*\\b(?:(async)(?:\\s+))?(function\\*?)\\s*(\\*?)\\s*([a-zA-Z_?$][\\w?$]*)?\\s*(?=\\()' |
223 | 236 | 'beginCaptures':
|
224 | 237 | '1':
|
225 | 238 | 'name': 'string.quoted.single.js'
|
|
250 | 263 | '14':
|
251 | 264 | 'name': 'punctuation.definition.parameters.begin.js'
|
252 | 265 | 'comment': 'Attempt to match "foo": function'
|
253 |
| - 'end': '(\\))' |
| 266 | + 'end': '\\}' |
254 | 267 | 'endCaptures':
|
255 |
| - '1': |
256 |
| - 'name': 'punctuation.definition.parameters.end.js' |
| 268 | + '0': |
| 269 | + 'name': 'punctuation.definition.function.body.end.js' |
257 | 270 | 'name': 'meta.function.json.js'
|
258 | 271 | 'patterns': [
|
259 | 272 | {
|
260 | 273 | 'include': '#function-params'
|
261 | 274 | }
|
| 275 | + { |
| 276 | + 'include': '#function-body' |
| 277 | + } |
262 | 278 | ]
|
263 | 279 | }
|
264 | 280 | {
|
265 |
| - 'begin': '\\b(constructor)\\s*(\\()' |
| 281 | + 'begin': '\\b(constructor)\\s*(?=\\()' |
266 | 282 | 'beginCaptures':
|
267 | 283 | '1':
|
268 | 284 | 'name': 'entity.name.function.constructor.js'
|
269 | 285 | '2':
|
270 | 286 | 'name': 'punctuation.definition.parameters.begin.js'
|
271 |
| - 'end': '(\\))' |
| 287 | + 'end': '\\}' |
272 | 288 | 'endCaptures':
|
273 |
| - '1': |
274 |
| - 'name': 'punctuation.definition.parameters.end.js' |
| 289 | + '0': |
| 290 | + 'name': 'punctuation.definition.function.body.end.js' |
275 | 291 | 'patterns': [
|
276 | 292 | {
|
277 | 293 | 'include': '#function-params'
|
278 | 294 | }
|
| 295 | + { |
| 296 | + 'include': '#function-body' |
| 297 | + } |
279 | 298 | ]
|
280 | 299 | }
|
281 | 300 | {
|
|
313 | 332 | 'name': 'storage.type.arrow.js'
|
314 | 333 | 'patterns': [
|
315 | 334 | {
|
316 |
| - 'include': '#function-params' |
| 335 | + 'include': '#numbers' |
| 336 | + } |
| 337 | + { |
| 338 | + 'include': '#strings' |
| 339 | + } |
| 340 | + { |
| 341 | + 'match': '\\(|\\)' |
| 342 | + 'name': 'meta.brace.round.js' |
| 343 | + } |
| 344 | + { |
| 345 | + 'match': '\\[|\\]' |
| 346 | + 'name': 'meta.brace.square.js' |
| 347 | + } |
| 348 | + { |
| 349 | + 'match': '\\{|\\}' |
| 350 | + 'name': 'meta.brace.curly.js' |
| 351 | + } |
| 352 | + { |
| 353 | + 'match': ',' |
| 354 | + 'name': 'meta.object.delimiter.js' |
| 355 | + } |
| 356 | + { |
| 357 | + 'match': '=' |
| 358 | + 'name': 'keyword.operator.js' |
| 359 | + } |
| 360 | + { |
| 361 | + 'include': '#comments' |
| 362 | + } |
| 363 | + { |
| 364 | + 'match': '[a-zA-Z_$][a-zA-Z_$0-9]*' |
| 365 | + 'name': 'variable.parameter.function.js' |
317 | 366 | }
|
318 | 367 | ]
|
319 | 368 | }
|
|
336 | 385 | 'name': 'storage.type.arrow.js'
|
337 | 386 | 'patterns': [
|
338 | 387 | {
|
339 |
| - 'include': '#function-params' |
| 388 | + 'include': '#numbers' |
| 389 | + } |
| 390 | + { |
| 391 | + 'include': '#strings' |
| 392 | + } |
| 393 | + { |
| 394 | + 'match': '\\(|\\)' |
| 395 | + 'name': 'meta.brace.round.js' |
| 396 | + } |
| 397 | + { |
| 398 | + 'match': '\\[|\\]' |
| 399 | + 'name': 'meta.brace.square.js' |
| 400 | + } |
| 401 | + { |
| 402 | + 'match': '\\{|\\}' |
| 403 | + 'name': 'meta.brace.curly.js' |
| 404 | + } |
| 405 | + { |
| 406 | + 'match': ',' |
| 407 | + 'name': 'meta.object.delimiter.js' |
| 408 | + } |
| 409 | + { |
| 410 | + 'match': '=' |
| 411 | + 'name': 'keyword.operator.js' |
| 412 | + } |
| 413 | + { |
| 414 | + 'include': '#comments' |
| 415 | + } |
| 416 | + { |
| 417 | + 'match': '[a-zA-Z_$][a-zA-Z_$0-9]*' |
| 418 | + 'name': 'variable.parameter.function.js' |
340 | 419 | }
|
341 | 420 | ]
|
342 | 421 | }
|
|
661 | 740 | 'name': 'meta.method.js'
|
662 | 741 | 'comment': 'match regular function like: function myFunc(arg) { … }'
|
663 | 742 |
|
664 |
| - 'begin': '\\b((?!(?:break|case|catch|continue|do|else|finally|for|function|if|export|import|package|return|switch|throw|try|while|with)[\\s\\(])(?:[a-zA-Z_$][a-zA-Z_$0-9]*))\\s*(\\()(?=(?:[^\\(\\)]*)?\\)\\s*\\{)' |
| 743 | + 'begin': '\\b((?!(?:break|case|catch|continue|do|else|finally|for|function|if|export|import|package|return|switch|throw|try|while|with)[\\s\\(])(?:[a-zA-Z_$][a-zA-Z_$0-9]*))\\s*(?=\\((?:[^\\(\\)]*)?\\)\\s*\\{)' |
665 | 744 | 'beginCaptures':
|
666 | 745 | '1':
|
667 | 746 | 'name': 'entity.name.function.js'
|
|
672 | 751 | {
|
673 | 752 | 'include': '#function-params'
|
674 | 753 | }
|
| 754 | + { |
| 755 | + 'include': '#function-body' |
| 756 | + } |
675 | 757 | {
|
676 | 758 | 'include': '#strings'
|
677 | 759 | }
|
678 | 760 | ]
|
679 | 761 |
|
680 |
| - 'end': '(\\))' |
| 762 | + 'end': '\\}' |
681 | 763 | 'endCaptures':
|
682 |
| - '1': |
683 |
| - 'name': 'punctuation.definition.parameters.end.js' |
| 764 | + '0': |
| 765 | + 'name': 'punctuation.definition.function.body.end.js' |
684 | 766 | }
|
685 | 767 | ]
|
686 | 768 | 'function-params':
|
687 | 769 | 'patterns': [
|
688 | 770 | {
|
689 |
| - 'include': '#numbers' |
690 |
| - } |
691 |
| - { |
692 |
| - 'include': '#strings' |
693 |
| - } |
694 |
| - { |
695 |
| - 'match': '\\(|\\)' |
696 |
| - 'name': 'meta.brace.round.js' |
697 |
| - } |
698 |
| - { |
699 |
| - 'match': '\\[|\\]' |
700 |
| - 'name': 'meta.brace.square.js' |
701 |
| - } |
702 |
| - { |
703 |
| - 'match': '\\{|\\}' |
704 |
| - 'name': 'meta.brace.curly.js' |
705 |
| - } |
706 |
| - { |
707 |
| - 'match': ',' |
708 |
| - 'name': 'meta.object.delimiter.js' |
709 |
| - } |
710 |
| - { |
711 |
| - 'match': '=' |
712 |
| - 'name': 'keyword.operator.js' |
713 |
| - } |
714 |
| - { |
715 |
| - 'include': '#comments' |
| 771 | + 'begin': '\\(' |
| 772 | + 'beginCaptures': |
| 773 | + '0': |
| 774 | + 'name': 'punctuation.definition.parameters.begin.js' |
| 775 | + 'end': '\\)' |
| 776 | + 'endCaptures': |
| 777 | + '0': |
| 778 | + 'name': 'punctuation.definition.parameters.end.js' |
| 779 | + 'patterns': [ |
| 780 | + { |
| 781 | + 'include': '#numbers' |
| 782 | + } |
| 783 | + { |
| 784 | + 'include': '#strings' |
| 785 | + } |
| 786 | + { |
| 787 | + 'match': '\\[|\\]' |
| 788 | + 'name': 'meta.brace.square.js' |
| 789 | + } |
| 790 | + { |
| 791 | + 'match': '\\{|\\}' |
| 792 | + 'name': 'meta.brace.curly.js' |
| 793 | + } |
| 794 | + { |
| 795 | + 'match': ',' |
| 796 | + 'name': 'meta.object.delimiter.js' |
| 797 | + } |
| 798 | + { |
| 799 | + 'match': '=' |
| 800 | + 'name': 'keyword.operator.js' |
| 801 | + } |
| 802 | + { |
| 803 | + 'include': '#comments' |
| 804 | + } |
| 805 | + { |
| 806 | + 'match': '[a-zA-Z_$][a-zA-Z_$0-9]*' |
| 807 | + 'name': 'variable.parameter.function.js' |
| 808 | + } |
| 809 | + ] |
716 | 810 | }
|
| 811 | + ] |
| 812 | + 'function-body': |
| 813 | + 'patterns': [ |
717 | 814 | {
|
718 |
| - 'match': '[a-zA-Z_$][a-zA-Z_$0-9]*' |
719 |
| - 'name': 'variable.parameter.function.js' |
| 815 | + 'begin': '\\{' |
| 816 | + 'beginCaptures': |
| 817 | + '0': |
| 818 | + 'name': 'punctuation.definition.function.body.begin.js' |
| 819 | + 'end': '(?=\\})' |
| 820 | + 'patterns': [ |
| 821 | + { |
| 822 | + 'include': '$self' |
| 823 | + } |
| 824 | + ] |
720 | 825 | }
|
721 | 826 | ]
|
722 | 827 | 'interpolated_js':
|
|
0 commit comments