PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.4.0
Code Block Pro – Beautiful Syntax Highlighting v1.4.0
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / languages / stata.tmLanguage.json

stata.tmLanguage.json in Code Block Pro – Beautiful Syntax Highlighting 1.4.0, at build/shiki/languages/stata.tmLanguage.json

3,046 lines 96.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 {
2 "scopeName": "source.stata",
3 "name": "stata",
4 "fileTypes": ["do", "ado", "mata"],
5 "foldingStartMarker": "\\{\\s*$",
6 "foldingStopMarker": "^\\s*\\}",
7 "patterns": [
8 {
9 "include": "#ascii-regex-functions"
10 },
11 {
12 "include": "#unicode-regex-functions"
13 },
14 {
15 "include": "#constants"
16 },
17 {
18 "include": "#functions"
19 },
20 {
21 "include": "#comments"
22 },
23 {
24 "include": "#subscripts"
25 },
26 {
27 "include": "#operators"
28 },
29 {
30 "include": "#macro-local"
31 },
32 {
33 "include": "#macro-global"
34 },
35 {
36 "include": "#string-compound"
37 },
38 {
39 "include": "#string-regular"
40 },
41 {
42 "include": "#builtin_variables"
43 },
44 {
45 "include": "#macro-commands"
46 },
47 {
48 "comment": "keywords that delimit flow conditionals",
49 "name": "keyword.control.conditional.stata",
50 "match": "\\b(if|else if|else)\\b"
51 },
52 {
53 "captures": {
54 "1": {
55 "name": "storage.type.scalar.stata"
56 }
57 },
58 "match": "^\\s*(sca(lar|la|l)?(\\s+de(fine|fin|fi|f)?)?)\\s+(?!(drop|dir?|l(ist|is|i)?)\\s+)"
59 },
60 {
61 "begin": "\\b(mer(ge|g)?)\\s+(1|m|n)(:)(1|m|n)",
62 "beginCaptures": {
63 "1": {
64 "name": "keyword.control.flow.stata"
65 },
66 "3": {
67 "patterns": [
68 {
69 "include": "#constants"
70 },
71 {
72 "match": "m|n",
73 "name": ""
74 }
75 ]
76 },
77 "4": {
78 "name": "punctuation.separator.key-value"
79 },
80 "5": {
81 "patterns": [
82 {
83 "include": "#constants"
84 },
85 {
86 "match": "m|n",
87 "name": ""
88 }
89 ]
90 }
91 },
92 "end": "using",
93 "patterns": [
94 {
95 "include": "#builtin_variables"
96 },
97 {
98 "include": "#macro-local"
99 },
100 {
101 "include": "#macro-global"
102 },
103 {
104 "include": "#comments"
105 }
106 ]
107 },
108 {
109 "match": "\\b(foreach)\\s+((?!in|of).+)\\s+(in|of var(list|lis|li|l)?|of new(list|lis|li|l)?|of num(list|lis|li|l)?)\\b",
110 "captures": {
111 "1": {
112 "name": "keyword.control.flow.stata"
113 },
114 "2": {
115 "patterns": [
116 {
117 "include": "#macro-local-identifiers"
118 },
119 {
120 "include": "#macro-local"
121 },
122 {
123 "include": "#macro-global"
124 }
125 ]
126 },
127 "3": {
128 "name": "keyword.control.flow.stata"
129 }
130 }
131 },
132 {
133 "begin": "\\b(foreach)\\s+((?!in|of).+)\\s+(of loc(al|a)?|of glo(bal|ba|b)?)\\b\\s*",
134 "beginCaptures": {
135 "1": {
136 "name": "keyword.control.flow.stata"
137 },
138 "2": {
139 "patterns": [
140 {
141 "include": "#macro-local-identifiers"
142 },
143 {
144 "include": "#macro-local"
145 },
146 {
147 "include": "#macro-global"
148 }
149 ]
150 },
151 "3": {
152 "name": "keyword.control.flow.stata"
153 }
154 },
155 "end": "(?=\\s*\\{)",
156 "patterns": [
157 {
158 "include": "#macro-local-identifiers"
159 },
160 {
161 "include": "#macro-local"
162 },
163 {
164 "include": "#macro-global"
165 }
166 ]
167 },
168 {
169 "begin": "\\b(forvalues|forvalue|forvalu|forval|forva|forv)\\s*",
170 "end": "\\s*(=)\\s*([^\\{]+)\\s*|(?=\\n)",
171 "beginCaptures": {
172 "1": {
173 "name": "keyword.control.flow.stata"
174 }
175 },
176 "endCaptures": {
177 "1": {
178 "name": "keyword.operator.assignment.stata"
179 },
180 "2": {
181 "patterns": [
182 {
183 "include": "#constants"
184 },
185 {
186 "include": "#operators"
187 },
188 {
189 "include": "#macro-local"
190 },
191 {
192 "include": "#macro-global"
193 }
194 ]
195 }
196 },
197 "patterns": [
198 {
199 "include": "#macro-local-identifiers"
200 },
201 {
202 "include": "#macro-local"
203 },
204 {
205 "include": "#macro-global"
206 }
207 ]
208 },
209 {
210 "comment": "keywords that delimit loops",
211 "name": "keyword.control.flow.stata",
212 "match": "\\b(while|continue)\\b"
213 },
214 {
215 "captures": {
216 "1": {
217 "name": "keyword.other.stata"
218 }
219 },
220 "comment": "keywords that haven't fit into other groups (yet).",
221 "match": "\\b(as|ass|asse|asser|assert)\\b"
222 },
223 {
224 "match": "\\b(by(sort|sor|so|s)?|statsby|rolling|bootstrap|jackknife|permute|simulate|svy|mi est(imate|imat|ima|im|i)?|nestreg|stepwise|xi|fp|mfp|vers(ion|io|i)?)\\b",
225 "name": "storage.type.function.stata",
226 "comment": "prefixes that require a colon"
227 },
228 {
229 "comment": "prefixes that don't need a colon",
230 "name": "keyword.control.flow.stata",
231 "match": "\\b(qui(etly|etl|et|e)?|n(oisily|oisil|oisi|ois|oi|o)?|cap(ture|tur|tu|t)?)\\b:?"
232 },
233 {
234 "match": "\\s*(pr(ogram|ogra|ogr|og|o)?)\\s+((di(r)?|drop|l(ist|is|i)?)\\s+)([\\w&&[^0-9]]\\w{0,31})",
235 "captures": {
236 "1": {
237 "name": "storage.type.function.stata"
238 },
239 "3": {
240 "name": "storage.type.function.stata"
241 },
242 "7": {
243 "name": "entity.name.function.stata"
244 }
245 }
246 },
247 {
248 "begin": "^\\s*(pr(ogram|ogra|ogr|og|o)?)\\s+(de(fine|fin|fi|f)?\\s+)?",
249 "beginCaptures": {
250 "1": {
251 "name": "storage.type.function.stata"
252 },
253 "3": {
254 "name": "storage.type.function.stata"
255 }
256 },
257 "end": "(?=,|\\n|/)",
258 "patterns": [
259 {
260 "include": "#macro-local"
261 },
262 {
263 "include": "#macro-global"
264 },
265 {
266 "match": "[\\w&&[^0-9]]\\w{0,31}",
267 "name": "entity.name.function.stata"
268 },
269 {
270 "match": "[^A-za-z_0-9,\\n/ ]+",
271 "name": "invalid.illegal.name.stata"
272 }
273 ]
274 },
275 {
276 "match": "\\b(form(at|a)?)\\s*([\\w&&[^0-9]]\\w{0,31})*\\s*(%)(-)?(0)?([0-9]+)(.)([0-9]+)(e|f|g)(c)?",
277 "captures": {
278 "1": "keyword.functions.data.stata.test"
279 }
280 },
281 {
282 "include": "#braces-with-error"
283 },
284 {
285 "begin": "(?=syntax)",
286 "end": "\\n",
287 "patterns": [
288 {
289 "comment": "color before the comma",
290 "begin": "syntax",
291 "beginCaptures": {
292 "0": {
293 "name": "keyword.functions.program.stata"
294 }
295 },
296 "end": "(?=,|\\n)",
297 "patterns": [
298 {
299 "begin": "///",
300 "end": "\\n",
301 "name": "comment.block.stata"
302 },
303 {
304 "match": "\\[",
305 "name": "punctuation.definition.parameters.begin.stata"
306 },
307 {
308 "match": "\\]",
309 "name": "punctuation.definition.parameters.end.stata"
310 },
311 {
312 "match": "\\b(varlist|varname|newvarlist|newvarname|namelist|name|anything)\\b",
313 "name": "entity.name.type.class.stata"
314 },
315 {
316 "match": "\\b((if|in|using|fweight|aweight|pweight|iweight))\\b(/)?",
317 "captures": {
318 "2": {
319 "name": "entity.name.type.class.stata"
320 },
321 "3": {
322 "name": "keyword.operator.arithmetic.stata"
323 }
324 }
325 },
326 {
327 "match": "(/)?(exp)",
328 "captures": {
329 "1": {
330 "name": "keyword.operator.arithmetic.stata"
331 },
332 "2": {
333 "name": "entity.name.type.class.stata"
334 }
335 }
336 },
337 {
338 "include": "#constants"
339 },
340 {
341 "include": "#operators"
342 },
343 {
344 "include": "#string-compound"
345 },
346 {
347 "include": "#string-regular"
348 },
349 {
350 "include": "#macro-local"
351 },
352 {
353 "include": "#macro-global"
354 },
355 {
356 "include": "#builtin_variables"
357 }
358 ]
359 },
360 {
361 "comment": "things to color after the comma",
362 "begin": ",",
363 "beginCaptures": {
364 "0": {
365 "name": "punctuation.definition.variable.begin.stata"
366 }
367 },
368 "end": "(?=\\n)",
369 "patterns": [
370 {
371 "begin": "///",
372 "end": "\\n",
373 "name": "comment.block.stata"
374 },
375 {
376 "comment": "color options with parentheses",
377 "begin": "([^\\s\\[\\]]+)(\\()",
378 "beginCaptures": {
379 "1": {
380 "patterns": [
381 {
382 "include": "#macro-local-identifiers"
383 },
384 {
385 "include": "#macro-local"
386 },
387 {
388 "include": "#macro-global"
389 }
390 ],
391 "comment": "these are the names that become macros"
392 },
393 "2": {
394 "name": "keyword.operator.parentheses.stata"
395 }
396 },
397 "end": "\\)",
398 "endCaptures": {
399 "0": {
400 "name": "keyword.operator.parentheses.stata"
401 }
402 },
403 "patterns": [
404 {
405 "comment": "the first word is often a type",
406 "match": "\\b(integer|intege|integ|inte|int|real|string|strin|stri|str)\\b",
407 "captures": {
408 "0": {
409 "name": "support.type.stata"
410 }
411 }
412 },
413 {
414 "include": "#constants"
415 },
416 {
417 "include": "#operators"
418 },
419 {
420 "include": "#string-compound"
421 },
422 {
423 "include": "#string-regular"
424 },
425 {
426 "include": "#macro-local"
427 },
428 {
429 "include": "#macro-global"
430 },
431 {
432 "include": "#builtin_variables"
433 }
434 ]
435 },
436 {
437 "include": "#macro-local-identifiers"
438 },
439 {
440 "include": "#constants"
441 },
442 {
443 "include": "#operators"
444 },
445 {
446 "include": "#string-compound"
447 },
448 {
449 "include": "#string-regular"
450 },
451 {
452 "include": "#macro-local"
453 },
454 {
455 "include": "#macro-global"
456 },
457 {
458 "include": "#builtin_variables"
459 }
460 ]
461 }
462 ]
463 },
464 {
465 "captures": {
466 "1": {
467 "name": "keyword.functions.data.stata"
468 }
469 },
470 "comment": "one-word commands",
471 "match": "\\b(sa(v|ve)|saveold|destring|tostring|u(se|s)?|note(s)?|form(at|a)?)\\b"
472 },
473 {
474 "match": "\\b(exit|end)\\b",
475 "name": "keyword.functions.data.stata",
476 "comment": "programming commands"
477 },
478 {
479 "match": "\\b(replace)\\s+([^=]+)\\s*((==)|(=))",
480 "captures": {
481 "1": {
482 "name": "keyword.functions.data.stata"
483 },
484 "2": {
485 "patterns": [
486 {
487 "include": "#macro-local"
488 }
489 ]
490 },
491 "4": {
492 "name": "invalid.illegal.name.stata"
493 },
494 "5": {
495 "name": "keyword.operator.assignment.stata"
496 }
497 }
498 },
499 {
500 "match": "\\b(g(enerate|enerat|enera|ener|ene|en|e)?|egen)\\s+((byte|int|long|float|double|str[1-9]?[0-9]?[0-9]?[0-9]?|strL)\\s+)?([^=\\s]+)\\s*((==)|(=))",
501 "captures": {
502 "1": {
503 "name": "keyword.functions.data.stata"
504 },
505 "3": {
506 "name": "support.type.stata"
507 },
508 "5": {
509 "patterns": [
510 {
511 "include": "#reserved-names"
512 },
513 {
514 "include": "#macro-local"
515 }
516 ]
517 },
518 "7": {
519 "name": "invalid.illegal.name.stata"
520 },
521 "8": {
522 "name": "keyword.operator.assignment.stata"
523 }
524 }
525 },
526 {
527 "match": "\\b(set ty(pe|p)?)\\s+((byte|int|long|float|double|str[1-9]?[0-9]?[0-9]?[0-9]?|strL)?\\s+)\\b",
528 "captures": {
529 "1": {
530 "name": "keyword.functions.data.stata"
531 },
532 "3": {
533 "name": "support.type.stata"
534 }
535 }
536 },
537 {
538 "match": "\\b(la(bel|be|b)?)\\s+(var(iable|iabl|iab|ia|i)?)\\s+([\\w&&[^0-9]]\\w{0,31})\\s+(`\")(.+)(\"')",
539 "captures": {
540 "1": {
541 "name": "keyword.functions.data.stata"
542 },
543 "3": {
544 "name": "keyword.functions.data.stata"
545 },
546 "6": {
547 "name": "punctuation.definition.string.begin.stata"
548 },
549 "7": {
550 "patterns": [
551 {
552 "include": "#string-compound"
553 },
554 {
555 "include": "#macro-local-escaped"
556 },
557 {
558 "include": "#macro-global-escaped"
559 },
560 {
561 "include": "#macro-local"
562 },
563 {
564 "include": "#macro-global"
565 },
566 {
567 "match": "[^`\\$]{81,}",
568 "name": "invalid.illegal.name.stata"
569 },
570 {
571 "match": ".",
572 "name": "string.quoted.double.compound.stata"
573 }
574 ]
575 },
576 "8": {
577 "name": "punctuation.definition.string.begin.stata"
578 }
579 }
580 },
581 {
582 "match": "\\b(la(bel|be|b)?)\\s+(var(iable|iabl|iab|ia|i)?)\\s+([\\w&&[^0-9]]\\w{0,31})\\s+(\")(.+)(\")",
583 "captures": {
584 "1": {
585 "name": "keyword.functions.data.stata"
586 },
587 "3": {
588 "name": "keyword.functions.data.stata"
589 },
590 "6": {
591 "name": "punctuation.definition.string.begin.stata"
592 },
593 "7": {
594 "patterns": [
595 {
596 "include": "#macro-local-escaped"
597 },
598 {
599 "include": "#macro-global-escaped"
600 },
601 {
602 "include": "#macro-local"
603 },
604 {
605 "include": "#macro-global"
606 },
607 {
608 "match": "[^`\\$]{81,}",
609 "name": "invalid.illegal.name.stata"
610 },
611 {
612 "match": ".",
613 "name": "string.quoted.double.stata"
614 }
615 ]
616 },
617 "8": {
618 "name": "punctuation.definition.string.begin.stata"
619 }
620 }
621 },
622 {
623 "match": "\\b(la(bel|be|b)?)\\s+(da(ta|t)?|var(iable|iabl|iab|ia|i)?|de(f|fi|fin|fine)?|val(ues|ue|u)?|di(r)?|l(ist|is|i)?|copy|drop|save|lang(uage|uag|ua|u)?)\\b",
624 "captures": {
625 "1": {
626 "name": "keyword.functions.data.stata"
627 },
628 "3": {
629 "name": "keyword.functions.data.stata"
630 }
631 }
632 },
633 {
634 "begin": "\\b(drop|keep)\\b(?!\\s+(if|in)\\b)",
635 "beginCaptures": {
636 "1": {
637 "name": "keyword.functions.data.stata"
638 }
639 },
640 "end": "\\n",
641 "patterns": [
642 {
643 "match": "\\b(if|in)\\b",
644 "name": "invalid.illegal.name.stata"
645 },
646 {
647 "include": "#comments"
648 },
649 {
650 "include": "#macro-local"
651 },
652 {
653 "include": "#macro-global"
654 },
655 {
656 "include": "#operators"
657 }
658 ]
659 },
660 {
661 "match": "\\b(drop|keep)\\s+(if|in)\\b",
662 "captures": {
663 "1": {
664 "name": "keyword.functions.data.stata"
665 },
666 "2": {
667 "name": "keyword.functions.data.stata"
668 }
669 }
670 },
671 {
672 "begin": "^\\s*mata:?\\s*$",
673 "comment": "won't match single-line Mata statements",
674 "end": "^\\s*end\\s*$\\n?",
675 "name": "meta.embedded.block.mata",
676 "patterns": [
677 {
678 "match": "(?<![^$\\s])(version|pragma|if|else|for|while|do|break|continue|goto|return)(?=\\s)",
679 "name": "keyword.control.mata"
680 },
681 {
682 "captures": {
683 "1": {
684 "name": "storage.type.eltype.mata"
685 },
686 "4": {
687 "name": "storage.type.orgtype.mata"
688 }
689 },
690 "match": "\\b(transmorphic|string|numeric|real|complex|(pointer(\\([^)]+\\))?))\\s+(matrix|vector|rowvector|colvector|scalar)\\b",
691 "name": "storage.type.mata"
692 },
693 {
694 "comment": "need to end with whitespace character here or last group doesn't match",
695 "match": "\\b(transmorphic|string|numeric|real|complex|(pointer(\\([^)]+\\))?))\\s",
696 "name": "storage.type.eltype.mata"
697 },
698 {
699 "match": "\\b(matrix|vector|rowvector|colvector|scalar)\\b",
700 "name": "storage.type.orgtype.mata"
701 },
702 {
703 "match": "\\!|\\+\\+|\\-\\-|\\&|\\'|\\?|\\\\|\\:\\:|\\,|\\.\\.|\\||\\=|\\=\\=|\\>\\=|\\<\\=|\\<|\\>|\\!\\=|\\#|\\+|\\-|\\*|\\^|\\/",
704 "name": "keyword.operator.mata"
705 },
706 {
707 "include": "$self"
708 }
709 ]
710 },
711 {
712 "begin": "\\b(odbc)\\b",
713 "beginCaptures": {
714 "0": {
715 "name": "keyword.control.flow.stata"
716 }
717 },
718 "end": "\\n",
719 "patterns": [
720 {
721 "begin": "///",
722 "end": "\\n",
723 "name": "comment.block.stata"
724 },
725 {
726 "begin": "(exec?)(\\(\")",
727 "beginCaptures": {
728 "1": {
729 "name": "support.function.builtin.stata"
730 },
731 "2": {
732 "name": "punctuation.definition.parameters.begin.stata"
733 }
734 },
735 "end": "\"\\)",
736 "endCaptures": {
737 "0": {
738 "name": "punctuation.definition.parameters.end.stata"
739 }
740 },
741 "patterns": [
742 {
743 "include": "source.sql"
744 }
745 ]
746 },
747 {
748 "include": "$self"
749 }
750 ]
751 },
752 {
753 "include": "#commands-other"
754 }
755 ],
756 "repository": {
757 "functions": {
758 "patterns": [
759 {
760 "begin": "\\b((abbrev|abs|acos|acosh|asin|asinh|atan|atan2|atanh|autocode|betaden|binomial|binomialp|binomialtail|binormalbofd|byteorder|c|cauchy|cauchyden|cauchytail|Cdhms|ceil|char|chi2|chi2den|chi2tail|Chms|cholesky|chop|clip|clock|Clock|cloglog|Cmdyhms|cofC|Cofc|cofd|Cofd|coleqnumb|collatorlocale|collatorversion|colnfreeparms|colnumb|colsof|comb|cond|corr|cos|cosh|daily|date|day|det|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|dhms|diag|diag0cnt|digamma|dofb|dofc|dofC|dofh|dofm|dofq|dofw|dofy|dow|doy|dunnettprob|e|el|epsdouble|epsfloat|exp|exponential|exponentialden|exponentialtail|F|Fden|fileexists|fileread|filereaderror|filewrite|float|floor|fmtwidth|Ftail|gammaden|gammap|gammaptail|get|hadamard|halfyear|halfyearly|hh|hhC|hms|hofd|hours|hypergeometric|hypergeometricp|I|ibeta|ibetatail|igaussian|igaussianden|igaussiantail|indexnot|inlist|inrange|int|inv|invbinomial|invbinomialtail|invcauchy|invcauchytail|invchi2|invchi2tail|invcloglog|invdunnettprob|invexponential|invexponentialtail|invF|invFtail|invgammap|invgammaptail|invibeta|invibetatail|invigaussian|invigaussiantail|invlaplace|invlaplacetail|invlogistic|invlogistictail|invlogit|invnbinomial|invnbinomialtail|invnchi2|invnchi2tail|invnF|invnFtail|invnibeta|invnormal|invnt|invnttail|invpoisson|invpoissontail|invsym|invt|invttail|invtukeyprob|invweibull|invweibullph|invweibullphtail|invweibulltail|irecode|issymmetric|itrim|J|laplace|laplaceden|laplacetail|length|ln|lncauchyden|lnfactorial|lngamma|lnigammaden|lnigaussianden|lniwishartden|lnlaplaceden|lnmvnormalden|lnnormal|lnnormalden|lnwishartden|log|log10|logistic|logisticden|logistictail|logit|lower|ltrim|matmissing|matrix|matuniform|max|maxbyte|maxdouble|maxfloat|maxint|maxlong|mdy|mdyhms|mi|min|minbyte|mindouble|minfloat|minint|minlong|minutes|missing|mm|mmC|mod|mofd|month|monthly|mreldif|msofhours|msofminutes|msofseconds|nbetaden|nbinomial|nbinomialp|nbinomialtail|nchi2|nchi2den|nchi2tail|nF|nFden|nFtail|nibeta|normal|normalden|npnchi2|npnF|npnt|nt|ntden|nttail|nullmat|plural|poisson|poissonp|poissontail|proper|qofd|quarter|quarterly|r|rbeta|rbinomial|rcauchy|rchi2|real|recode|regexs|reldif|replay|return|reverse|rexponential|rgamma|rhypergeometric|rigaussian|rlaplace|rlogistic|rnbinomial|rnormal|round|roweqnumb|rownfreeparms|rownumb|rowsof|rpoisson|rt|rtrim|runiform|runiformint|rweibull|rweibullph|s|scalar|seconds|sign|sin|sinh|smallestdouble|soundex|sqrt|ss|ssC|string|stritrim|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrpos|strrtrim|strtoname|strtrim|strupper|subinstr|subinword|substr|sum|sweep|t|tan|tanh|tc|tC|td|tden|th|tin|tm|tobytes|tq|trace|trigamma|trim|trunc|ttail|tukeyprob|tw|twithin|uchar|udstrlen|udsubstr|uisdigit|uisletter|upper|ustrcompare|ustrcompareex|ustrfix|ustrfrom|ustrinvalidcnt|ustrleft|ustrlen|ustrlower|ustrltrim|ustrnormalize|ustrpos|ustrregexs|ustrreverse|ustrright|ustrrpos|ustrrtrim|ustrsortkey|ustrsortkeyex|ustrtitle|ustrto|ustrtohex|ustrtoname|ustrtrim|ustrunescape|ustrupper|ustrword|ustrwordcount|usubinstr|usubstr|vec|vecdiag|week|weekly|weibull|weibullden|weibullph|weibullphden|weibullphtail|weibulltail|wofd|word|wordbreaklocale|wordcount|year|yearly|yh|ym|yofd|yq|yw)|([\\w&&[^0-9]]\\w{0,31}))(\\()",
761 "beginCaptures": {
762 "2": {
763 "name": "support.function.builtin.stata"
764 },
765 "3": {
766 "name": "support.function.custom.stata"
767 },
768 "4": {
769 "name": "punctuation.definition.parameters.begin.stata"
770 }
771 },
772 "end": "(\\))",
773 "endCaptures": {
774 "1": {
775 "name": "punctuation.definition.parameters.end.stata"
776 }
777 },
778 "patterns": [
779 {
780 "match": "[\\w&&[^0-9]]\\w{0,31}",
781 "name": "variable.parameter.function.stata"
782 },
783 {
784 "begin": "\\(",
785 "end": "\\)",
786 "beginCaptures": {
787 "0": {
788 "name": "keyword.operator.parentheses.stata"
789 }
790 },
791 "endCaptures": {
792 "0": {
793 "name": "keyword.operator.parentheses.stata"
794 }
795 },
796 "patterns": [
797 {
798 "include": "#ascii-regex-functions"
799 },
800 {
801 "include": "#unicode-regex-functions"
802 },
803 {
804 "include": "#functions"
805 },
806 {
807 "include": "#subscripts"
808 },
809 {
810 "include": "#constants"
811 },
812 {
813 "include": "#comments"
814 },
815 {
816 "include": "#operators"
817 },
818 {
819 "include": "#macro-local"
820 },
821 {
822 "include": "#macro-global"
823 },
824 {
825 "include": "#string-compound"
826 },
827 {
828 "include": "#string-regular"
829 },
830 {
831 "include": "#builtin_variables"
832 },
833 {
834 "include": "#macro-commands"
835 },
836 {
837 "include": "#braces-without-error"
838 },
839 {
840 "match": "[\\w&&[^0-9]]\\w{0,31}",
841 "name": "variable.parameter.function.stata"
842 }
843 ]
844 },
845 {
846 "include": "#ascii-regex-functions"
847 },
848 {
849 "include": "#unicode-regex-functions"
850 },
851 {
852 "include": "#functions"
853 },
854 {
855 "include": "#subscripts"
856 },
857 {
858 "include": "#constants"
859 },
860 {
861 "include": "#comments"
862 },
863 {
864 "include": "#operators"
865 },
866 {
867 "include": "#macro-local"
868 },
869 {
870 "include": "#macro-global"
871 },
872 {
873 "include": "#string-compound"
874 },
875 {
876 "include": "#string-regular"
877 },
878 {
879 "include": "#builtin_variables"
880 },
881 {
882 "include": "#macro-commands"
883 },
884 {
885 "include": "#braces-without-error"
886 }
887 ]
888 }
889 ]
890 },
891 "builtin_types": {
892 "patterns": [
893 {
894 "match": "\\b(byte|int|long|float|double|str[1-9]?[0-9]?[0-9]?[0-9]?|strL)\\b",
895 "name": "support.type.stata"
896 }
897 ]
898 },
899 "builtin_variables": {
900 "patterns": [
901 {
902 "match": "\\b(_b|_coef|_cons|_n|_N|_rc|_se)\\b",
903 "name": "variable.object.stata"
904 }
905 ]
906 },
907 "braces-without-error": {
908 "patterns": [
909 {
910 "begin": "\\{",
911 "beginCaptures": {
912 "0": {
913 "name": "keyword.control.block.begin.stata"
914 }
915 },
916 "end": "\\}",
917 "endCaptures": {
918 "0": {
919 "name": "keyword.control.block.end.stata"
920 }
921 }
922 }
923 ]
924 },
925 "braces-with-error": {
926 "patterns": [
927 {
928 "comment": "correct with nothing else on the line but whitespace; before and after; before; after; correct",
929 "begin": "(\\{)\\s*([^\\n]*)(?=\\n)",
930 "beginCaptures": {
931 "1": {
932 "name": "keyword.control.block.begin.stata"
933 },
934 "2": {
935 "patterns": [
936 {
937 "include": "#comments"
938 },
939 {
940 "match": "[^\\n]+",
941 "name": "illegal.invalid.name.stata"
942 }
943 ]
944 }
945 },
946 "end": "^\\s*(\\})\\s*$|^\\s*([^\\*\"\\}]+)\\s+(\\})\\s*([^\\*\"\\}/\\n]+)|^\\s*([^\"\\*\\}]+)\\s+(\\})|\\s*(\\})\\s*([^\"\\*\\}/\\n]+)|(\\})$",
947 "endCaptures": {
948 "1": {
949 "name": "keyword.control.block.end.stata"
950 },
951 "2": {
952 "name": "invalid.illegal.name.stata"
953 },
954 "3": {
955 "name": "keyword.control.block.end.stata"
956 },
957 "4": {
958 "name": "invalid.illegal.name.stata"
959 },
960 "5": {
961 "name": "invalid.illegal.name.stata"
962 },
963 "6": {
964 "name": "keyword.control.block.end.stata"
965 },
966 "7": {
967 "name": "keyword.control.block.end.stata"
968 },
969 "8": {
970 "name": "invalid.illegal.name.stata"
971 },
972 "9": {
973 "name": "keyword.control.block.end.stata"
974 }
975 },
976 "patterns": [
977 {
978 "include": "$self"
979 }
980 ]
981 }
982 ]
983 },
984 "commands-other": {
985 "patterns": [
986 {
987 "comment": "Add on commands",
988 "match": "\\b(reghdfe|ivreghdfe|ivreg2|outreg|gcollapse|gcontract|gegen|gisid|glevelsof|gquantiles)\\b",
989 "name": "keyword.control.flow.stata"
990 },
991 {
992 "comment": "Built in commands",
993 "match": "\\b(about|ac|acprplot|ado|adopath|adoupdate|alpha|ameans|an|ano|anov|anova|anova_terms|anovadef|aorder|ap|app|appe|appen|append|arch|arch_dr|arch_estat|arch_p|archlm|areg|areg_p|args|arima|arima_dr|arima_estat|arima_p|asmprobit|asmprobit_estat|asmprobit_lf|asmprobit_mfx__dlg|asmprobit_p|avplot|avplots|bcskew0|bgodfrey|binreg|bip0_lf|biplot|bipp_lf|bipr_lf|bipr_p|biprobit|bitest|bitesti|bitowt|blogit|bmemsize|boot|bootsamp|boxco_l|boxco_p|boxcox|boxcox_p|bprobit|br|break|brier|bro|brow|brows|browse|brr|brrstat|bs|bsampl_w|bsample|bsqreg|bstat|bstrap|ca|ca_estat|ca_p|cabiplot|camat|canon|canon_estat|canon_p|caprojection|cat|cc|cchart|cci|cd|censobs_table|centile|cf|char|chdir|checkdlgfiles|checkestimationsample|checkhlpfiles|checksum|chelp|ci|cii|cl|class|classutil|clear|cli|clis|clist|clog|clog_lf|clog_p|clogi|clogi_sw|clogit|clogit_lf|clogit_p|clogitp|clogl_sw|cloglog|clonevar|clslistarray|cluster|cluster_measures|cluster_stop|cluster_tree|cluster_tree_8|clustermat|cmdlog|cnr|cnre|cnreg|cnreg_p|cnreg_sw|cnsreg|codebook|collaps4|collapse|colormult_nb|colormult_nw|compare|compress|conf|confi|confir|confirm|conren|cons|const|constr|constra|constrai|constrain|constraint|contract|copy|copyright|copysource|cor|corc|corr|corr2data|corr_anti|corr_kmo|corr_smc|corre|correl|correla|correlat|correlate|corrgram|cou|coun|count|cprplot|crc|cret|cretu|cretur|creturn|cross|cs|cscript|cscript_log|csi|ct|ct_is|ctset|ctst_st|cttost|cumsp|cumul|cusum|cutil|d|datasig|datasign|datasigna|datasignat|datasignatu|datasignatur|datasignature|datetof|db|dbeta|de|dec|deco|decod|decode|deff|des|desc|descr|descri|describ|describe|dfbeta|dfgls|dfuller|di|di_g|dir|dirstats|dis|discard|disp|disp_res|disp_s|displ|displa|display|do|doe|doed|doedi|doedit|dotplot|dprobit|drawnorm|ds|ds_util|dstdize|duplicates|durbina|dwstat|dydx|ed|edi|edit|eivreg|emdef|en|enc|enco|encod|encode|eq|erase|ereg|ereg_lf|ereg_p|ereg_sw|ereghet|ereghet_glf|ereghet_glf_sh|ereghet_gp|ereghet_ilf|ereghet_ilf_sh|ereghet_ip|eret|eretu|eretur|ereturn|err|erro|error|est|est_cfexist|est_cfname|est_clickable|est_expand|est_hold|est_table|est_unhold|est_unholdok|estat|estat_default|estat_summ|estat_vce_only|esti|estimates|etodow|etof|etomdy|expand|expandcl|fac|fact|facto|factor|factor_estat|factor_p|factor_pca_rotated|factor_rotate|factormat|fcast|fcast_compute|fcast_graph|fdades|fdadesc|fdadescr|fdadescri|fdadescrib|fdadescribe|fdasav|fdasave|fdause|fh_st|file|filefilter|fillin|find_hlp_file|findfile|findit|fit|fl|fli|flis|flist|fpredict|frac_adj|frac_chk|frac_cox|frac_ddp|frac_dis|frac_dv|frac_in|frac_mun|frac_pp|frac_pq|frac_pv|frac_wgt|frac_xo|fracgen|fracplot|fracpoly|fracpred|fron_ex|fron_hn|fron_p|fron_tn|fron_tn2|frontier|ftodate|ftoe|ftomdy|ftowdate|gamhet_glf|gamhet_gp|gamhet_ilf|gamhet_ip|gamma|gamma_d2|gamma_p|gamma_sw|gammahet|gdi_hexagon|gdi_spokes|genrank|genstd|genvmean|gettoken|gladder|glim_l01|glim_l02|glim_l03|glim_l04|glim_l05|glim_l06|glim_l07|glim_l08|glim_l09|glim_l10|glim_l11|glim_l12|glim_lf|glim_mu|glim_nw1|glim_nw2|glim_nw3|glim_p|glim_v1|glim_v2|glim_v3|glim_v4|glim_v5|glim_v6|glim_v7|glm|glm_p|glm_sw|glmpred|glogit|glogit_p|gmeans|gnbre_lf|gnbreg|gnbreg_p|gomp_lf|gompe_sw|gomper_p|gompertz|gompertzhet|gomphet_glf|gomphet_glf_sh|gomphet_gp|gomphet_ilf|gomphet_ilf_sh|gomphet_ip|gphdot|gphpen|gphprint|gprefs|gprobi_p|gprobit|gr|gr7|gr_copy|gr_current|gr_db|gr_describe|gr_dir|gr_draw|gr_draw_replay|gr_drop|gr_edit|gr_editviewopts|gr_example|gr_example2|gr_export|gr_print|gr_qscheme|gr_query|gr_read|gr_rename|gr_replay|gr_save|gr_set|gr_setscheme|gr_table|gr_undo|gr_use|graph|grebar|greigen|grmeanby|gs_fileinfo|gs_filetype|gs_graphinfo|gs_stat|gsort|gwood|h|hareg|hausman|haver|he|heck_d2|heckma_p|heckman|heckp_lf|heckpr_p|heckprob|hel|help|hereg|hetpr_lf|hetpr_p|hetprob|hettest|hexdump|hilite|hist|histogram|hlogit|hlu|hmeans|hotel|hotelling|hprobit|hreg|hsearch|icd9|icd9_ff|icd9p|iis|impute|imtest|inbase|include|inf|infi|infil|infile|infix|inp|inpu|input|ins|insheet|insp|inspe|inspec|inspect|integ|inten|intreg|intreg_p|intrg2_ll|intrg_ll|intrg_ll2|ipolate|iqreg|ir|irf|irf_create|irfm|iri|is_svy|is_svysum|isid|istdize|ivprobit|ivprobit_p|ivreg|ivreg_footnote|ivtob_lf|ivtobit|ivtobit_p|jacknife|jknife|jkstat|joinby|kalarma1|kap|kapmeier|kappa|kapwgt|kdensity|ksm|ksmirnov|ktau|kwallis|labelbook|ladder|levelsof|leverage|lfit|lfit_p|li|lincom|line|linktest|lis|list|lloghet_glf|lloghet_glf_sh|lloghet_gp|lloghet_ilf|lloghet_ilf_sh|lloghet_ip|llogi_sw|llogis_p|llogist|llogistic|llogistichet|lnorm_lf|lnorm_sw|lnorma_p|lnormal|lnormalhet|lnormhet_glf|lnormhet_glf_sh|lnormhet_gp|lnormhet_ilf|lnormhet_ilf_sh|lnormhet_ip|lnskew0|loadingplot|(?<!\\.)log|logi|logis_lf|logistic|logistic_p|logit|logit_estat|logit_p|loglogs|logrank|loneway|lookfor|lookup|lowess|lpredict|lrecomp|lroc|lrtest|ls|lsens|lsens_x|lstat|ltable|ltriang|lv|lvr2plot|m|ma|mac|macr|macro|makecns|man|manova|manovatest|mantel|mark|markin|markout|marksample|mat|mat_capp|mat_order|mat_put_rr|mat_rapp|mata|mata_clear|mata_describe|mata_drop|mata_matdescribe|mata_matsave|mata_matuse|mata_memory|mata_mlib|mata_mosave|mata_rename|mata_which|matalabel|matcproc|matlist|matname|matr|matri|matrix|matrix_input__dlg|matstrik|mcc|mcci|md0_|md1_|md1debug_|md2_|md2debug_|mds|mds_estat|mds_p|mdsconfig|mdslong|mdsmat|mdsshepard|mdytoe|mdytof|me_derd|mean|means|median|memory|memsize|mfp|mfx|mhelp|mhodds|minbound|mixed_ll|mixed_ll_reparm|mkassert|mkdir|mkmat|mkspline|ml|ml_adjs|ml_bhhhs|ml_c_d|ml_check|ml_clear|ml_cnt|ml_debug|ml_defd|ml_e0|ml_e0_bfgs|ml_e0_cycle|ml_e0_dfp|ml_e0i|ml_e1|ml_e1_bfgs|ml_e1_bhhh|ml_e1_cycle|ml_e1_dfp|ml_e2|ml_e2_cycle|ml_ebfg0|ml_ebfr0|ml_ebfr1|ml_ebh0q|ml_ebhh0|ml_ebhr0|ml_ebr0i|ml_ecr0i|ml_edfp0|ml_edfr0|ml_edfr1|ml_edr0i|ml_eds|ml_eer0i|ml_egr0i|ml_elf|ml_elf_bfgs|ml_elf_bhhh|ml_elf_cycle|ml_elf_dfp|ml_elfi|ml_elfs|ml_enr0i|ml_enrr0|ml_erdu0|ml_erdu0_bfgs|ml_erdu0_bhhh|ml_erdu0_bhhhq|ml_erdu0_cycle|ml_erdu0_dfp|ml_erdu0_nrbfgs|ml_exde|ml_footnote|ml_geqnr|ml_grad0|ml_graph|ml_hbhhh|ml_hd0|ml_hold|ml_init|ml_inv|ml_log|ml_max|ml_mlout|ml_mlout_8|ml_model|ml_nb0|ml_opt|ml_p|ml_plot|ml_query|ml_rdgrd|ml_repor|ml_s_e|ml_score|ml_searc|ml_technique|ml_unhold|mleval|mlf_|mlmatbysum|mlmatsum|mlog|mlogi|mlogit|mlogit_footnote|mlogit_p|mlopts|mlsum|mlvecsum|mnl0_|mor|more|mov|move|mprobit|mprobit_lf|mprobit_p|mrdu0_|mrdu1_|mvdecode|mvencode|mvreg|mvreg_estat|nbreg|nbreg_al|nbreg_lf|nbreg_p|nbreg_sw|nestreg|net|newey|newey_p|news|nl|nlcom|nlcom_p|nlexp2|nlexp2a|nlexp3|nlgom3|nlgom4|nlinit|nllog3|nllog4|nlog_rd|nlogit|nlogit_p|nlogitgen|nlogittree|nlpred|nobreak|notes_dlg|nptrend|numlabel|numlist|old_ver|olo|olog|ologi|ologi_sw|ologit|ologit_p|ologitp|on|one|onew|onewa|oneway|op_colnm|op_comp|op_diff|op_inv|op_str|opr|opro|oprob|oprob_sw|oprobi|oprobi_p|oprobit|oprobitp|opts_exclusive|order|orthog|orthpoly|ou|out|outf|outfi|outfil|outfile|outs|outsh|outshe|outshee|outsheet|ovtest|pac|palette|parse_dissim|pause|pca|pca_display|pca_estat|pca_p|pca_rotate|pcamat|pchart|pchi|pcorr|pctile|pentium|pergram|personal|peto_st|pkcollapse|pkcross|pkequiv|pkexamine|pkshape|pksumm|plugin|pnorm|poisgof|poiss_lf|poiss_sw|poisso_p|poisson|poisson_estat|post|postclose|postfile|postutil|pperron|prais|prais_e|prais_e2|prais_p|predict|predictnl|preserve|print|prob|probi|probit|probit_estat|probit_p|proc_time|procoverlay|procrustes|procrustes_estat|procrustes_p|profiler|prop|proportion|prtest|prtesti|pwcorr|pwd|qs|qby|qbys|qchi|qladder|qnorm|qqplot|qreg|qreg_c|qreg_p|qreg_sw|qu|quadchk|quantile|que|quer|query|range|ranksum|ratio|rchart|rcof|recast|recode|reg|reg3|reg3_p|regdw|regr|regre|regre_p2|regres|regres_p|regress|regress_estat|regriv_p|remap|ren|rena|renam|rename|renpfix|repeat|reshape|restore|ret|retu|retur|return|rmdir|robvar|roccomp|rocf_lf|rocfit|rocgold|rocplot|roctab|rologit|rologit_p|rot|rota|rotat|rotate|rotatemat|rreg|rreg_p|ru|run|runtest|rvfplot|rvpplot|safesum|sample|sampsi|savedresults|sc|scatter|scm_mine|sco|scob_lf|scob_p|scobi_sw|scobit|scor|score|scoreplot|scoreplot_help|scree|screeplot|screeplot_help|sdtest|sdtesti|se|search|separate|seperate|serrbar|serset|set|set_defaults|sfrancia|sh|she|shel|shell|shewhart|signestimationsample|signrank|signtest|simul|sktest|sleep|slogit|slogit_d2|slogit_p|smooth|snapspan|so|sor|sort|spearman|spikeplot|spikeplt|spline_x|split|sqreg|sqreg_p|sret|sretu|sretur|sreturn|ssc|st|st_ct|st_hc|st_hcd|st_hcd_sh|st_is|st_issys|st_note|st_promo|st_set|st_show|st_smpl|st_subid|stack|stbase|stci|stcox|stcox_estat|stcox_fr|stcox_fr_ll|stcox_p|stcox_sw|stcoxkm|stcstat|stcurv|stcurve|stdes|stem|stepwise|stfill|stgen|stir|stjoin|stmc|stmh|stphplot|stphtest|stptime|strate|streg|streg_sw|streset|sts|stset|stsplit|stsum|sttocc|sttoct|stvary|su|suest|sum|summ|summa|summar|summari|summariz|summarize|sunflower|sureg|survcurv|survsum|svar|svar_p|svmat|svy_disp|svy_dreg|svy_est|svy_est_7|svy_estat|svy_get|svy_gnbreg_p|svy_head|svy_header|svy_heckman_p|svy_heckprob_p|svy_intreg_p|svy_ivreg_p|svy_logistic_p|svy_logit_p|svy_mlogit_p|svy_nbreg_p|svy_ologit_p|svy_oprobit_p|svy_poisson_p|svy_probit_p|svy_regress_p|svy_sub|svy_sub_7|svy_x|svy_x_7|svy_x_p|svydes|svygen|svygnbreg|svyheckman|svyheckprob|svyintreg|svyintrg|svyivreg|svylc|svylog_p|svylogit|svymarkout|svymean|svymlog|svymlogit|svynbreg|svyolog|svyologit|svyoprob|svyoprobit|svyopts|svypois|svypoisson|svyprobit|svyprobt|svyprop|svyratio|svyreg|svyreg_p|svyregress|svyset|svytab|svytest|svytotal|sw|swilk|symmetry|symmi|symplot|sysdescribe|sysdir|sysuse|szroeter|ta|tab|tab1|tab2|tab_or|tabd|tabdi|tabdis|tabdisp|tabi|table|tabodds|tabstat|tabu|tabul|tabula|tabulat|tabulate|te|tes|test|testnl|testparm|teststd|tetrachoric|time_it|timer|tis|tob|tobi|tobit|tobit_p|tobit_sw|token|tokeni|tokeniz|tokenize|total|translate|translator|transmap|treat_ll|treatr_p|treatreg|trim|trnb_cons|trnb_mean|trpoiss_d2|trunc_ll|truncr_p|truncreg|tsappend|tset|tsfill|tsline|tsline_ex|tsreport|tsrevar|tsrline|tsset|tssmooth|tsunab|ttest|ttesti|tut_chk|tut_wait|tutorial|tw|tware_st|two|twoway|twoway__fpfit_serset|twoway__function_gen|twoway__histogram_gen|twoway__ipoint_serset|twoway__ipoints_serset|twoway__kdensity_gen|twoway__lfit_serset|twoway__normgen_gen|twoway__pci_serset|twoway__qfit_serset|twoway__scatteri_serset|twoway__sunflower_gen|twoway_ksm_serset|ty|typ|type|typeof|unab|unabbrev|unabcmd|update|uselabel|var|var_mkcompanion|var_p|varbasic|varfcast|vargranger|varirf|varirf_add|varirf_cgraph|varirf_create|varirf_ctable|varirf_describe|varirf_dir|varirf_drop|varirf_erase|varirf_graph|varirf_ograph|varirf_rename|varirf_set|varirf_table|varlmar|varnorm|varsoc|varstable|varstable_w|varstable_w2|varwle|vec|vec_fevd|vec_mkphi|vec_p|vec_p_w|vecirf_create|veclmar|veclmar_w|vecnorm|vecnorm_w|vecrank|vecstable|verinst|vers|versi|versio|version|view|viewsource|vif|vwls|wdatetof|webdescribe|webseek|webuse|wh|whelp|whi|which|wilc_st|wilcoxon|win|wind|windo|window|winexec|wntestb|wntestq|xchart|xcorr|xi|xmlsav|xmlsave|xmluse|xpose|xsh|xshe|xshel|xshell|xt_iis|xt_tis|xtab_p|xtabond|xtbin_p|xtclog|xtcloglog|xtcloglog_d2|xtcloglog_pa_p|xtcloglog_re_p|xtcnt_p|xtcorr|xtdata|xtdes|xtfront_p|xtfrontier|xtgee|xtgee_elink|xtgee_estat|xtgee_makeivar|xtgee_p|xtgee_plink|xtgls|xtgls_p|xthaus|xthausman|xtht_p|xthtaylor|xtile|xtint_p|xtintreg|xtintreg_d2|xtintreg_p|xtivreg|xtline|xtline_ex|xtlogit|xtlogit_d2|xtlogit_fe_p|xtlogit_pa_p|xtlogit_re_p|xtmixed|xtmixed_estat|xtmixed_p|xtnb_fe|xtnb_lf|xtnbreg|xtnbreg_pa_p|xtnbreg_refe_p|xtpcse|xtpcse_p|xtpois|xtpoisson|xtpoisson_d2|xtpoisson_pa_p|xtpoisson_refe_p|xtpred|xtprobit|xtprobit_d2|xtprobit_re_p|xtps_fe|xtps_lf|xtps_ren|xtps_ren_8|xtrar_p|xtrc|xtrc_p|xtrchh|xtrefe_p|yx|yxview__barlike_draw|yxview_area_draw|yxview_bar_draw|yxview_dot_draw|yxview_dropline_draw|yxview_function_draw|yxview_iarrow_draw|yxview_ilabels_draw|yxview_normal_draw|yxview_pcarrow_draw|yxview_pcbarrow_draw|yxview_pccapsym_draw|yxview_pcscatter_draw|yxview_pcspike_draw|yxview_rarea_draw|yxview_rbar_draw|yxview_rbarm_draw|yxview_rcap_draw|yxview_rcapsym_draw|yxview_rconnected_draw|yxview_rline_draw|yxview_rscatter_draw|yxview_rspike_draw|yxview_spike_draw|yxview_sunflower_draw|zap_s|zinb|zinb_llf|zinb_plf|zip|zip_llf|zip_p|zip_plf|zt_ct_5|zt_hc_5|zt_hcd_5|zt_is_5|zt_iss_5|zt_sho_5|zt_smp_5|ztnb|ztnb_p|ztp|ztp_p|prtab|prchange|eststo|estout|esttab|estadd|estpost|ivregress|xtreg|xtreg_be|xtreg_fe|xtreg_ml|xtreg_pa_p|xtreg_re|xtregar|xtrere_p|xtset|xtsf_ll|xtsf_llti|xtsum|xttab|xttest0|xttobit|xttobit_p|xttrans)\\b",
994 "name": "keyword.control.flow.stata"
995 }
996 ]
997 },
998 "comments": {
999 "patterns": [
1000 {
1001 "include": "#comments-double-slash"
1002 },
1003 {
1004 "include": "#comments-star"
1005 },
1006 {
1007 "include": "#comments-block"
1008 },
1009 {
1010 "include": "#comments-triple-slash"
1011 }
1012 ]
1013 },
1014 "comments-block": {
1015 "patterns": [
1016 {
1017 "begin": "/\\*",
1018 "beginCaptures": {
1019 "0": {
1020 "name": "punctuation.definition.comment.begin.stata"
1021 }
1022 },
1023 "end": "(\\*/\\s+\\*[^\\n]*)|(\\*/(?!\\*))",
1024 "endCaptures": {
1025 "0": {
1026 "name": "punctuation.definition.comment.end.stata"
1027 }
1028 },
1029 "name": "comment.block.stata",
1030 "patterns": [
1031 {
1032 "match": "\\*/\\*",
1033 "comment": "this ends and restarts a comment block. but need to catch this so that it doesn't start _another_ level of comment blocks"
1034 },
1035 {
1036 "include": "#docblockr-comment"
1037 },
1038 {
1039 "include": "#comments-block"
1040 },
1041 {
1042 "include": "#docstring"
1043 }
1044 ]
1045 }
1046 ]
1047 },
1048 "comments-star": {
1049 "patterns": [
1050 {
1051 "captures": {
1052 "0": {
1053 "name": "punctuation.definition.comment.stata"
1054 }
1055 },
1056 "begin": "^\\s*(\\*)",
1057 "name": "comment.line.star.stata",
1058 "end": "(?=\\n)",
1059 "comment": "TODO! need to except out the occasion that a * comes after a /// on the previous line. May be easiest to join with the comment.line.triple-slash.stata below",
1060 "patterns": [
1061 {
1062 "include": "#docblockr-comment"
1063 },
1064 {
1065 "begin": "///",
1066 "end": "\\n",
1067 "name": "comment.line-continuation.stata"
1068 },
1069 {
1070 "include": "#comments"
1071 }
1072 ]
1073 }
1074 ]
1075 },
1076 "comments-triple-slash": {
1077 "patterns": [
1078 {
1079 "captures": {
1080 "0": {
1081 "name": "punctuation.definition.comment.stata"
1082 }
1083 },
1084 "begin": "(^///|(?<=\\s)///)",
1085 "end": "(?=\\n)",
1086 "name": "comment.line.triple-slash.stata",
1087 "patterns": [
1088 {
1089 "include": "#docblockr-comment"
1090 }
1091 ]
1092 }
1093 ]
1094 },
1095 "comments-double-slash": {
1096 "patterns": [
1097 {
1098 "captures": {
1099 "0": {
1100 "name": "punctuation.definition.comment.stata"
1101 }
1102 },
1103 "begin": "(^//|(?<=\\s)//)(?!/)",
1104 "end": "(?=\\n)",
1105 "name": "comment.line.double-slash.stata",
1106 "patterns": [
1107 {
1108 "include": "#docblockr-comment"
1109 }
1110 ]
1111 }
1112 ]
1113 },
1114 "docblockr-comment": {
1115 "patterns": [
1116 {
1117 "match": "(?<!\\w)(@(error|ERROR|Error))\\b",
1118 "captures": {
1119 "1": {
1120 "name": "invalid.illegal.name.stata"
1121 }
1122 }
1123 },
1124 {
1125 "match": "(?<!\\w)(@\\w+)\\b",
1126 "captures": {
1127 "1": {
1128 "name": "keyword.docblockr.stata"
1129 }
1130 }
1131 }
1132 ]
1133 },
1134 "docstring": {
1135 "patterns": [
1136 {
1137 "begin": "'''",
1138 "beginCaptures": {
1139 "0": {
1140 "name": "punctuation.definition.string.begin.stata"
1141 }
1142 },
1143 "end": "'''",
1144 "endCaptures": {
1145 "0": {
1146 "name": "punctuation.definition.string.begin.stata"
1147 }
1148 },
1149 "name": "string.quoted.docstring.stata"
1150 },
1151 {
1152 "begin": "\"\"\"",
1153 "beginCaptures": {
1154 "0": {
1155 "name": "punctuation.definition.string.begin.stata"
1156 }
1157 },
1158 "end": "\"\"\"",
1159 "endCaptures": {
1160 "0": {
1161 "name": "punctuation.definition.string.begin.stata"
1162 }
1163 },
1164 "name": "string.quoted.docstring.stata"
1165 }
1166 ]
1167 },
1168 "macro-commands": {
1169 "patterns": [
1170 {
1171 "begin": "\\b(loc(al|a)?)\\s+([\\w'`\\$\\(\\)\\{\\}]+)\\s*(?=:|=)",
1172 "beginCaptures": {
1173 "1": {
1174 "name": "keyword.macro.stata"
1175 },
1176 "3": {
1177 "patterns": [
1178 {
1179 "include": "#macro-local-identifiers"
1180 },
1181 {
1182 "include": "#macro-local"
1183 },
1184 {
1185 "include": "#macro-global"
1186 }
1187 ]
1188 }
1189 },
1190 "end": "\\n",
1191 "patterns": [
1192 {
1193 "begin": "=",
1194 "beginCaptures": {
1195 "0": {
1196 "name": "keyword.operator.arithmetic.stata"
1197 }
1198 },
1199 "end": "(?=\\n)",
1200 "patterns": [
1201 {
1202 "include": "$self"
1203 }
1204 ]
1205 },
1206 {
1207 "begin": ":",
1208 "beginCaptures": {
1209 "0": {
1210 "name": "keyword.operator.arithmetic.stata"
1211 }
1212 },
1213 "end": "(?=\\n)",
1214 "patterns": [
1215 {
1216 "include": "#macro-extended-functions"
1217 }
1218 ]
1219 }
1220 ]
1221 },
1222 {
1223 "begin": "\\b(gl(obal|oba|ob|o)?)\\s+(?=[\\w`\\$])",
1224 "beginCaptures": {
1225 "1": {
1226 "name": "keyword.macro.stata"
1227 }
1228 },
1229 "end": "(\\})|(?=\\\"|\\s|\\n|/|,|=)",
1230 "patterns": [
1231 {
1232 "include": "#reserved-names"
1233 },
1234 {
1235 "match": "[\\w&&[^0-9_]]\\w{0,31}",
1236 "name": "entity.name.type.class.stata"
1237 },
1238 {
1239 "include": "#macro-local"
1240 },
1241 {
1242 "include": "#macro-global"
1243 }
1244 ]
1245 },
1246 {
1247 "begin": "\\b(loc(al|a)?)\\s+(\\+\\+|\\-\\-)?(?=[\\w`\\$])",
1248 "beginCaptures": {
1249 "1": {
1250 "name": "keyword.macro.stata"
1251 },
1252 "3": {
1253 "name": "keyword.operator.arithmetic.stata"
1254 }
1255 },
1256 "end": "(?=\\\"|\\s|\\n|/|,|=)",
1257 "patterns": [
1258 {
1259 "include": "#macro-local-identifiers"
1260 },
1261 {
1262 "include": "#macro-local"
1263 },
1264 {
1265 "include": "#macro-global"
1266 }
1267 ]
1268 },
1269 {
1270 "begin": "\\b(tempvar|tempname|tempfile)\\s*(?=\\s)",
1271 "beginCaptures": {
1272 "1": {
1273 "name": "keyword.macro.stata"
1274 }
1275 },
1276 "end": "\\n",
1277 "patterns": [
1278 {
1279 "begin": "///",
1280 "end": "\\n",
1281 "name": "comment.block.stata"
1282 },
1283 {
1284 "include": "#macro-local-identifiers"
1285 },
1286 {
1287 "include": "#macro-local"
1288 },
1289 {
1290 "include": "#macro-global"
1291 }
1292 ]
1293 },
1294 {
1295 "begin": "\\b(ma(cro|cr|c)?)\\s+(drop|l(ist|is|i)?)\\s*(?=\\s)",
1296 "beginCaptures": {
1297 "0": {
1298 "name": "keyword.macro.stata"
1299 }
1300 },
1301 "end": "\\n",
1302 "patterns": [
1303 {
1304 "begin": "///",
1305 "end": "\\n",
1306 "name": "comment.block.stata"
1307 },
1308 {
1309 "match": "\\*",
1310 "name": "keyword.operator.arithmetic.stata"
1311 },
1312 {
1313 "include": "#constants"
1314 },
1315 {
1316 "include": "#macro-global"
1317 },
1318 {
1319 "include": "#macro-local"
1320 },
1321 {
1322 "include": "#comments"
1323 },
1324 {
1325 "match": "\\w{1,31}",
1326 "name": "entity.name.type.class.stata"
1327 }
1328 ]
1329 }
1330 ]
1331 },
1332 "macro-extended-functions": {
1333 "patterns": [
1334 {
1335 "match": "\\b(properties)\\b",
1336 "name": "keyword.macro.extendedfcn.stata"
1337 },
1338 {
1339 "match": "\\b(t(ype|yp|y)?|f(ormat|orma|orm|or|o)?|val(ue|u)?\\s+l(able|abl|ab|a)?|var(iable|iabl|iab|ia|i)?\\s+l(abel|abe|ab|a)?|data\\s+l(able|abl|ab|a)?|sort(edby|edb|ed|e)?|lab(el|e)?|maxlength|constraint|char)\\b",
1340 "name": "keyword.macro.extendedfcn.stata"
1341 },
1342 {
1343 "match": "\\b(permname)\\b",
1344 "name": "keyword.macro.extendedfcn.stata"
1345 },
1346 {
1347 "match": "\\b(adosubdir|dir|files?|dirs?|other|sysdir)\\b",
1348 "name": "keyword.macro.extendedfcn.stata"
1349 },
1350 {
1351 "match": "\\b(env(ironment|ironmen|ironme|ironm|iron|iro|ir|i)?)\\b",
1352 "name": "keyword.macro.extendedfcn.stata"
1353 },
1354 {
1355 "match": "\\b(all\\s+(globals|scalars|matrices)|((numeric|string)\\s+scalars))\\b",
1356 "name": "keyword.macro.extendedfcn.stata"
1357 },
1358 {
1359 "match": "\\b(list)\\s+(uniq|dups|sort|clean|retok(enize|eniz|eni|en|e)?|sizeof)\\s+(\\w{1,32})",
1360 "captures": {
1361 "1": {
1362 "name": "keyword.macro.extendedfcn.stata"
1363 },
1364 "2": {
1365 "name": "keyword.macro.extendedfcn.stata"
1366 },
1367 "3": {
1368 "name": "entity.name.type.class.stata"
1369 }
1370 }
1371 },
1372 {
1373 "match": "\\b(list)\\s+(\\w{1,32})\\s+(\\||&|\\-|===|==|in)\\s+(\\w{1,32})",
1374 "captures": {
1375 "1": {
1376 "name": "keyword.macro.extendedfcn.stata"
1377 },
1378 "2": {
1379 "name": "entity.name.type.class.stata"
1380 },
1381 "3": {
1382 "name": "keyword.operator.list.stata"
1383 },
1384 "4": {
1385 "name": "entity.name.type.class.stata"
1386 }
1387 }
1388 },
1389 {
1390 "match": "\\b(list\\s+posof)\\s+(\")(\\w+)(\")\\s+(in)\\s+(\\w{1,32})",
1391 "captures": {
1392 "1": {
1393 "name": "keyword.macro.extendedfcn.stata"
1394 },
1395 "2": {
1396 "name": "punctuation.definition.string.begin.stata"
1397 },
1398 "3": {
1399 "name": "string.quoted.double.stata"
1400 },
1401 "4": {
1402 "name": "punctuation.definition.string.end.stata"
1403 },
1404 "5": {
1405 "name": "keyword.macro.extendedfcn.stata"
1406 },
1407 "6": {
1408 "name": "entity.name.type.class.stata"
1409 }
1410 }
1411 },
1412 {
1413 "match": "\\b(rown(ames|ame|am|a)?|coln(ames|ame|am|a)?|rowf(ullnames|ullname|ullnam|ullna|ulln|ull|ul|u)?|colf(ullnames|ullname|ullnam|ullna|ulln|ull|ul|u)?|roweq?|coleq?|rownumb|colnumb|roweqnumb|coleqnumb|rownfreeparms|colnfreeparms|rownlfs|colnlfs|rowsof|colsof|rowvarlist|colvarlist|rowlfnames|collfnames)\\b",
1414 "name": "keyword.macro.extendedfcn.stata"
1415 },
1416 {
1417 "match": "\\b(tsnorm)\\b",
1418 "name": "keyword.macro.extendedfcn.stata"
1419 },
1420 {
1421 "match": "\\b((copy|(ud|u)?strlen)\\s+(loc(al|a)?|gl(obal|oba|ob|o)?))\\s+([^']+)",
1422 "captures": {
1423 "1": {
1424 "name": "keyword.macro.extendedfcn.stata"
1425 },
1426 "7": {
1427 "patterns": [
1428 {
1429 "include": "#macro-local"
1430 },
1431 {
1432 "include": "#macro-global"
1433 }
1434 ]
1435 }
1436 }
1437 },
1438 {
1439 "match": "\\b(word\\s+count)",
1440 "captures": {
1441 "1": {
1442 "name": "keyword.macro.extendedfcn.stata"
1443 }
1444 }
1445 },
1446 {
1447 "match": "(word|piece)\\s+([\\s`'\\w]+)\\s+(of)",
1448 "captures": {
1449 "1": {
1450 "name": "keyword.macro.extendedfcn.stata"
1451 },
1452 "2": {
1453 "patterns": [
1454 {
1455 "include": "#macro-local"
1456 },
1457 {
1458 "include": "#constants"
1459 }
1460 ]
1461 },
1462 "3": {
1463 "name": "keyword.macro.extendedfcn.stata"
1464 }
1465 }
1466 },
1467 {
1468 "begin": "\\b(subinstr\\s+(loc(al|a)?|gl(obal|oba|ob|o)?))\\s+(\\w{1,32})",
1469 "end": "(?=//|\\n)",
1470 "beginCaptures": {
1471 "1": {
1472 "name": "keyword.macro.extendedfcn.stata"
1473 },
1474 "5": {
1475 "name": "entity.name.type.class.stata"
1476 }
1477 },
1478 "patterns": [
1479 {
1480 "include": "#macro-local"
1481 },
1482 {
1483 "include": "#macro-global"
1484 },
1485 {
1486 "include": "#string-compound"
1487 },
1488 {
1489 "include": "#string-regular"
1490 },
1491 {
1492 "match": "(count|coun|cou|co|c)(\\()(local|loca|loc|global|globa|glob|glo|gl)\\s+(\\w{1,32})(\\))",
1493 "captures": {
1494 "1": {
1495 "name": "support.function.builtin.stata"
1496 },
1497 "2": {
1498 "name": "punctuation.definition.parameters.begin.stata"
1499 },
1500 "3": {
1501 "name": "keyword.macro.extendedfcn.stata"
1502 },
1503 "4": {
1504 "name": "entity.name.type.class.stata"
1505 },
1506 "5": {
1507 "name": "punctuation.definition.parameters.end.stata"
1508 }
1509 }
1510 }
1511 ]
1512 },
1513 {
1514 "include": "#comments"
1515 },
1516 {
1517 "include": "#macro-local"
1518 },
1519 {
1520 "include": "#macro-global"
1521 },
1522 {
1523 "include": "$self"
1524 }
1525 ]
1526 },
1527 "macro-local-escaped": {
1528 "patterns": [
1529 {
1530 "comment": "appropriately color macros that have embedded escaped `,', and $ characters for lazy evaluation",
1531 "begin": "\\\\`(?!\")",
1532 "beginCaptures": {
1533 "0": {
1534 "name": "punctuation.definition.string.begin.stata"
1535 }
1536 },
1537 "end": "\\\\'|'",
1538 "endCaptures": {
1539 "0": {
1540 "name": "punctuation.definition.string.end.stata"
1541 }
1542 },
1543 "patterns": [
1544 {
1545 "include": "#macro-local"
1546 },
1547 {
1548 "include": "#macro-global"
1549 },
1550 {
1551 "match": "\\w{1,31}",
1552 "name": "entity.name.type.class.stata"
1553 }
1554 ]
1555 }
1556 ]
1557 },
1558 "macro-local": {
1559 "patterns": [
1560 {
1561 "begin": "(`)(=)",
1562 "beginCaptures": {
1563 "1": {
1564 "name": "punctuation.definition.string.begin.stata"
1565 },
1566 "2": {
1567 "name": "keyword.operator.comparison.stata"
1568 }
1569 },
1570 "end": "'",
1571 "endCaptures": {
1572 "0": {
1573 "name": "punctuation.definition.string.end.stata"
1574 }
1575 },
1576 "patterns": [
1577 {
1578 "include": "$self"
1579 }
1580 ]
1581 },
1582 {
1583 "begin": "(`)(:)",
1584 "beginCaptures": {
1585 "1": {
1586 "name": "punctuation.definition.string.begin.stata"
1587 },
1588 "2": {
1589 "name": "keyword.operator.comparison.stata"
1590 }
1591 },
1592 "end": "'",
1593 "endCaptures": {
1594 "0": {
1595 "name": "punctuation.definition.string.end.stata"
1596 }
1597 },
1598 "contentName": "meta.macro-extended-function.stata",
1599 "patterns": [
1600 {
1601 "include": "#macro-local"
1602 },
1603 {
1604 "include": "#macro-extended-functions"
1605 },
1606 {
1607 "include": "#constants"
1608 },
1609 {
1610 "include": "#string-compound"
1611 },
1612 {
1613 "include": "#string-regular"
1614 }
1615 ]
1616 },
1617 {
1618 "begin": "(`)(macval)(\\()",
1619 "beginCaptures": {
1620 "1": {
1621 "name": "punctuation.definition.string.begin.stata"
1622 },
1623 "2": {
1624 "name": "support.function.builtin.stata"
1625 },
1626 "3": {
1627 "name": "punctuation.definition.parameters.begin.stata"
1628 }
1629 },
1630 "end": "(\\))(')",
1631 "endCaptures": {
1632 "1": {
1633 "name": "punctuation.definition.parameters.begin.stata"
1634 },
1635 "2": {
1636 "name": "punctuation.definition.string.end.stata"
1637 }
1638 },
1639 "contentName": "meta.macro-extended-function.stata",
1640 "patterns": [
1641 {
1642 "include": "#macro-local"
1643 },
1644 {
1645 "include": "#macro-global"
1646 },
1647 {
1648 "match": "\\w{1,31}",
1649 "name": "entity.name.type.class.stata"
1650 }
1651 ]
1652 },
1653 {
1654 "begin": "`(?!\")",
1655 "beginCaptures": {
1656 "0": {
1657 "name": "punctuation.definition.string.begin.stata"
1658 }
1659 },
1660 "end": "'",
1661 "endCaptures": {
1662 "0": {
1663 "name": "punctuation.definition.string.end.stata"
1664 }
1665 },
1666 "patterns": [
1667 {
1668 "match": "\\+\\+|\\-\\-",
1669 "name": "keyword.operator.arithmetic.stata"
1670 },
1671 {
1672 "include": "#macro-local"
1673 },
1674 {
1675 "include": "#macro-global"
1676 },
1677 {
1678 "include": "#comments-block"
1679 },
1680 {
1681 "begin": "[^\\w]",
1682 "end": "\\n|(?=')",
1683 "name": "comment.line.stata"
1684 },
1685 {
1686 "match": "\\w{1,31}",
1687 "name": "entity.name.type.class.stata"
1688 }
1689 ]
1690 }
1691 ]
1692 },
1693 "macro-global-escaped": {
1694 "patterns": [
1695 {
1696 "begin": "(\\\\\\$)(\\\\\\{)?",
1697 "beginCaptures": {
1698 "0": {
1699 "name": "punctuation.definition.string.begin.stata"
1700 }
1701 },
1702 "end": "(\\\\\\})|(?=\\\"|\\s|\\n|/|,)",
1703 "endCaptures": {
1704 "1": {
1705 "name": "punctuation.definition.string.end.stata"
1706 }
1707 },
1708 "patterns": [
1709 {
1710 "include": "#macro-local"
1711 },
1712 {
1713 "include": "#macro-global"
1714 },
1715 {
1716 "match": "[\\w&&[^0-9_]]\\w{0,31}|_\\w{1,31}",
1717 "name": "entity.name.type.class.stata"
1718 }
1719 ]
1720 }
1721 ]
1722 },
1723 "macro-global": {
1724 "patterns": [
1725 {
1726 "begin": "(\\$)(\\{)",
1727 "beginCaptures": {
1728 "0": {
1729 "name": "punctuation.definition.string.begin.stata"
1730 }
1731 },
1732 "end": "\\}",
1733 "endCaptures": {
1734 "0": {
1735 "name": "punctuation.definition.string.end.stata"
1736 }
1737 },
1738 "patterns": [
1739 {
1740 "include": "#macro-local"
1741 },
1742 {
1743 "include": "#macro-global"
1744 },
1745 {
1746 "include": "#comments-block"
1747 },
1748 {
1749 "begin": "[^\\w]",
1750 "end": "\\n|(?=})",
1751 "name": "comment.line.stata"
1752 },
1753 {
1754 "match": "\\w{1,32}",
1755 "name": "entity.name.type.class.stata"
1756 }
1757 ]
1758 },
1759 {
1760 "begin": "\\$",
1761 "beginCaptures": {
1762 "0": {
1763 "name": "punctuation.definition.string.begin.stata"
1764 }
1765 },
1766 "end": "(?!\\w)",
1767 "endCaptures": {
1768 "1": {
1769 "name": "punctuation.definition.string.end.stata"
1770 }
1771 },
1772 "patterns": [
1773 {
1774 "include": "#macro-local"
1775 },
1776 {
1777 "include": "#macro-global"
1778 },
1779 {
1780 "match": "[\\w&&[^0-9_]]\\w{0,31}|_\\w{1,31}",
1781 "name": "entity.name.type.class.stata"
1782 }
1783 ]
1784 }
1785 ]
1786 },
1787 "constants": {
1788 "patterns": [
1789 {
1790 "include": "#factorvariables"
1791 },
1792 {
1793 "match": "\\b(?i:(\\d+\\.\\d*(e[\\-\\+]?\\d+)?))(?=[^a-zA-Z_])",
1794 "name": "constant.numeric.float.stata"
1795 },
1796 {
1797 "match": "(?<=[^0-9a-zA-Z_])(?i:(\\.\\d+(e[\\-\\+]?\\d+)?))",
1798 "name": "constant.numeric.float.stata"
1799 },
1800 {
1801 "match": "\\b(?i:(\\d+e[\\-\\+]?\\d+))",
1802 "name": "constant.numeric.float.stata"
1803 },
1804 {
1805 "match": "\\b(\\d+)\\b",
1806 "name": "constant.numeric.integer.decimal.stata"
1807 },
1808 {
1809 "match": "(?<![\\w])(\\.(?![\\./]))(?![\\w])",
1810 "name": "constant.language.missing.stata"
1811 },
1812 {
1813 "match": "\\b_all\\b",
1814 "name": "constant.language.allvars.stata"
1815 }
1816 ]
1817 },
1818 "factorvariables": {
1819 "patterns": [
1820 {
1821 "match": "\\b(i|c|o)\\.(?=[\\w&&[^0-9]]|\\([\\w&&[^0-9]])",
1822 "name": "constant.language.factorvars.stata"
1823 },
1824 {
1825 "match": "\\b(i?b)((\\d+)|n)\\.(?=[\\w&&[^0-9]]|\\([\\w&&[^0-9]])",
1826 "captures": {
1827 "0": {
1828 "name": "constant.language.factorvars.stata"
1829 },
1830 "3": {
1831 "patterns": [
1832 {
1833 "include": "#constants"
1834 }
1835 ]
1836 }
1837 }
1838 },
1839 {
1840 "match": "\\b(i?b)(\\()(#\\d+|first|last|freq)(\\))\\.(?=[\\w&&[^0-9]]|\\([\\w&&[^0-9]])",
1841 "captures": {
1842 "0": {
1843 "name": "constant.language.factorvars.stata"
1844 },
1845 "2": {
1846 "name": "keyword.operator.parentheses.stata"
1847 },
1848 "3": {
1849 "patterns": [
1850 {
1851 "include": "#constants"
1852 },
1853 {
1854 "include": "#operators"
1855 }
1856 ]
1857 },
1858 "4": {
1859 "name": "keyword.operator.parentheses.stata"
1860 }
1861 }
1862 },
1863 {
1864 "match": "\\b(i?o?)(\\d+)\\.(?=[\\w&&[^0-9]]|\\([\\w&&[^0-9]])",
1865 "captures": {
1866 "0": {
1867 "name": "constant.language.factorvars.stata"
1868 },
1869 "2": {
1870 "patterns": [
1871 {
1872 "include": "#constants"
1873 }
1874 ]
1875 }
1876 }
1877 },
1878 {
1879 "match": "\\b(i?o?)(\\()(.*?)(\\))(\\.)(?=[\\w&&[^0-9]]|\\([\\w&&[^0-9]])",
1880 "captures": {
1881 "1": {
1882 "name": "constant.language.factorvars.stata"
1883 },
1884 "2": {
1885 "name": "keyword.operator.parentheses.stata"
1886 },
1887 "3": {
1888 "patterns": [
1889 {
1890 "include": "$self"
1891 }
1892 ]
1893 },
1894 "4": {
1895 "name": "keyword.operator.parentheses.stata"
1896 },
1897 "5": {
1898 "name": "constant.language.factorvars.stata"
1899 }
1900 }
1901 }
1902 ]
1903 },
1904 "operators": {
1905 "patterns": [
1906 {
1907 "match": "\\+\\+|\\-\\-|\\+|\\-|\\*|\\^",
1908 "name": "keyword.operator.arithmetic.stata",
1909 "comment": "++ and -- must come first to support ligatures"
1910 },
1911 {
1912 "comment": "match division operator but not path separator",
1913 "match": "(?<![\\w.&&[^0-9]])/(?![\\w.&&[^0-9]]|$)",
1914 "name": "keyword.operator.arithmetic.stata"
1915 },
1916 {
1917 "comment": "match division operator but not path separator",
1918 "match": "(?<![\\w.&&[^0-9]])\\\\(?![\\w.&&[^0-9]]|$)",
1919 "name": "keyword.operator.matrix.addrow.stata"
1920 },
1921 {
1922 "match": "\\|\\|",
1923 "name": "keyword.operator.graphcombine.stata"
1924 },
1925 {
1926 "match": "\\&|\\|",
1927 "name": "keyword.operator.logical.stata"
1928 },
1929 {
1930 "match": "(?:<=|>=|:=|==|!=|~=|<|>|=|!!|!)",
1931 "name": "keyword.operator.comparison.stata"
1932 },
1933 {
1934 "match": "\\(|\\)",
1935 "name": "keyword.operator.parentheses.stata"
1936 },
1937 {
1938 "match": "(##|#)",
1939 "name": "keyword.operator.factor-variables.stata"
1940 },
1941 {
1942 "match": "%",
1943 "name": "keyword.operator.format.stata"
1944 },
1945 {
1946 "match": ":",
1947 "name": "punctuation.separator.key-value"
1948 },
1949 {
1950 "match": "\\[",
1951 "name": "punctuation.definition.parameters.begin.stata"
1952 },
1953 {
1954 "match": "\\]",
1955 "name": "punctuation.definition.parameters.end.stata"
1956 },
1957 {
1958 "match": ",",
1959 "name": "punctuation.definition.variable.begin.stata"
1960 },
1961 {
1962 "match": ";",
1963 "name": "keyword.operator.delimiter.stata"
1964 }
1965 ]
1966 },
1967 "string-compound": {
1968 "patterns": [
1969 {
1970 "begin": "`\"",
1971 "beginCaptures": {
1972 "0": {
1973 "name": "punctuation.definition.string.begin.stata"
1974 }
1975 },
1976 "end": "\"'|(?=\n)",
1977 "endCaptures": {
1978 "0": {
1979 "name": "punctuation.definition.string.end.stata"
1980 }
1981 },
1982 "name": "string.quoted.double.compound.stata",
1983 "patterns": [
1984 {
1985 "match": "\"",
1986 "name": "string.quoted.double.compound.stata",
1987 "comment": "This must come before #string-regular and #string-compound to accurately color `\"\"\"' in strings"
1988 },
1989 {
1990 "match": "```(?=[^']*\")",
1991 "name": "meta.markdown.code.block.stata",
1992 "comment": "see https://github.com/kylebarron/language-stata/issues/53"
1993 },
1994 {
1995 "include": "#string-regular"
1996 },
1997 {
1998 "include": "#string-compound"
1999 },
2000 {
2001 "include": "#macro-local-escaped"
2002 },
2003 {
2004 "include": "#macro-global-escaped"
2005 },
2006 {
2007 "include": "#macro-local"
2008 },
2009 {
2010 "include": "#macro-global"
2011 }
2012 ]
2013 }
2014 ]
2015 },
2016 "string-regular": {
2017 "patterns": [
2018 {
2019 "begin": "(?<!`)\"",
2020 "beginCaptures": {
2021 "0": {
2022 "name": "punctuation.definition.string.begin.stata"
2023 }
2024 },
2025 "end": "(\")(')?|(?=\n)",
2026 "endCaptures": {
2027 "1": {
2028 "name": "punctuation.definition.string.end.stata"
2029 },
2030 "2": {
2031 "name": "invalid.illegal.punctuation.stata"
2032 }
2033 },
2034 "name": "string.quoted.double.stata",
2035 "patterns": [
2036 {
2037 "match": "```(?=[^']*\")",
2038 "name": "meta.markdown.code.block.stata",
2039 "comment": "see https://github.com/kylebarron/language-stata/issues/53"
2040 },
2041 {
2042 "include": "#macro-local-escaped"
2043 },
2044 {
2045 "include": "#macro-global-escaped"
2046 },
2047 {
2048 "include": "#macro-local"
2049 },
2050 {
2051 "include": "#macro-global"
2052 }
2053 ]
2054 }
2055 ]
2056 },
2057 "subscripts": {
2058 "patterns": [
2059 {
2060 "comment": "highlight expressions, like [_n], when using subscripts on a variable",
2061 "begin": "(?<=[\\w'])(\\[)",
2062 "beginCaptures": {
2063 "1": {
2064 "name": "punctuation.definition.parameters.begin.stata"
2065 }
2066 },
2067 "end": "(\\])",
2068 "endCaptures": {
2069 "1": {
2070 "name": "punctuation.definition.parameters.end.stata"
2071 }
2072 },
2073 "name": "meta.subscripts.stata",
2074 "patterns": [
2075 {
2076 "include": "#macro-local"
2077 },
2078 {
2079 "include": "#macro-global"
2080 },
2081 {
2082 "include": "#builtin_variables"
2083 },
2084 {
2085 "include": "#operators"
2086 },
2087 {
2088 "include": "#constants"
2089 },
2090 {
2091 "include": "#functions"
2092 }
2093 ]
2094 }
2095 ]
2096 },
2097 "reserved-names": {
2098 "patterns": [
2099 {
2100 "match": "\\b(_all|_b|byte|_coef|_cons|double|float|if|in|int|long|_n|_N|_pi|_pred|_rc|_skip|str[0-9]+|strL|using|with)\\b",
2101 "name": "invalid.illegal.name.stata"
2102 },
2103 {
2104 "match": "[^\\w'`\\$\\(\\)\\s]",
2105 "name": "invalid.illegal.name.stata"
2106 },
2107 {
2108 "match": "[0-9][\\w]{31,}",
2109 "name": "invalid.illegal.name.stata"
2110 },
2111 {
2112 "match": "\\w{33,}",
2113 "name": "invalid.illegal.name.stata"
2114 }
2115 ]
2116 },
2117 "macro-local-identifiers": {
2118 "patterns": [
2119 {
2120 "match": "[^\\w'`\\$\\(\\)\\s]",
2121 "name": "invalid.illegal.name.stata"
2122 },
2123 {
2124 "match": "\\w{32,}",
2125 "name": "invalid.illegal.name.stata"
2126 },
2127 {
2128 "match": "\\w{1,31}",
2129 "name": "entity.name.type.class.stata"
2130 }
2131 ]
2132 },
2133 "ascii-regex-functions": {
2134 "patterns": [
2135 {
2136 "comment": "color regexm with regular quotes i.e. \" ",
2137 "match": "\\b(regexm)(\\()([^,]+)(,)\\s*(\")([^\"]+)(\"(')?)\\s*(\\))",
2138 "captures": {
2139 "1": {
2140 "name": "support.function.builtin.stata"
2141 },
2142 "2": {
2143 "name": "punctuation.definition.parameters.begin.stata"
2144 },
2145 "3": {
2146 "patterns": [
2147 {
2148 "include": "#string-compound"
2149 },
2150 {
2151 "include": "#string-regular"
2152 },
2153 {
2154 "include": "#macro-local"
2155 },
2156 {
2157 "include": "#macro-global"
2158 },
2159 {
2160 "include": "#functions"
2161 },
2162 {
2163 "match": "[\\w&&[^0-9]]\\w{0,31}",
2164 "name": "variable.parameter.function.stata"
2165 },
2166 {
2167 "include": "#comments-triple-slash"
2168 }
2169 ]
2170 },
2171 "4": {
2172 "name": "punctuation.definition.variable.begin.stata"
2173 },
2174 "5": {
2175 "name": "punctuation.definition.string.begin.stata"
2176 },
2177 "6": {
2178 "patterns": [
2179 {
2180 "include": "#ascii-regex-internals"
2181 }
2182 ]
2183 },
2184 "7": {
2185 "name": "punctuation.definition.string.end.stata"
2186 },
2187 "8": {
2188 "name": "invalid.illegal.punctuation.stata"
2189 },
2190 "9": {
2191 "name": "punctuation.definition.parameters.end.stata"
2192 }
2193 }
2194 },
2195 {
2196 "comment": "color regexm with compound quotes",
2197 "match": "\\b(regexm)(\\()([^,]+)(,)\\s*(`\")([^\"]+)(\"')\\s*(\\))",
2198 "captures": {
2199 "1": {
2200 "name": "support.function.builtin.stata"
2201 },
2202 "2": {
2203 "name": "punctuation.definition.parameters.begin.stata"
2204 },
2205 "3": {
2206 "patterns": [
2207 {
2208 "include": "#string-compound"
2209 },
2210 {
2211 "include": "#string-regular"
2212 },
2213 {
2214 "include": "#macro-local"
2215 },
2216 {
2217 "include": "#macro-global"
2218 },
2219 {
2220 "include": "#functions"
2221 },
2222 {
2223 "match": "[\\w&&[^0-9]]\\w{0,31}",
2224 "name": "variable.parameter.function.stata"
2225 },
2226 {
2227 "include": "#comments-triple-slash"
2228 }
2229 ]
2230 },
2231 "4": {
2232 "name": "punctuation.definition.variable.begin.stata"
2233 },
2234 "5": {
2235 "name": "punctuation.definition.string.begin.stata"
2236 },
2237 "6": {
2238 "patterns": [
2239 {
2240 "include": "#ascii-regex-internals"
2241 }
2242 ]
2243 },
2244 "7": {
2245 "name": "punctuation.definition.string.end.stata"
2246 },
2247 "8": {
2248 "name": "punctuation.definition.parameters.end.stata"
2249 }
2250 }
2251 },
2252 {
2253 "comment": "color regexr with regular quotes i.e. \" ",
2254 "match": "\\b(regexr)(\\()([^,]+)(,)\\s*(\")([^\"]+)(\"(')?)\\s*([^\\)]*)(\\))",
2255 "captures": {
2256 "1": {
2257 "name": "support.function.builtin.stata"
2258 },
2259 "2": {
2260 "name": "punctuation.definition.parameters.begin.stata"
2261 },
2262 "3": {
2263 "patterns": [
2264 {
2265 "include": "#string-compound"
2266 },
2267 {
2268 "include": "#string-regular"
2269 },
2270 {
2271 "include": "#macro-local"
2272 },
2273 {
2274 "include": "#macro-global"
2275 },
2276 {
2277 "include": "#functions"
2278 },
2279 {
2280 "match": "[\\w&&[^0-9]]\\w{0,31}",
2281 "name": "variable.parameter.function.stata"
2282 },
2283 {
2284 "include": "#comments"
2285 }
2286 ]
2287 },
2288 "4": {
2289 "name": "punctuation.definition.variable.begin.stata"
2290 },
2291 "5": {
2292 "name": "punctuation.definition.string.begin.stata"
2293 },
2294 "6": {
2295 "patterns": [
2296 {
2297 "include": "#ascii-regex-internals"
2298 }
2299 ]
2300 },
2301 "7": {
2302 "name": "punctuation.definition.string.end.stata"
2303 },
2304 "8": {
2305 "name": "invalid.illegal.punctuation.stata"
2306 },
2307 "9": {
2308 "patterns": [
2309 {
2310 "match": ",",
2311 "name": "punctuation.definition.variable.begin.stata"
2312 },
2313 {
2314 "include": "#string-compound"
2315 },
2316 {
2317 "include": "#string-regular"
2318 },
2319 {
2320 "include": "#macro-local"
2321 },
2322 {
2323 "include": "#macro-global"
2324 },
2325 {
2326 "include": "#functions"
2327 },
2328 {
2329 "match": "[\\w&&[^0-9]]\\w{0,31}",
2330 "name": "variable.parameter.function.stata"
2331 },
2332 {
2333 "include": "#comments-triple-slash"
2334 }
2335 ]
2336 },
2337 "10": {
2338 "name": "punctuation.definition.parameters.end.stata"
2339 }
2340 }
2341 },
2342 {
2343 "comment": "color regexr with compound quotes i.e. `\"text\"' ",
2344 "match": "\\b(regexr)(\\()([^,]+)(,)\\s*(`\")([^\"]+)(\"')\\s*([^\\)]*)(\\))",
2345 "captures": {
2346 "1": {
2347 "name": "support.function.builtin.stata"
2348 },
2349 "2": {
2350 "name": "punctuation.definition.parameters.begin.stata"
2351 },
2352 "3": {
2353 "patterns": [
2354 {
2355 "include": "#string-compound"
2356 },
2357 {
2358 "include": "#string-regular"
2359 },
2360 {
2361 "include": "#macro-local"
2362 },
2363 {
2364 "include": "#macro-global"
2365 },
2366 {
2367 "include": "#functions"
2368 },
2369 {
2370 "match": "[\\w&&[^0-9]]\\w{0,31}",
2371 "name": "variable.parameter.function.stata"
2372 },
2373 {
2374 "include": "#comments"
2375 }
2376 ]
2377 },
2378 "4": {
2379 "name": "punctuation.definition.variable.begin.stata"
2380 },
2381 "5": {
2382 "name": "punctuation.definition.string.begin.stata"
2383 },
2384 "6": {
2385 "patterns": [
2386 {
2387 "include": "#ascii-regex-internals"
2388 }
2389 ]
2390 },
2391 "7": {
2392 "name": "punctuation.definition.string.end.stata"
2393 },
2394 "8": {
2395 "patterns": [
2396 {
2397 "match": ",",
2398 "name": "punctuation.definition.variable.begin.stata"
2399 },
2400 {
2401 "include": "#string-compound"
2402 },
2403 {
2404 "include": "#string-regular"
2405 },
2406 {
2407 "include": "#macro-local"
2408 },
2409 {
2410 "include": "#macro-global"
2411 },
2412 {
2413 "include": "#functions"
2414 },
2415 {
2416 "match": "[\\w&&[^0-9]]\\w{0,31}",
2417 "name": "variable.parameter.function.stata"
2418 },
2419 {
2420 "include": "#comments-triple-slash"
2421 }
2422 ]
2423 },
2424 "9": {
2425 "name": "punctuation.definition.parameters.end.stata"
2426 }
2427 }
2428 }
2429 ]
2430 },
2431 "ascii-regex-internals": {
2432 "patterns": [
2433 {
2434 "match": "\\^",
2435 "name": "keyword.control.anchor.stata"
2436 },
2437 {
2438 "match": "\\$(?![a-zA-Z_\\{])",
2439 "name": "keyword.control.anchor.stata",
2440 "comment": "matched when not a global, but must be ascii"
2441 },
2442 {
2443 "match": "[\\?\\+\\*]",
2444 "name": "keyword.control.quantifier.stata"
2445 },
2446 {
2447 "match": "\\|",
2448 "name": "keyword.control.or.stata"
2449 },
2450 {
2451 "begin": "(\\()(?=\\?|\\*|\\+)",
2452 "beginCaptures": {
2453 "1": {
2454 "name": "keyword.operator.group.stata"
2455 }
2456 },
2457 "end": "\\)",
2458 "endCaptures": {
2459 "0": {
2460 "name": "keyword.operator.group.stata"
2461 }
2462 },
2463 "contentName": "invalid.illegal.regexm.stata"
2464 },
2465 {
2466 "begin": "(\\()",
2467 "beginCaptures": {
2468 "1": {
2469 "name": "keyword.operator.group.stata"
2470 }
2471 },
2472 "end": "(\\))",
2473 "endCaptures": {
2474 "1": {
2475 "name": "keyword.operator.group.stata"
2476 }
2477 },
2478 "patterns": [
2479 {
2480 "include": "#ascii-regex-internals"
2481 }
2482 ]
2483 },
2484 {
2485 "include": "#ascii-regex-character-class"
2486 },
2487 {
2488 "include": "#macro-local"
2489 },
2490 {
2491 "include": "#macro-global"
2492 },
2493 {
2494 "comment": "NOTE: Error if I have .+ No idea why but it works fine it seems with just .",
2495 "match": ".",
2496 "name": "string.quoted.stata"
2497 }
2498 ]
2499 },
2500 "ascii-regex-character-class": {
2501 "patterns": [
2502 {
2503 "match": "\\\\[\\*\\+\\?\\-\\.\\^\\$\\|\\[\\]\\(\\)\\\\]",
2504 "name": "constant.character.escape.backslash.stata"
2505 },
2506 {
2507 "match": "\\.",
2508 "name": "constant.character.character-class.stata"
2509 },
2510 {
2511 "match": "\\\\.",
2512 "name": "illegal.invalid.character-class.stata"
2513 },
2514 {
2515 "begin": "(\\[)(\\^)?",
2516 "beginCaptures": {
2517 "1": {
2518 "name": "punctuation.definition.character-class.stata"
2519 },
2520 "2": {
2521 "name": "keyword.operator.negation.stata"
2522 }
2523 },
2524 "end": "(\\])",
2525 "endCaptures": {
2526 "1": {
2527 "name": "punctuation.definition.character-class.stata"
2528 }
2529 },
2530 "name": "constant.other.character-class.set.stata",
2531 "patterns": [
2532 {
2533 "include": "#ascii-regex-character-class"
2534 },
2535 {
2536 "captures": {
2537 "2": {
2538 "name": "constant.character.escape.backslash.stata"
2539 },
2540 "4": {
2541 "name": "constant.character.escape.backslash.stata"
2542 }
2543 },
2544 "match": "((\\\\.)|.)\\-((\\\\.)|[^\\]])",
2545 "name": "constant.other.character-class.range.stata"
2546 }
2547 ]
2548 }
2549 ]
2550 },
2551 "unicode-regex-functions": {
2552 "patterns": [
2553 {
2554 "comment": "color regexm with regular quotes i.e. \" ",
2555 "match": "\\b(ustrregexm)(\\()([^,]+)(,)\\s*(\")([^\"]+)(\"(')?)([,0-9\\s]*)?\\s*(\\))",
2556 "captures": {
2557 "1": {
2558 "name": "support.function.builtin.stata"
2559 },
2560 "2": {
2561 "name": "punctuation.definition.parameters.begin.stata"
2562 },
2563 "3": {
2564 "patterns": [
2565 {
2566 "include": "#string-compound"
2567 },
2568 {
2569 "include": "#string-regular"
2570 },
2571 {
2572 "include": "#macro-local"
2573 },
2574 {
2575 "include": "#macro-global"
2576 },
2577 {
2578 "include": "#functions"
2579 },
2580 {
2581 "match": "[\\w&&[^0-9]]\\w{0,31}",
2582 "name": "variable.parameter.function.stata"
2583 },
2584 {
2585 "include": "#comments-triple-slash"
2586 }
2587 ]
2588 },
2589 "4": {
2590 "name": "punctuation.definition.variable.begin.stata"
2591 },
2592 "5": {
2593 "name": "punctuation.definition.string.begin.stata"
2594 },
2595 "6": {
2596 "patterns": [
2597 {
2598 "include": "#unicode-regex-internals"
2599 }
2600 ]
2601 },
2602 "7": {
2603 "name": "punctuation.definition.string.end.stata"
2604 },
2605 "8": {
2606 "name": "invalid.illegal.punctuation.stata"
2607 },
2608 "9": {
2609 "patterns": [
2610 {
2611 "include": "#constants"
2612 },
2613 {
2614 "match": ",",
2615 "name": "punctuation.definition.variable.begin.stata"
2616 }
2617 ]
2618 },
2619 "10": {
2620 "name": "punctuation.definition.parameters.end.stata"
2621 }
2622 }
2623 },
2624 {
2625 "comment": "color regexm with compound quotes",
2626 "match": "\\b(ustrregexm)(\\()([^,]+)(,)\\s*(`\")([^\"]+)(\"')([,0-9\\s]*)?\\s*(\\))",
2627 "captures": {
2628 "1": {
2629 "name": "support.function.builtin.stata"
2630 },
2631 "2": {
2632 "name": "punctuation.definition.parameters.begin.stata"
2633 },
2634 "3": {
2635 "patterns": [
2636 {
2637 "include": "#string-compound"
2638 },
2639 {
2640 "include": "#string-regular"
2641 },
2642 {
2643 "include": "#macro-local"
2644 },
2645 {
2646 "include": "#macro-global"
2647 },
2648 {
2649 "include": "#functions"
2650 },
2651 {
2652 "match": "[\\w&&[^0-9]]\\w{0,31}",
2653 "name": "variable.parameter.function.stata"
2654 },
2655 {
2656 "include": "#comments-triple-slash"
2657 }
2658 ]
2659 },
2660 "4": {
2661 "name": "punctuation.definition.variable.begin.stata"
2662 },
2663 "5": {
2664 "name": "punctuation.definition.string.begin.stata"
2665 },
2666 "6": {
2667 "patterns": [
2668 {
2669 "include": "#unicode-regex-internals"
2670 }
2671 ]
2672 },
2673 "7": {
2674 "name": "punctuation.definition.string.end.stata"
2675 },
2676 "8": {
2677 "patterns": [
2678 {
2679 "include": "#constants"
2680 },
2681 {
2682 "match": ",",
2683 "name": "punctuation.definition.variable.begin.stata"
2684 }
2685 ]
2686 },
2687 "9": {
2688 "name": "punctuation.definition.parameters.end.stata"
2689 }
2690 }
2691 },
2692 {
2693 "comment": "color regexr with regular quotes i.e. \" ",
2694 "match": "\\b(ustrregexrf|ustrregexra)(\\()([^,]+)(,)\\s*(\")([^\"]+)(\"(')?)\\s*([^\\)]*)(\\))",
2695 "captures": {
2696 "1": {
2697 "name": "support.function.builtin.stata"
2698 },
2699 "2": {
2700 "name": "punctuation.definition.parameters.begin.stata"
2701 },
2702 "3": {
2703 "patterns": [
2704 {
2705 "include": "#string-compound"
2706 },
2707 {
2708 "include": "#string-regular"
2709 },
2710 {
2711 "include": "#macro-local"
2712 },
2713 {
2714 "include": "#macro-global"
2715 },
2716 {
2717 "include": "#functions"
2718 },
2719 {
2720 "match": "[\\w&&[^0-9]]\\w{0,31}",
2721 "name": "variable.parameter.function.stata"
2722 },
2723 {
2724 "include": "#comments"
2725 }
2726 ]
2727 },
2728 "4": {
2729 "name": "punctuation.definition.variable.begin.stata"
2730 },
2731 "5": {
2732 "name": "punctuation.definition.string.begin.stata"
2733 },
2734 "6": {
2735 "patterns": [
2736 {
2737 "include": "#unicode-regex-internals"
2738 }
2739 ]
2740 },
2741 "7": {
2742 "name": "punctuation.definition.string.end.stata"
2743 },
2744 "8": {
2745 "name": "invalid.illegal.punctuation.stata"
2746 },
2747 "9": {
2748 "patterns": [
2749 {
2750 "match": ",",
2751 "name": "punctuation.definition.variable.begin.stata"
2752 },
2753 {
2754 "include": "#string-compound"
2755 },
2756 {
2757 "include": "#string-regular"
2758 },
2759 {
2760 "include": "#macro-local"
2761 },
2762 {
2763 "include": "#macro-global"
2764 },
2765 {
2766 "include": "#functions"
2767 },
2768 {
2769 "match": "[\\w&&[^0-9]]\\w{0,31}",
2770 "name": "variable.parameter.function.stata"
2771 },
2772 {
2773 "include": "#comments-triple-slash"
2774 },
2775 {
2776 "include": "#constants"
2777 }
2778 ]
2779 },
2780 "10": {
2781 "name": "punctuation.definition.parameters.end.stata"
2782 }
2783 }
2784 },
2785 {
2786 "comment": "color regexr with compound quotes i.e. `\"text\"' ",
2787 "match": "\\b(ustrregexrf|ustrregexra)(\\()([^,]+)(,)\\s*(`\")([^\"]+)(\"')\\s*([^\\)]*)(\\))",
2788 "captures": {
2789 "1": {
2790 "name": "support.function.builtin.stata"
2791 },
2792 "2": {
2793 "name": "punctuation.definition.parameters.begin.stata"
2794 },
2795 "3": {
2796 "patterns": [
2797 {
2798 "include": "#string-compound"
2799 },
2800 {
2801 "include": "#string-regular"
2802 },
2803 {
2804 "include": "#macro-local"
2805 },
2806 {
2807 "include": "#macro-global"
2808 },
2809 {
2810 "include": "#functions"
2811 },
2812 {
2813 "match": "[\\w&&[^0-9]]\\w{0,31}",
2814 "name": "variable.parameter.function.stata"
2815 },
2816 {
2817 "include": "#comments"
2818 }
2819 ]
2820 },
2821 "4": {
2822 "name": "punctuation.definition.variable.begin.stata"
2823 },
2824 "5": {
2825 "name": "punctuation.definition.string.begin.stata"
2826 },
2827 "6": {
2828 "patterns": [
2829 {
2830 "include": "#unicode-regex-internals"
2831 }
2832 ]
2833 },
2834 "7": {
2835 "name": "punctuation.definition.string.end.stata"
2836 },
2837 "8": {
2838 "patterns": [
2839 {
2840 "match": ",",
2841 "name": "punctuation.definition.variable.begin.stata"
2842 },
2843 {
2844 "include": "#string-compound"
2845 },
2846 {
2847 "include": "#string-regular"
2848 },
2849 {
2850 "include": "#macro-local"
2851 },
2852 {
2853 "include": "#macro-global"
2854 },
2855 {
2856 "include": "#functions"
2857 },
2858 {
2859 "match": "[\\w&&[^0-9]]\\w{0,31}",
2860 "name": "variable.parameter.function.stata"
2861 },
2862 {
2863 "include": "#comments-triple-slash"
2864 },
2865 {
2866 "include": "#constants"
2867 }
2868 ]
2869 },
2870 "9": {
2871 "name": "punctuation.definition.parameters.end.stata"
2872 }
2873 }
2874 }
2875 ]
2876 },
2877 "unicode-regex-internals": {
2878 "patterns": [
2879 {
2880 "match": "\\\\[bBAZzG]|\\^",
2881 "name": "keyword.control.anchor.stata"
2882 },
2883 {
2884 "match": "\\$(?![[\\w&&[^0-9_]][\\w]{0,31}|_[\\w]{1,31}\\{])",
2885 "name": "keyword.control.anchor.stata",
2886 "comment": "matched when not a global"
2887 },
2888 {
2889 "match": "\\\\[1-9][0-9]?",
2890 "name": "keyword.other.back-reference.stata"
2891 },
2892 {
2893 "match": "[?+*][?+]?|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??",
2894 "name": "keyword.operator.quantifier.stata"
2895 },
2896 {
2897 "match": "\\|",
2898 "name": "keyword.operator.or.stata"
2899 },
2900 {
2901 "begin": "\\((?!\\?\\#|\\?=|\\?!|\\?<=|\\?<!)",
2902 "end": "\\)",
2903 "name": "keyword.operator.group.stata",
2904 "patterns": [
2905 {
2906 "include": "#unicode-regex-internals"
2907 }
2908 ]
2909 },
2910 {
2911 "begin": "\\(\\?\\#",
2912 "end": "\\)",
2913 "name": "comment.block.stata"
2914 },
2915 {
2916 "comment": "We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.",
2917 "match": "(?<=^|\\s)#\\s[[a-zA-Z0-9,. \\t?!-:][^\\x{00}-\\x{7F}]]*$",
2918 "name": "comment.line.number-sign.stata"
2919 },
2920 {
2921 "match": "\\(\\?[iLmsux]+\\)",
2922 "name": "keyword.other.option-toggle.stata"
2923 },
2924 {
2925 "begin": "(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?<!))",
2926 "beginCaptures": {
2927 "1": {
2928 "name": "keyword.operator.group.stata"
2929 },
2930 "2": {
2931 "name": "punctuation.definition.group.assertion.stata"
2932 },
2933 "3": {
2934 "name": "keyword.assertion.look-ahead.stata"
2935 },
2936 "4": {
2937 "name": "keyword.assertion.negative-look-ahead.stata"
2938 },
2939 "5": {
2940 "name": "keyword.assertion.look-behind.stata"
2941 },
2942 "6": {
2943 "name": "keyword.assertion.negative-look-behind.stata"
2944 }
2945 },
2946 "end": "(\\))",
2947 "endCaptures": {
2948 "1": {
2949 "name": "keyword.operator.group.stata"
2950 }
2951 },
2952 "name": "meta.group.assertion.stata",
2953 "patterns": [
2954 {
2955 "include": "#unicode-regex-internals"
2956 }
2957 ]
2958 },
2959 {
2960 "begin": "(\\()(\\?\\(([1-9][0-9]?|[a-zA-Z_][a-zA-Z_0-9]*)\\))",
2961 "beginCaptures": {
2962 "1": {
2963 "name": "punctuation.definition.group.stata"
2964 },
2965 "2": {
2966 "name": "punctuation.definition.group.assertion.conditional.stata"
2967 },
2968 "3": {
2969 "name": "entity.name.section.back-reference.stata"
2970 }
2971 },
2972 "comment": "we can make this more sophisticated to match the | character that separates yes-pattern from no-pattern, but it's not really necessary.",
2973 "end": "(\\))",
2974 "name": "meta.group.assertion.conditional.stata",
2975 "patterns": [
2976 {
2977 "include": "#unicode-regex-internals"
2978 }
2979 ]
2980 },
2981 {
2982 "include": "#unicode-regex-character-class"
2983 },
2984 {
2985 "include": "#macro-local"
2986 },
2987 {
2988 "include": "#macro-global"
2989 },
2990 {
2991 "comment": "NOTE: Error if I have .+ No idea why but it works fine it seems with just .",
2992 "match": ".",
2993 "name": "string.quoted.stata"
2994 }
2995 ]
2996 },
2997 "unicode-regex-character-class": {
2998 "patterns": [
2999 {
3000 "match": "\\\\[wWsSdD]|\\.",
3001 "name": "constant.character.character-class.stata"
3002 },
3003 {
3004 "match": "\\\\.",
3005 "name": "constant.character.escape.backslash.stata"
3006 },
3007 {
3008 "begin": "(\\[)(\\^)?",
3009 "beginCaptures": {
3010 "1": {
3011 "name": "punctuation.definition.character-class.stata"
3012 },
3013 "2": {
3014 "name": "keyword.operator.negation.stata"
3015 }
3016 },
3017 "end": "(\\])",
3018 "endCaptures": {
3019 "1": {
3020 "name": "punctuation.definition.character-class.stata"
3021 }
3022 },
3023 "name": "constant.other.character-class.set.stata",
3024 "patterns": [
3025 {
3026 "include": "#unicode-regex-character-class"
3027 },
3028 {
3029 "captures": {
3030 "2": {
3031 "name": "constant.character.escape.backslash.stata"
3032 },
3033 "4": {
3034 "name": "constant.character.escape.backslash.stata"
3035 }
3036 },
3037 "match": "((\\\\.)|.)\\-((\\\\.)|[^\\]])",
3038 "name": "constant.other.character-class.range.stata"
3039 }
3040 ]
3041 }
3042 ]
3043 }
3044 }
3045 }
3046