github-linguist 4.8.0 → 4.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c3ed4975037b73a7046ebe87f7e364c73d3812f
4
- data.tar.gz: d4cd16282213e36fa4d4f4b115ffa613ada41e74
3
+ metadata.gz: 07845abbd4f2214e887fda630dc44c9bb40d7940
4
+ data.tar.gz: 1f52edcadd2875212d0ae89811505f80aa422a15
5
5
  SHA512:
6
- metadata.gz: 971c1998a6ac1954cfbdbd416bd4a657f20047eef8eb5226702ec7112937d9d6f5fd49aaaa59e0979420ef863bb1691555b2fddee9710a51ba1c1ad9a2319b32
7
- data.tar.gz: 3eb483a513e2dfdb438dd7cd5e92dbfb543e28ad1c17566cd4ba14bbc39434fdb4b0c7ed5d31e3403c8f247aac958607f96ef705cbabc0d2f9816647c3e55530
6
+ metadata.gz: e65f77addf8dbe84b87681885adafb488c54ecec634abcb05290df194842396fc412281175137ecc2760bf3f0e51b6355ee279a8ab98201ede5986dd591c28b3
7
+ data.tar.gz: a518a61fbf4cc169a4fd33c0cb1297135f1edf2342ea83db5094d22f8babae8d20f048ac3e3cd75b9a59701af3a4c55b7ce9571fd9440fca90f32755c7b68637
@@ -0,0 +1,121 @@
1
+ {
2
+ "fileTypes": [
3
+ "asm",
4
+ "inc"
5
+ ],
6
+ "name": "Assembly x86 (NASM)",
7
+ "patterns": [
8
+ {
9
+ "match": "\\b(?i)(v)?(aaa|aad|aam|aas|adc|add|addpd|addps|addsd|addss|addsubpd|addsubps|aesdec|aesdeclast|aesenc|aesenclast|aesimc|aeskeygenassist|and|andpd|andps|andnpd|andnps|arpl|blendpd|bmi|blendps|blendvpd|blendvps|bound|bsf|bsr|bswap|bt|btc|btr|bts|cbw|cwde|cdqe|clc|cld|cflush|clts|cmc|cmov(n?e|ge?|ae?|le?|be?|n?o|n?z)|cmp|cmppd|cmpps|cmps|cnpsb|cmpsw|cmpsd|cmpsq|cmpss|cmpxchg|cmpxchg8b|cmpxchg16b|comisd|comiss|cpuid|crc32|cvtdq2pd|cvtdq2ps|cvtpd2dq|cvtpd2pi|cvtpd2ps|cvtpi2pd|cvtpi2ps|cvtps2dq|cvtps2pd|cvtps2pi|cvtsd2si|cvtsd2ss|cvts2sd|cvtsi2ss|cvtss2sd|cvtss2si|cvttpd2dq|cvtpd2pi|cvttps2dq|cvttps2pi|cvttps2dq|cvttps2pi|cvttsd2si|cvttss2si|cwd|cdq|cqo|daa|das|dec|div|divpd|divps|divsd|divss|dppd|dpps|emms|enter|extractps|f2xm1|fabs|fadd|faddp|fiadd|fbld|fbstp|fchs|fclex|fnclex|fcmov(n?e|ge?|ae?|le?|be?|n?o|n?z)|fcom|fcmop|fcompp|fcomi|fcomip|fucomi|fucomip|fcos|fdecstp|fdiv|fdivp|fidiv|fdivr|fdivrp|fidivr|ffree|ficom|ficomp|fild|fincstp|finit|fnint|fist|fistp|fisttp|fld|fld1|fldl2t|fldl2e|fldpi|fldlg2|fldln2|fldz|fldcw|fldenv|fmul|fmulp|fimul|fnop|fpatan|fprem|fprem1|fptan|frndint|frstor|fsave|fnsave|fscale|fsin|fsincos|fsqrt|fst|fstp|fstcw|fnstcw|fstenv|fnstenv|fsts(w?)|fnstsw|fsub|fsubp|fisub|fsubr|fsubrp|fisubr|ftst|fucom|fucomp|fucompp|fxam|fxch|fxrstor|fxsave|fxtract|fyl2x|fyl2xp1|haddpd|haddps|husbpd|hsubps|idiv|imul|in|inc|ins|insb|insw|insd|insertps|int|into|invd|invplg|invpcid|iret|iretd|iretq|lahf|lar|lddqu|ldmxcsr|lds|les|lfs|lgs|lss|lea|leave|lfence|lgdt|lidt|llgdt|lmsw|lock|lods|lodsb|lodsw|lodsd|lodsq|lsl|ltr|maskmovdqu|maskmovq|maxpd|maxps|maxsd|maxss|mfence|minpd|minps|minsd|minss|monitor|mov|movapd|movaps|movbe|movd|movq|movddup|movdqa|movdqu|movq2q|movhlps|movhpd|movhps|movlhps|movlpd|movlps|movmskpd|movmskps|movntdqa|movntdq|movnti|movntpd|movntps|movntq|movq|movq2dq|movs|movsb|movsw|movsd|movsq|movsd|movshdup|movsldup|movss|movsx|movsxd|movupd|movups|movzx|mpsadbw|mul|mulpd|mulps|mulsd|mulss|mwait|neg|not|or|orpd|orps|out|outs|outsb|outsw|outsd|pabsb|pabsw|pabsd|packsswb|packssdw|packusdw|packuswb|paddb|paddw|paddd|paddq|paddsb|paddsw|paddusb|paddusw|palignr|pand|pandn|pause|pavgb|pavgw|pblendvb|pblendw|pclmulqdq|pcmpeqb|pcmpeqw|pcmpeqd|pcmpeqq|pcmpestri|pcmpestrm|pcmptb|pcmptgw|pcmpgtd|pcmpgtq|pcmpistri|pcmpisrm|pdep|pext|pextrb|pextrd|pextrq|pextrw|phaddw|phaddd|phaddsw|phinposuw|phsubw|phsubd|phsubsw|pinsrb|pinsrd|pinsrq|pinsrw|pmaddubsw|pmadddwd|pmaxsb|pmaxsd|pmaxsw|pmaxsw|pmaxub|pmaxud|pmaxuw|pminsb|pminsd|pminsw|pminub|pminud|pminuw|pmovmskb|pmovsx|pmovzx|pmuldq|pmulhrsw|pmulhuw|pmulhw|pmulld|pmullw|pmuludw|pop|popa|popad|popcnt|popf|popfd|popfq|por|prefetch|psadbw|pshufb|pshufd|pshufhw|pshuflw|pshufw|psignb|psignw|psignd|pslldq|psllw|pslld|psllq|psraw|psrad|psrldq|psrlw|psrld|psrlq|psubb|psubw|psubd|psubq|psubsb|psubsw|psubusb|psubusw|test|ptest|punpckhbw|punpckhwd|punpckhdq|punpckhddq|punpcklbw|punpcklwd|punpckldq|punpckldqd|push|pusha|pushad|pushf|pushfd|pxor|prcl|rcr|rol|ror|rcpps|rcpss|rdfsbase|rdgsbase|rdmsr|rdpmc|rdrand|rdtsc|rdtscp|rep|repe|repz|repne|repnz|roundpd|roundps|roundsd|roundss|rsm|rsqrps|rsqrtss|sahf|sal|sar|shl|shr|sbb|scas|scasb|scasw|scasd|set(n?e|ge?|ae?|le?|be?|n?o|n?z)|sfence|sgdt|shld|shrd|shufpd|shufps|sidt|sldt|smsw|sqrtpd|sqrtps|sqrtsd|sqrtss|stc|std|stmxcsr|stos|stosb|stosw|stosd|stosq|str|sub|subpd|subps|subsd|subss|swapgs|syscall|sysenter|sysexit|sysret|teset|ucomisd|ucomiss|ud2|unpckhpd|unpckhps|unpcklpd|unpcklps|vbroadcast|vcvtph2ps|vcvtp2sph|verr|verw|vextractf128|vinsertf128|vmaskmov|vpermilpd|vpermilps|vperm2f128|vtestpd|vzeroall|vzeroupper|wait|fwait|wbinvd|wrfsbase|wrgsbase|wrmsr|xadd|xchg|xgetbv|xlat|xlatb|xor|xorpd|xorps|xrstor|xsave|xsaveopt|xsetbv|lzcnt|extrq|insertq|movntsd|movntss|vfmaddpd|vfmaddps|vfmaddsd|vfmaddss|vfmaddsubbpd|vfmaddsubps|vfmsubaddpd|vfmsubaddps|vfmsubpd|vfmsubps|vfmsubsd|vfnmaddpd|vfnmaddps|vfnmaddsd|vfnmaddss|vfnmsubpd|vfnmusbps|vfnmusbsd|vfnmusbss|vbroadcastss|vbroadcastsd|vbroadcastf128|vmaskmovps|vmaskmovpd|cvt|xor|cli|sti|hlt|nop|lock|wait|enter|leave|ret|loop(n?e|n?z)?|call|j(mp|n?e|n?ge?|n?ae?|le?|be?|n?o|n?z|n?c|n?p|n?b))\\b",
10
+ "name": "keyword.control.assembly"
11
+ },
12
+ {
13
+ "match": "\\b(?i)(RBP|EBP|BP|CS|DS|ES|FS|GS|SS|RAX|EAX|RBX|EBX|RCX|ECX|RDX|EDX|RIP|EIP|IP|RSP|ESP|SP|RSI|ESI|SI|RDI|EDI|DI|RFLAGS|EFLAGS|FLAGS|R(8|9|10|11|12|13|14|15)(d|w|b)?|(Y|X)MM([0-9]|10|11|12|13|14|15)|(A|B|C|D)(X|H|L)|CR[0-4]|DR[0-7]|TR6|TR7|EFER)\\b",
14
+ "name": "variable.parameter.register.assembly"
15
+ },
16
+ {
17
+ "match": "\\b[0-9]+\\b",
18
+ "name": "constant.character.decimal.assembly"
19
+ },
20
+ {
21
+ "match": "\\b(0x)(?i)[A-F0-9]+\\b",
22
+ "name": "constant.character.hexadecimal.assembly"
23
+ },
24
+ {
25
+ "match": "\\b(?i)[A-F0-9]+h\\b",
26
+ "name": "constant.character.hexadecimal.assembly"
27
+ },
28
+ {
29
+ "match": "\\b(?i)(0|1)+b\\b",
30
+ "name": "constant.character.binary.assembly"
31
+ },
32
+ {
33
+ "match": "(\"|').*?(\"|')",
34
+ "name": "string.assembly"
35
+ },
36
+ {
37
+ "begin": "^\\[",
38
+ "end": "\\]",
39
+ "name": "support.function.directive.assembly"
40
+ },
41
+ {
42
+ "captures": {
43
+ "2": {
44
+ "name": "entity.name.function.assembly"
45
+ }
46
+ },
47
+ "match": "(^struc) ([_a-zA-Z][_a-zA-Z0-9]*)",
48
+ "name": "support.function.directive.assembly"
49
+ },
50
+ {
51
+ "match": "^endstruc",
52
+ "name": "support.function.directive.assembly"
53
+ },
54
+ {
55
+ "captures": {
56
+ "1": {
57
+ "name": "entity.name.function.assembly"
58
+ },
59
+ "2": {
60
+ "name": "constant.character.assembly"
61
+ }
62
+ },
63
+ "match": "^%macro ([_a-zA-Z][_a-zA-Z0-9]*) ([0-9]+)",
64
+ "name": "support.function.directive.assembly"
65
+ },
66
+ {
67
+ "match": "^%endmacro",
68
+ "name": "support.function.directive.assembly"
69
+ },
70
+ {
71
+ "begin": "^%comment",
72
+ "end": "^%endcomment",
73
+ "name": "comment.assembly"
74
+ },
75
+ {
76
+ "captures": {
77
+ "1": {
78
+ "name": "support.function.directive.assembly"
79
+ },
80
+ "13": {
81
+ "name": "entity.name.function.assembly"
82
+ }
83
+ },
84
+ "match": "\\s*(?i)(%define|%ifndef|%xdefine|%idefine|%undef|%assign|%defstr|%strcat|%strlen|%substr|%00|%0|%rotate|%rep|%endrep|%include|\\$\\$|\\$|%unmacro|%if|%elif|%else|%endif|%(el)?ifdef|%(el)?ifmacro|%(el)?ifctx|%(el)?ifidn|%(el)?ifidni|%(el)?ifid|%(el)?ifnum|%(el)?ifstr|%(el)?iftoken|%(el)?ifempty|%(el)?ifenv|%pathsearch|%depend|%use|%push|%pop|%repl|%arg|%stacksize|%local|%error|%warning|%fatal|%line|%!|%comment|%endcomment|__NASM_VERSION_ID__|__NASM_VER__|__FILE__|__LINE__|__BITS__|__OUTPUT_FORMAT__|__DATE__|__TIME__|__DATE_NUM__|_TIME__NUM__|__UTC_DATE__|__UTC_TIME__|__UTC_DATE_NUM__|__UTC_TIME_NUM__|__POSIX_TIME__|__PASS__|ISTRUC|AT|IEND|BITS 16|BITS 32|BITS 64|USE16|USE32|__SECT__|ABSOLUTE|EXTERN|GLOBAL|COMMON|CPU|FLOAT)\\b ?([_a-zA-Z][_a-zA-Z0-9]*)?"
85
+ },
86
+ {
87
+ "match": "\\b(?i)(d(b|w|d|q|t|o|y)|res(b|w|d|q|t|o)|equ|times|align|alignb|sectalign|section|ptr|byte|word|dword|qword|incbin|)\\b",
88
+ "name": "support.function.directive.assembly"
89
+ },
90
+ {
91
+ "match": "(\\s)*;.*$",
92
+ "name": "comment.assembly"
93
+ },
94
+ {
95
+ "match": "(,|\\[|\\]|\\+|\\-|\\*)",
96
+ "name": "source.assembly"
97
+ },
98
+ {
99
+ "match": "^\\s*%%(.-[;])+?:$",
100
+ "name": "entity.name.function.assembly"
101
+ },
102
+ {
103
+ "match": "^\\s*%\\$(.-[;])+?:$",
104
+ "name": "entity.name.function.assembly"
105
+ },
106
+ {
107
+ "match": "^\\.?(.-[;])+?:$",
108
+ "name": "entity.name.function.assembly"
109
+ },
110
+ {
111
+ "match": "^\\.?(.-[;])+?\\b",
112
+ "name": "entity.name.function.assembly"
113
+ },
114
+ {
115
+ "match": ".+?",
116
+ "name": "entity.name.function.assembly"
117
+ }
118
+ ],
119
+ "scopeName": "source.assembly",
120
+ "uuid": "32257fc7-0688-47c7-9540-f4c2d7affea4"
121
+ }
@@ -5,8 +5,28 @@
5
5
  "name": "GDScript (Godot Engine)",
6
6
  "patterns": [
7
7
  {
8
+ "captures": {
9
+ "1": {
10
+ "name": "punctuation.definition.comment.number-sign.gdscript"
11
+ }
12
+ },
8
13
  "match": "(#).*$\\n?",
9
- "name": "punctuation.definition.comment.gdscript"
14
+ "name": "comment.line.number-sign.gdscript"
15
+ },
16
+ {
17
+ "begin": "^(\"\"\")",
18
+ "beginCaptures": {
19
+ "1": {
20
+ "name": "punctuation.definition.comment.triple-quote.gdscript"
21
+ }
22
+ },
23
+ "end": "(\"\"\")",
24
+ "endCaptures": {
25
+ "1": {
26
+ "name": "punctuation.definition.comment.triple-quote.gdscript"
27
+ }
28
+ },
29
+ "name": "comment.block.triple-quote"
10
30
  },
11
31
  {
12
32
  "begin": "\"",
@@ -18,6 +38,16 @@
18
38
  "end": "(?<!\\\\)'",
19
39
  "name": "string.quoted.single.gdscript"
20
40
  },
41
+ {
42
+ "begin": "\"\"\"",
43
+ "end": "(?<!\\\\)\"\"\"",
44
+ "name": "string.quoted.triple.gdscript"
45
+ },
46
+ {
47
+ "begin": "@\"",
48
+ "end": "(?<!\\\\)\"",
49
+ "name": "string.quoted.double.node-path.gdscript"
50
+ },
21
51
  {
22
52
  "match": "\\b(?i:0x\\h*)\\b",
23
53
  "name": "constant.numeric.integer.hexadecimal.gdscript"
@@ -58,6 +88,22 @@
58
88
  "match": "=",
59
89
  "name": "keyword.operator.assignment.gdscript"
60
90
  },
91
+ {
92
+ "match": "\\b(bool|int|float|String|funcref)\\b",
93
+ "name": "support.type.basic.gdscript"
94
+ },
95
+ {
96
+ "match": "\\b(Vector[23]|Rect2|Matrix32?|Plane|Quat|AABB|Transform)\\b",
97
+ "name": "support.type.vector.gdscript"
98
+ },
99
+ {
100
+ "match": "\\b(Color|Image|NodePath|RID|Object|InputEvent)\\b",
101
+ "name": "support.type.engine.gdscript"
102
+ },
103
+ {
104
+ "match": "\\b(Array|Dictionary|ByteArray|IntArray|FloatArray|StringArray|Vector[23]Array|ColorArray)\\b",
105
+ "name": "support.type.container.gdscript"
106
+ },
61
107
  {
62
108
  "captures": {
63
109
  "1": {
@@ -70,12 +116,15 @@
70
116
  "match": "^\\s*(?i:(class))\\s+([a-zA-Z_][a-zA-Z_0-9]*)\\s*:"
71
117
  },
72
118
  {
73
- "begin": "^\\s*(?i:(func))\\s+([a-zA-Z_][a-zA-Z_0-9]*)\\s*\\(",
119
+ "begin": "^\\s*(?i:(?:(static)\\s+)?(func))\\s+([a-zA-Z_][a-zA-Z_0-9]*)\\s*\\(",
74
120
  "beginCaptures": {
75
121
  "1": {
76
- "name": "storage.type.function.gdscript"
122
+ "name": "storage.modifier.static-function.gdscript"
77
123
  },
78
124
  "2": {
125
+ "name": "storage.type.function.gdscript"
126
+ },
127
+ "3": {
79
128
  "name": "entity.name.function.gdscript"
80
129
  }
81
130
  },
@@ -87,16 +136,37 @@
87
136
  }
88
137
  ]
89
138
  },
139
+ {
140
+ "begin": "^\\s*(?i:(signal))\\s+([a-zA-Z_][a-zA-Z_0-9]*)\\s*\\(",
141
+ "beginCaptures": {
142
+ "1": {
143
+ "name": "storage.type.signal.gdscript"
144
+ },
145
+ "2": {
146
+ "name": "entity.name.function.siglan.gdscript"
147
+ }
148
+ },
149
+ "end": "\\)\\s*:",
150
+ "patterns": [
151
+ {
152
+ "match": "[a-zA-Z_][a-zA-Z_0-9]*",
153
+ "name": "variable.parameter.gdscript"
154
+ }
155
+ ]
156
+ },
90
157
  {
91
158
  "captures": {
92
159
  "1": {
93
- "name": "storage.type.var.gdscript"
160
+ "name": "keyword.other.onready.gdscript"
94
161
  },
95
162
  "2": {
163
+ "name": "storage.type.var.gdscript"
164
+ },
165
+ "3": {
96
166
  "name": "variable.other.gdscript"
97
167
  }
98
168
  },
99
- "match": "\\b(?i:(var))\\s+([a-zA-Z_][a-zA-Z_0-9]*)"
169
+ "match": "(?i:\\b(?:(onready)\\s+)?(var))\\s+([a-zA-Z_][a-zA-Z_0-9]*)"
100
170
  },
101
171
  {
102
172
  "captures": {
@@ -110,7 +180,7 @@
110
180
  "match": "\\b(?i:(const))\\s+([a-zA-Z_][a-zA-Z_0-9]*)"
111
181
  },
112
182
  {
113
- "match": "\\b(?i:extends|assert)\\b",
183
+ "match": "\\b(?i:extends|assert|breakpoint)\\b",
114
184
  "name": "keyword.other.gdscript"
115
185
  },
116
186
  {
@@ -122,9 +192,34 @@
122
192
  "name": "constant.language.gdscript"
123
193
  },
124
194
  {
125
- "match": "\\b(?i:static|export|tool|yield)\\b",
195
+ "match": "\\b(?i:export|tool)\\b",
126
196
  "name": "storage.modifier.static.gdscript"
127
197
  },
198
+ {
199
+ "captures": {
200
+ "1": {
201
+ "name": "keyword.operator.setget.gdscript"
202
+ },
203
+ "2": {
204
+ "name": "entity.name.function.gdscript"
205
+ },
206
+ "3": {
207
+ "name": "entity.name.function.gdscript"
208
+ },
209
+ "4": {
210
+ "name": "entity.name.function.gdscript"
211
+ }
212
+ },
213
+ "match": "\\b((?i:setget))\\b\\s+(?:,?([a-zA-Z_][a-zA-Z_0-9]*)|([a-zA-Z_][a-zA-Z_0-9]*)\\s*,\\s*([a-zA-Z_][a-zA-Z_0-9]*))"
214
+ },
215
+ {
216
+ "match": "\\b(?i:yield)\\b",
217
+ "name": "keyword.control.flow.yield.gdscript"
218
+ },
219
+ {
220
+ "match": "\\b(?i:var|const|onready|class|func|signal)\\b",
221
+ "name": "invalid.illegal"
222
+ },
128
223
  {
129
224
  "match": "([A-Z][a-zA-Z_0-9]*)",
130
225
  "name": "entity.name.type.class-type.gdscript"
@@ -0,0 +1,1328 @@
1
+ {
2
+ "fileTypes": [
3
+ "psc"
4
+ ],
5
+ "name": "Papyrus - Skyrim",
6
+ "patterns": [
7
+ {
8
+ "comment": "Empty line",
9
+ "match": "^\\s*$",
10
+ "name": "meta.emptyline.papyrus"
11
+ },
12
+ {
13
+ "include": "#commentDocumentation"
14
+ },
15
+ {
16
+ "include": "#commentBlock"
17
+ },
18
+ {
19
+ "include": "#commentLine"
20
+ },
21
+ {
22
+ "include": "#scriptHeader"
23
+ },
24
+ {
25
+ "include": "#import"
26
+ },
27
+ {
28
+ "include": "#state"
29
+ },
30
+ {
31
+ "include": "#endState"
32
+ },
33
+ {
34
+ "include": "#event"
35
+ },
36
+ {
37
+ "include": "#endEvent"
38
+ },
39
+ {
40
+ "include": "#return"
41
+ },
42
+ {
43
+ "include": "#if"
44
+ },
45
+ {
46
+ "include": "#elseif"
47
+ },
48
+ {
49
+ "include": "#else"
50
+ },
51
+ {
52
+ "include": "#endIf"
53
+ },
54
+ {
55
+ "include": "#while"
56
+ },
57
+ {
58
+ "include": "#endWhile"
59
+ },
60
+ {
61
+ "include": "#property"
62
+ },
63
+ {
64
+ "include": "#endProperty"
65
+ },
66
+ {
67
+ "include": "#function"
68
+ },
69
+ {
70
+ "include": "#endFunction"
71
+ },
72
+ {
73
+ "include": "#variable"
74
+ },
75
+ {
76
+ "include": "#assign"
77
+ },
78
+ {
79
+ "include": "#expression"
80
+ },
81
+ {
82
+ "include": "#whitespace"
83
+ },
84
+ {
85
+ "include": "#unmatched"
86
+ }
87
+ ],
88
+ "repository": {
89
+ "addExpression": {
90
+ "patterns": [
91
+ {
92
+ "comment": "Addition or subtraction",
93
+ "match": "(\\+|\\-)",
94
+ "name": "keyword.operator.papyrus"
95
+ },
96
+ {
97
+ "include": "#multExpression"
98
+ }
99
+ ]
100
+ },
101
+ "andExpression": {
102
+ "patterns": [
103
+ {
104
+ "comment": "AND",
105
+ "match": "\\&\\&",
106
+ "name": "keyword.operator.papyrus"
107
+ },
108
+ {
109
+ "include": "#boolExpression"
110
+ }
111
+ ]
112
+ },
113
+ "arrayAtom": {
114
+ "patterns": [
115
+ {
116
+ "begin": "\\[",
117
+ "comment": "Array",
118
+ "end": "\\]",
119
+ "name": "meta.array.papyrus",
120
+ "patterns": [
121
+ {
122
+ "include": "#expression"
123
+ }
124
+ ]
125
+ },
126
+ {
127
+ "include": "#atom"
128
+ }
129
+ ]
130
+ },
131
+ "arrayFuncOrId": {
132
+ "patterns": [
133
+ {
134
+ "include": "#funcOrId"
135
+ },
136
+ {
137
+ "begin": "\\[",
138
+ "comment": "Array element access",
139
+ "end": "\\]",
140
+ "name": "meta.arrayelement.papyrus",
141
+ "patterns": [
142
+ {
143
+ "include": "#expression"
144
+ }
145
+ ]
146
+ }
147
+ ]
148
+ },
149
+ "assign": {
150
+ "patterns": [
151
+ {
152
+ "begin": "^\\s*",
153
+ "comment": "Assign statement",
154
+ "end": "([\\n\\r])",
155
+ "name": "meta.assign.papyrus",
156
+ "patterns": [
157
+ {
158
+ "include": "#assignmentOperators"
159
+ },
160
+ {
161
+ "include": "#expression"
162
+ },
163
+ {
164
+ "include": "#endOfLine"
165
+ }
166
+ ]
167
+ }
168
+ ]
169
+ },
170
+ "assignmentOperators": {
171
+ "patterns": [
172
+ {
173
+ "comment": "Assignment operators",
174
+ "match": "(\\=|\\+\\=|\\-\\=|\\*\\=|\\/\\=|\\%\\=)",
175
+ "name": "keyword.operator.papyrus"
176
+ }
177
+ ]
178
+ },
179
+ "atom": {
180
+ "patterns": [
181
+ {
182
+ "begin": "(?i)\\b(new)\\s+([_a-z][0-9_a-z]*)\\[",
183
+ "beginCaptures": {
184
+ "1": {
185
+ "name": "keyword.operator.papyrus"
186
+ },
187
+ "2": {
188
+ "name": "storage.type.papyrus"
189
+ }
190
+ },
191
+ "comment": "New array",
192
+ "end": "\\]",
193
+ "name": "meta.newarray.papyrus",
194
+ "patterns": [
195
+ {
196
+ "include": "#integer"
197
+ }
198
+ ]
199
+ },
200
+ {
201
+ "begin": "\\(",
202
+ "comment": "Parenthesis",
203
+ "end": "(\\)|[\\n\\r])",
204
+ "name": "meta.parenthesis.papyrus",
205
+ "patterns": [
206
+ {
207
+ "include": "#expression"
208
+ }
209
+ ]
210
+ },
211
+ {
212
+ "include": "#funcOrId"
213
+ }
214
+ ]
215
+ },
216
+ "baseTypes": {
217
+ "patterns": [
218
+ {
219
+ "comment": "Type",
220
+ "match": "(?i)\\b(bool|float|int|string)\\b",
221
+ "name": "storage.type.papyrus"
222
+ }
223
+ ]
224
+ },
225
+ "bool": {
226
+ "patterns": [
227
+ {
228
+ "comment": "Boolean literal",
229
+ "match": "(?i)\\b(true|false|none)\\b",
230
+ "name": "constant.language.boolean.papyrus"
231
+ }
232
+ ]
233
+ },
234
+ "boolExpression": {
235
+ "patterns": [
236
+ {
237
+ "comment": "Comparison operators",
238
+ "match": "(\\=\\=|\\!\\=|\\<\\=|\\>\\=|\\<|\\>)",
239
+ "name": "keyword.operator.papyrus"
240
+ },
241
+ {
242
+ "include": "#addExpression"
243
+ }
244
+ ]
245
+ },
246
+ "castAtom": {
247
+ "patterns": [
248
+ {
249
+ "captures": {
250
+ "1": {
251
+ "name": "keyword.operator.papyrus"
252
+ },
253
+ "2": {
254
+ "name": "storage.type.papyrus"
255
+ }
256
+ },
257
+ "comment": "Cast",
258
+ "match": "(?i)\\b(as)\\s+([_a-z][0-9_a-z]*)\\b",
259
+ "name": "meta.cast.papyrus"
260
+ },
261
+ {
262
+ "include": "#dotAtom"
263
+ }
264
+ ]
265
+ },
266
+ "comma": {
267
+ "patterns": [
268
+ {
269
+ "comment": "Comma",
270
+ "match": "\\,",
271
+ "name": "meta.comma.papyrus"
272
+ }
273
+ ]
274
+ },
275
+ "commentBlock": {
276
+ "patterns": [
277
+ {
278
+ "begin": ";/",
279
+ "comment": "Comment block",
280
+ "end": "/;",
281
+ "name": "comment.block.papyrus"
282
+ }
283
+ ]
284
+ },
285
+ "commentDocumentation": {
286
+ "patterns": [
287
+ {
288
+ "begin": "^\\s*\\{",
289
+ "comment": "Documentation comment",
290
+ "end": "\\}",
291
+ "name": "comment.documentation.papyrus"
292
+ }
293
+ ]
294
+ },
295
+ "commentLine": {
296
+ "patterns": [
297
+ {
298
+ "comment": "Single line comment",
299
+ "match": ";.*$",
300
+ "name": "comment.line.papyrus"
301
+ }
302
+ ]
303
+ },
304
+ "comments": {
305
+ "patterns": [
306
+ {
307
+ "include": "#commentBlock"
308
+ },
309
+ {
310
+ "include": "#commentLine"
311
+ },
312
+ {
313
+ "include": "#commentDocumentation"
314
+ }
315
+ ]
316
+ },
317
+ "constants": {
318
+ "patterns": [
319
+ {
320
+ "include": "#bool"
321
+ },
322
+ {
323
+ "include": "#float"
324
+ },
325
+ {
326
+ "include": "#integer"
327
+ },
328
+ {
329
+ "include": "#string"
330
+ }
331
+ ]
332
+ },
333
+ "dotAtom": {
334
+ "patterns": [
335
+ {
336
+ "comment": "Dot",
337
+ "match": "\\.",
338
+ "name": "keyword.operator.papyrus"
339
+ },
340
+ {
341
+ "include": "#constants"
342
+ },
343
+ {
344
+ "include": "#arrayAtom"
345
+ },
346
+ {
347
+ "include": "#arrayFuncOrId"
348
+ }
349
+ ]
350
+ },
351
+ "else": {
352
+ "patterns": [
353
+ {
354
+ "begin": "(?i)^\\s*(else)\\b",
355
+ "beginCaptures": {
356
+ "1": {
357
+ "name": "keyword.other.papyrus"
358
+ }
359
+ },
360
+ "comment": "Else statement",
361
+ "end": "([\\n\\r])",
362
+ "name": "meta.else.papyrus",
363
+ "patterns": [
364
+ {
365
+ "include": "#endOfLine"
366
+ }
367
+ ]
368
+ }
369
+ ]
370
+ },
371
+ "elseif": {
372
+ "patterns": [
373
+ {
374
+ "begin": "(?i)^\\s*(elseif)\\b",
375
+ "beginCaptures": {
376
+ "1": {
377
+ "name": "keyword.other.papyrus"
378
+ }
379
+ },
380
+ "comment": "ElseIf statement",
381
+ "end": "([\\n\\r])",
382
+ "name": "meta.elseif.papyrus",
383
+ "patterns": [
384
+ {
385
+ "include": "#expression"
386
+ },
387
+ {
388
+ "include": "#endOfLine"
389
+ }
390
+ ]
391
+ }
392
+ ]
393
+ },
394
+ "endEvent": {
395
+ "patterns": [
396
+ {
397
+ "begin": "(?i)^\\s*(endevent)\\b",
398
+ "beginCaptures": {
399
+ "1": {
400
+ "name": "keyword.other.papyrus"
401
+ }
402
+ },
403
+ "comment": "EndEvent statement",
404
+ "end": "([\\n\\r])",
405
+ "name": "meta.endevent.papyrus",
406
+ "patterns": [
407
+ {
408
+ "include": "#endOfLine"
409
+ }
410
+ ]
411
+ }
412
+ ]
413
+ },
414
+ "endFunction": {
415
+ "patterns": [
416
+ {
417
+ "begin": "(?i)^\\s*(endfunction)\\b",
418
+ "beginCaptures": {
419
+ "1": {
420
+ "name": "keyword.other.papyrus"
421
+ }
422
+ },
423
+ "comment": "EndFunction statement",
424
+ "end": "([\\n\\r])",
425
+ "name": "meta.endfunction.papyrus",
426
+ "patterns": [
427
+ {
428
+ "include": "#endOfLine"
429
+ }
430
+ ]
431
+ }
432
+ ]
433
+ },
434
+ "endIf": {
435
+ "patterns": [
436
+ {
437
+ "begin": "(?i)^\\s*(endif)\\b",
438
+ "beginCaptures": {
439
+ "1": {
440
+ "name": "keyword.other.papyrus"
441
+ }
442
+ },
443
+ "comment": "EndIf statement",
444
+ "end": "([\\n\\r])",
445
+ "name": "meta.endif.papyrus",
446
+ "patterns": [
447
+ {
448
+ "include": "#endOfLine"
449
+ }
450
+ ]
451
+ }
452
+ ]
453
+ },
454
+ "endOfLine": {
455
+ "patterns": [
456
+ {
457
+ "include": "#commentBlock"
458
+ },
459
+ {
460
+ "include": "#commentLine"
461
+ },
462
+ {
463
+ "include": "#whitespace"
464
+ },
465
+ {
466
+ "include": "#multiline"
467
+ },
468
+ {
469
+ "include": "#unmatched"
470
+ }
471
+ ]
472
+ },
473
+ "endProperty": {
474
+ "patterns": [
475
+ {
476
+ "begin": "(?i)^\\s*(endproperty)\\b",
477
+ "beginCaptures": {
478
+ "1": {
479
+ "name": "keyword.other.papyrus"
480
+ }
481
+ },
482
+ "comment": "EndProperty statement",
483
+ "end": "([\\n\\r])",
484
+ "name": "meta.endproperty.papyrus",
485
+ "patterns": [
486
+ {
487
+ "include": "#endOfLine"
488
+ }
489
+ ]
490
+ }
491
+ ]
492
+ },
493
+ "endState": {
494
+ "patterns": [
495
+ {
496
+ "begin": "(?i)^\\s*(endstate)\\b",
497
+ "beginCaptures": {
498
+ "1": {
499
+ "name": "keyword.other.papyrus"
500
+ }
501
+ },
502
+ "comment": "EndState statement",
503
+ "end": "([\\n\\r])",
504
+ "name": "meta.endstate.papyrus",
505
+ "patterns": [
506
+ {
507
+ "include": "#endOfLine"
508
+ }
509
+ ]
510
+ }
511
+ ]
512
+ },
513
+ "endWhile": {
514
+ "patterns": [
515
+ {
516
+ "begin": "(?i)^\\s*(endwhile)\\b",
517
+ "beginCaptures": {
518
+ "1": {
519
+ "name": "keyword.other.papyrus"
520
+ }
521
+ },
522
+ "comment": "EndWhile statement",
523
+ "end": "([\\n\\r])",
524
+ "name": "meta.endwhile.papyrus",
525
+ "patterns": [
526
+ {
527
+ "include": "#endOfLine"
528
+ }
529
+ ]
530
+ }
531
+ ]
532
+ },
533
+ "event": {
534
+ "patterns": [
535
+ {
536
+ "begin": "(?i)^\\s*(event)\\s+",
537
+ "beginCaptures": {
538
+ "1": {
539
+ "name": "keyword.control.eventstart.papyrus"
540
+ },
541
+ "2": {
542
+ "name": "entity.name.function.papyrus"
543
+ }
544
+ },
545
+ "comment": "Event declaration",
546
+ "end": "([\\n\\r])",
547
+ "name": "meta.event.papyrus",
548
+ "patterns": [
549
+ {
550
+ "include": "#eventParameters"
551
+ },
552
+ {
553
+ "include": "#eventFlags"
554
+ },
555
+ {
556
+ "include": "#illegalKeywords"
557
+ },
558
+ {
559
+ "include": "#illegalSpecialVariables"
560
+ },
561
+ {
562
+ "include": "#illegalBaseTypes"
563
+ },
564
+ {
565
+ "include": "#functionIdentifier"
566
+ },
567
+ {
568
+ "include": "#endOfLine"
569
+ }
570
+ ]
571
+ }
572
+ ]
573
+ },
574
+ "eventFlags": {
575
+ "patterns": [
576
+ {
577
+ "comment": "Event flags",
578
+ "match": "(?i)(?<=\\))\\s*(native)\\b",
579
+ "name": "keyword.other.papyrus"
580
+ }
581
+ ]
582
+ },
583
+ "eventParameter": {
584
+ "patterns": [
585
+ {
586
+ "include": "#eventParameterIdentifier"
587
+ },
588
+ {
589
+ "include": "#typeIdentifier"
590
+ }
591
+ ]
592
+ },
593
+ "eventParameterIdentifier": {
594
+ "patterns": [
595
+ {
596
+ "comment": "Event parameter identifier",
597
+ "match": "(?i)\\b([_a-z][0-9_a-z]*)\\s*(?=(\\,|\\)))",
598
+ "name": "variable.parameter.papyrus"
599
+ }
600
+ ]
601
+ },
602
+ "eventParameters": {
603
+ "patterns": [
604
+ {
605
+ "begin": "\\(",
606
+ "comment": "Event parameters",
607
+ "end": "\\)",
608
+ "name": "meta.eventparameters.papyrus",
609
+ "patterns": [
610
+ {
611
+ "include": "#illegalKeywords"
612
+ },
613
+ {
614
+ "include": "#illegalSpecialVariables"
615
+ },
616
+ {
617
+ "include": "#eventParameter"
618
+ },
619
+ {
620
+ "include": "#comma"
621
+ },
622
+ {
623
+ "include": "#multiline"
624
+ },
625
+ {
626
+ "include": "#whitespace"
627
+ },
628
+ {
629
+ "include": "#unmatched"
630
+ }
631
+ ]
632
+ }
633
+ ]
634
+ },
635
+ "expression": {
636
+ "patterns": [
637
+ {
638
+ "comment": "OR",
639
+ "match": "\\|\\|",
640
+ "name": "keyword.operator.papyrus"
641
+ },
642
+ {
643
+ "include": "#andExpression"
644
+ },
645
+ {
646
+ "include": "#endOfLine"
647
+ }
648
+ ]
649
+ },
650
+ "float": {
651
+ "patterns": [
652
+ {
653
+ "include": "#unaryMinus"
654
+ },
655
+ {
656
+ "comment": "Float literal",
657
+ "match": "\\b(\\d+\\.\\d+)\\b",
658
+ "name": "constant.numeric.float.papyrus"
659
+ }
660
+ ]
661
+ },
662
+ "funcOrId": {
663
+ "patterns": [
664
+ {
665
+ "comment": "Length",
666
+ "match": "(?i)\\b(length)\\b",
667
+ "name": "keyword.other.papyrus"
668
+ },
669
+ {
670
+ "include": "#functionCall"
671
+ },
672
+ {
673
+ "include": "#illegalKeywords"
674
+ },
675
+ {
676
+ "include": "#illegalBaseTypes"
677
+ },
678
+ {
679
+ "include": "#specialVariables"
680
+ },
681
+ {
682
+ "include": "#identifier"
683
+ }
684
+ ]
685
+ },
686
+ "function": {
687
+ "patterns": [
688
+ {
689
+ "begin": "(?i)^\\s*(?:([_a-z][0-9_a-z]*)(?:\\[\\])?\\s+)?(function)\\s+",
690
+ "beginCaptures": {
691
+ "1": {
692
+ "name": "storage.type.papyrus"
693
+ },
694
+ "2": {
695
+ "name": "keyword.control.functionstart.papyrus"
696
+ },
697
+ "3": {
698
+ "name": "entity.name.function.papyrus"
699
+ }
700
+ },
701
+ "comment": "Function declaration",
702
+ "end": "([\\n\\r])",
703
+ "name": "meta.function.papyrus",
704
+ "patterns": [
705
+ {
706
+ "include": "#functionParameters"
707
+ },
708
+ {
709
+ "include": "#functionFlags"
710
+ },
711
+ {
712
+ "include": "#illegalKeywords"
713
+ },
714
+ {
715
+ "include": "#illegalSpecialVariables"
716
+ },
717
+ {
718
+ "include": "#illegalBaseTypes"
719
+ },
720
+ {
721
+ "include": "#functionIdentifier"
722
+ },
723
+ {
724
+ "include": "#endOfLine"
725
+ }
726
+ ]
727
+ }
728
+ ]
729
+ },
730
+ "functionCall": {
731
+ "patterns": [
732
+ {
733
+ "begin": "(?i)\\b([_a-z][0-9_a-z]*)\\(",
734
+ "beginCaptures": {
735
+ "1": {
736
+ "name": "variable.other.papyrus"
737
+ }
738
+ },
739
+ "comment": "Function call",
740
+ "end": "\\)",
741
+ "name": "meta.functioncall.papyrus",
742
+ "patterns": [
743
+ {
744
+ "include": "#functionCallParameters"
745
+ }
746
+ ]
747
+ }
748
+ ]
749
+ },
750
+ "functionCallParameter": {
751
+ "patterns": [
752
+ {
753
+ "captures": {
754
+ "1": {
755
+ "name": "variable.parameter.papyrus"
756
+ },
757
+ "2": {
758
+ "name": "keyword.operator.papyrus"
759
+ }
760
+ },
761
+ "comment": "Specific parameter",
762
+ "match": "(?i)\\b(?:([_a-z][0-9_a-z]*)\\s*(\\=))?",
763
+ "name": "meta.functioncallparameter.papyrus"
764
+ },
765
+ {
766
+ "include": "#expression"
767
+ }
768
+ ]
769
+ },
770
+ "functionCallParameters": {
771
+ "patterns": [
772
+ {
773
+ "include": "#comma"
774
+ },
775
+ {
776
+ "include": "#functionCallParameter"
777
+ }
778
+ ]
779
+ },
780
+ "functionFlags": {
781
+ "patterns": [
782
+ {
783
+ "comment": "Function flags",
784
+ "match": "(?i)\\b(native|global)\\b",
785
+ "name": "keyword.other.papyrus"
786
+ }
787
+ ]
788
+ },
789
+ "functionIdentifier": {
790
+ "patterns": [
791
+ {
792
+ "comment": "Function/event identifier",
793
+ "match": "(?i)\\b([_a-z][0-9_a-z]*)(?=\\()",
794
+ "name": "entity.name.function.papyrus"
795
+ }
796
+ ]
797
+ },
798
+ "functionParameter": {
799
+ "patterns": [
800
+ {
801
+ "include": "#functionParameterIdentifier"
802
+ },
803
+ {
804
+ "include": "#typeIdentifier"
805
+ }
806
+ ]
807
+ },
808
+ "functionParameterIdentifier": {
809
+ "patterns": [
810
+ {
811
+ "comment": "Event parameter identifier",
812
+ "match": "(?i)\\b([_a-z][0-9_a-z]*)\\s*(?=(\\,|\\)|\\=))",
813
+ "name": "variable.parameter.papyrus"
814
+ }
815
+ ]
816
+ },
817
+ "functionParameters": {
818
+ "patterns": [
819
+ {
820
+ "begin": "\\(",
821
+ "comment": "Function parameters",
822
+ "end": "\\)",
823
+ "name": "meta.functionparameters.papyrus",
824
+ "patterns": [
825
+ {
826
+ "comment": "Assignment operator",
827
+ "match": "(\\=)",
828
+ "name": "keyword.operator.assignment.papyrus"
829
+ },
830
+ {
831
+ "include": "#constants"
832
+ },
833
+ {
834
+ "include": "#illegalKeywords"
835
+ },
836
+ {
837
+ "include": "#illegalSpecialVariables"
838
+ },
839
+ {
840
+ "include": "#functionParameter"
841
+ },
842
+ {
843
+ "include": "#comma"
844
+ },
845
+ {
846
+ "include": "#multiline"
847
+ },
848
+ {
849
+ "include": "#whitespace"
850
+ },
851
+ {
852
+ "include": "#unmatched"
853
+ }
854
+ ]
855
+ }
856
+ ]
857
+ },
858
+ "identifier": {
859
+ "patterns": [
860
+ {
861
+ "comment": "Identifier",
862
+ "match": "(?i)\\b([_a-z][0-9_a-z]*)\\b",
863
+ "name": "variable.other.papyrus"
864
+ }
865
+ ]
866
+ },
867
+ "if": {
868
+ "patterns": [
869
+ {
870
+ "begin": "(?i)^\\s*(if)\\b",
871
+ "beginCaptures": {
872
+ "1": {
873
+ "name": "keyword.other.papyrus"
874
+ }
875
+ },
876
+ "comment": "If statement",
877
+ "end": "([\\n\\r])",
878
+ "name": "meta.if.papyrus",
879
+ "patterns": [
880
+ {
881
+ "include": "#expression"
882
+ },
883
+ {
884
+ "include": "#endOfLine"
885
+ }
886
+ ]
887
+ }
888
+ ]
889
+ },
890
+ "illegalBaseTypes": {
891
+ "patterns": [
892
+ {
893
+ "comment": "Type",
894
+ "match": "(?i)\\b(bool|float|int|string)\\b",
895
+ "name": "meta.invalid.papyrus"
896
+ }
897
+ ]
898
+ },
899
+ "illegalKeywords": {
900
+ "patterns": [
901
+ {
902
+ "comment": "Keywords",
903
+ "match": "(?i)\\b(as|auto|autoreadonly|else|elseif|endevent|endfunction|endif|endproperty|endstate|endwhile|event|extends|false|function|global|if|import|length|native|new|none|property|return|scriptname|state|true|while)\\b",
904
+ "name": "meta.invalid.papyrus"
905
+ }
906
+ ]
907
+ },
908
+ "illegalSpecialVariables": {
909
+ "patterns": [
910
+ {
911
+ "comment": "Special variables",
912
+ "match": "(?i)\\b(parent|self)\\b",
913
+ "name": "meta.invalid.papyrus"
914
+ }
915
+ ]
916
+ },
917
+ "import": {
918
+ "patterns": [
919
+ {
920
+ "begin": "(?i)^\\s*(import)\\s+",
921
+ "beginCaptures": {
922
+ "1": {
923
+ "name": "keyword.other.papyrus"
924
+ }
925
+ },
926
+ "comment": "Import statement",
927
+ "end": "([\\n\\r])",
928
+ "name": "meta.import.papyrus",
929
+ "patterns": [
930
+ {
931
+ "include": "#illegalKeywords"
932
+ },
933
+ {
934
+ "include": "#illegalSpecialVariables"
935
+ },
936
+ {
937
+ "include": "#illegalBaseTypes"
938
+ },
939
+ {
940
+ "include": "#typeIdentifier"
941
+ },
942
+ {
943
+ "include": "#endOfLine"
944
+ }
945
+ ]
946
+ }
947
+ ]
948
+ },
949
+ "integer": {
950
+ "patterns": [
951
+ {
952
+ "include": "#unaryMinus"
953
+ },
954
+ {
955
+ "comment": "Integer literal",
956
+ "match": "(?i)\\b(0x[0-9a-f]+|\\d+)\\b",
957
+ "name": "constant.numeric.integer.papyrus"
958
+ }
959
+ ]
960
+ },
961
+ "keywords": {
962
+ "patterns": [
963
+ {
964
+ "comment": "Keywords",
965
+ "match": "(?i)\\b(as|auto|autoreadonly|else|elseif|endevent|endfunction|endif|endproperty|endstate|endwhile|event|extends|false|function|global|if|import|length|native|new|none|property|return|scriptname|state|true|while)\\b",
966
+ "name": "keyword.other.papyrus"
967
+ }
968
+ ]
969
+ },
970
+ "multExpression": {
971
+ "patterns": [
972
+ {
973
+ "comment": "Multiplication, division, or modulus",
974
+ "match": "(\\*|/|\\%)",
975
+ "name": "keyword.operator.papyrus"
976
+ },
977
+ {
978
+ "include": "#unaryExpression"
979
+ }
980
+ ]
981
+ },
982
+ "multiline": {
983
+ "patterns": [
984
+ {
985
+ "begin": "\\\\",
986
+ "comment": "Multiline",
987
+ "end": "([\\n\\r])",
988
+ "name": "meta.multiline.papyrus",
989
+ "patterns": [
990
+ {
991
+ "include": "#commentBlock"
992
+ },
993
+ {
994
+ "include": "#commentLine"
995
+ },
996
+ {
997
+ "include": "#whitespace"
998
+ },
999
+ {
1000
+ "include": "#unmatched"
1001
+ }
1002
+ ]
1003
+ }
1004
+ ]
1005
+ },
1006
+ "parameterIdentifier": {
1007
+ "patterns": [
1008
+ {
1009
+ "comment": "Parameter identifier",
1010
+ "match": "(?i)\\b([_a-z][0-9_a-z]*)\\b",
1011
+ "name": "variable.parameter.papyrus"
1012
+ }
1013
+ ]
1014
+ },
1015
+ "property": {
1016
+ "patterns": [
1017
+ {
1018
+ "begin": "(?i)^\\s*([_a-z][0-9_a-z]*)(?:\\[\\])?\\s+(property)\\s+",
1019
+ "beginCaptures": {
1020
+ "1": {
1021
+ "name": "storage.type.papyrus"
1022
+ },
1023
+ "2": {
1024
+ "name": "keyword.other.papyrus"
1025
+ }
1026
+ },
1027
+ "comment": "Property declaration",
1028
+ "end": "([\\n\\r])",
1029
+ "name": "meta.property.papyrus",
1030
+ "patterns": [
1031
+ {
1032
+ "comment": "Assignment operator",
1033
+ "match": "(\\=)",
1034
+ "name": "keyword.operator.assignment.papyrus"
1035
+ },
1036
+ {
1037
+ "include": "#constants"
1038
+ },
1039
+ {
1040
+ "include": "#propertyFlags"
1041
+ },
1042
+ {
1043
+ "include": "#illegalKeywords"
1044
+ },
1045
+ {
1046
+ "include": "#illegalSpecialVariables"
1047
+ },
1048
+ {
1049
+ "include": "#illegalBaseTypes"
1050
+ },
1051
+ {
1052
+ "include": "#identifier"
1053
+ },
1054
+ {
1055
+ "include": "#endOfLine"
1056
+ }
1057
+ ]
1058
+ }
1059
+ ]
1060
+ },
1061
+ "propertyFlags": {
1062
+ "patterns": [
1063
+ {
1064
+ "comment": "Property flags",
1065
+ "match": "(?i)\\b(auto|autoreadonly|conditional|hidden)\\b",
1066
+ "name": "keyword.other.papyrus"
1067
+ }
1068
+ ]
1069
+ },
1070
+ "return": {
1071
+ "patterns": [
1072
+ {
1073
+ "begin": "(?i)^\\s*(return)\\b",
1074
+ "beginCaptures": {
1075
+ "1": {
1076
+ "name": "keyword.other.papyrus"
1077
+ }
1078
+ },
1079
+ "comment": "Return statements",
1080
+ "end": "([\\n\\r])",
1081
+ "name": "meta.return.papyrus",
1082
+ "patterns": [
1083
+ {
1084
+ "include": "#expression"
1085
+ },
1086
+ {
1087
+ "include": "#endOfLine"
1088
+ }
1089
+ ]
1090
+ }
1091
+ ]
1092
+ },
1093
+ "scriptHeader": {
1094
+ "patterns": [
1095
+ {
1096
+ "begin": "(?i)^\\s*(scriptname)\\s+",
1097
+ "beginCaptures": {
1098
+ "1": {
1099
+ "name": "keyword.other.papyrus"
1100
+ }
1101
+ },
1102
+ "comment": "Scriptheader",
1103
+ "end": "([\\n\\r])",
1104
+ "name": "meta.scriptheader.papyrus",
1105
+ "patterns": [
1106
+ {
1107
+ "comment": "Script parent declaration",
1108
+ "match": "(?i)\\b(extends)\\b",
1109
+ "name": "keyword.other.papyrus"
1110
+ },
1111
+ {
1112
+ "comment": "Script flags",
1113
+ "match": "(?i)\\b(hidden|conditional)\\b",
1114
+ "name": "keyword.other.papyrus"
1115
+ },
1116
+ {
1117
+ "include": "#illegalKeywords"
1118
+ },
1119
+ {
1120
+ "include": "#illegalSpecialVariables"
1121
+ },
1122
+ {
1123
+ "include": "#illegalBaseTypes"
1124
+ },
1125
+ {
1126
+ "include": "#typeIdentifier"
1127
+ },
1128
+ {
1129
+ "include": "#endOfLine"
1130
+ }
1131
+ ]
1132
+ }
1133
+ ]
1134
+ },
1135
+ "specialVariables": {
1136
+ "patterns": [
1137
+ {
1138
+ "comment": "Special variables",
1139
+ "match": "(?i)\\b(parent|self)\\b",
1140
+ "name": "keyword.other.papyrus"
1141
+ }
1142
+ ]
1143
+ },
1144
+ "state": {
1145
+ "patterns": [
1146
+ {
1147
+ "begin": "(?i)^\\s*(?:(auto)\\s+)?(state)\\s+",
1148
+ "beginCaptures": {
1149
+ "1": {
1150
+ "name": "keyword.other.papyrus"
1151
+ },
1152
+ "2": {
1153
+ "name": "keyword.other.papyrus"
1154
+ }
1155
+ },
1156
+ "comment": "State declaration",
1157
+ "end": "([\\n\\r])",
1158
+ "name": "meta.state.papyrus",
1159
+ "patterns": [
1160
+ {
1161
+ "include": "#illegalKeywords"
1162
+ },
1163
+ {
1164
+ "include": "#illegalSpecialVariables"
1165
+ },
1166
+ {
1167
+ "include": "#illegalBaseTypes"
1168
+ },
1169
+ {
1170
+ "include": "#identifier"
1171
+ },
1172
+ {
1173
+ "include": "#endOfLine"
1174
+ }
1175
+ ]
1176
+ }
1177
+ ]
1178
+ },
1179
+ "string": {
1180
+ "patterns": [
1181
+ {
1182
+ "begin": "\\\"",
1183
+ "comment": "String literal",
1184
+ "end": "\\\"",
1185
+ "name": "string.quoted.double",
1186
+ "patterns": [
1187
+ {
1188
+ "comment": "Escape sequences",
1189
+ "match": "(\\\\.)",
1190
+ "name": "constant.character.escape.papyrus"
1191
+ }
1192
+ ]
1193
+ }
1194
+ ]
1195
+ },
1196
+ "typeIdentifier": {
1197
+ "patterns": [
1198
+ {
1199
+ "comment": "Type identifier",
1200
+ "match": "(?i)\\b([_a-z][0-9_a-z]*)\\b",
1201
+ "name": "storage.type.papyrus"
1202
+ }
1203
+ ]
1204
+ },
1205
+ "unaryExpression": {
1206
+ "patterns": [
1207
+ {
1208
+ "comment": "Unary minus or NOT",
1209
+ "match": "(\\-|\\!)",
1210
+ "name": "keyword.operator.papyrus"
1211
+ },
1212
+ {
1213
+ "include": "#castAtom"
1214
+ }
1215
+ ]
1216
+ },
1217
+ "unaryMinus": {
1218
+ "patterns": [
1219
+ {
1220
+ "comment": "Unary minus",
1221
+ "match": "\\-(?=\\d)",
1222
+ "name": "keyword.operator.papyrus"
1223
+ }
1224
+ ]
1225
+ },
1226
+ "unmatched": {
1227
+ "patterns": [
1228
+ {
1229
+ "comment": "Unmatched",
1230
+ "match": "([^\\n\\r])",
1231
+ "name": "meta.invalid.papyrus"
1232
+ }
1233
+ ]
1234
+ },
1235
+ "variable": {
1236
+ "patterns": [
1237
+ {
1238
+ "begin": "(?i)^\\s*([_a-z][0-9_a-z]*)(?:\\[\\])?\\s+([_a-z][0-9_a-z]*)(?:\\s*(\\=)\\s*)",
1239
+ "beginCaptures": {
1240
+ "1": {
1241
+ "name": "storage.type.papyrus"
1242
+ },
1243
+ "2": {
1244
+ "name": "variable.other.papyrus"
1245
+ },
1246
+ "3": {
1247
+ "name": "keyword.operator.papyrus"
1248
+ }
1249
+ },
1250
+ "comment": "Variable declaration with a default value",
1251
+ "end": "([\\n\\r])",
1252
+ "name": "meta.variable.papyrus",
1253
+ "patterns": [
1254
+ {
1255
+ "include": "#constants"
1256
+ },
1257
+ {
1258
+ "match": "(?i)(?:\\b(conditional)\\b)",
1259
+ "name": "keyword.other.papyrus"
1260
+ },
1261
+ {
1262
+ "include": "#expression"
1263
+ },
1264
+ {
1265
+ "include": "#endOfLine"
1266
+ }
1267
+ ]
1268
+ },
1269
+ {
1270
+ "begin": "(?i)^\\s*([_a-z][0-9_a-z]*)(?:\\[\\])?\\s+([_a-z][0-9_a-z]*)(?:\\s+(conditional)\\b)?",
1271
+ "beginCaptures": {
1272
+ "1": {
1273
+ "name": "storage.type.papyrus"
1274
+ },
1275
+ "2": {
1276
+ "name": "variable.other.papyrus"
1277
+ },
1278
+ "3": {
1279
+ "name": "keyword.other.papyrus"
1280
+ }
1281
+ },
1282
+ "comment": "Scriptwide variable declaration without a default value",
1283
+ "end": "([\\n\\r])",
1284
+ "name": "meta.variable.papyrus",
1285
+ "patterns": [
1286
+ {
1287
+ "include": "#endOfLine"
1288
+ }
1289
+ ]
1290
+ }
1291
+ ]
1292
+ },
1293
+ "while": {
1294
+ "patterns": [
1295
+ {
1296
+ "begin": "(?i)^\\s*(while)\\b",
1297
+ "beginCaptures": {
1298
+ "1": {
1299
+ "name": "keyword.other.papyrus"
1300
+ }
1301
+ },
1302
+ "comment": "While statement",
1303
+ "end": "([\\n\\r])",
1304
+ "name": "meta.while.papyrus",
1305
+ "patterns": [
1306
+ {
1307
+ "include": "#expression"
1308
+ },
1309
+ {
1310
+ "include": "#endOfLine"
1311
+ }
1312
+ ]
1313
+ }
1314
+ ]
1315
+ },
1316
+ "whitespace": {
1317
+ "patterns": [
1318
+ {
1319
+ "comment": "Whitespace",
1320
+ "match": "([ \\t])",
1321
+ "name": "meta.whitespace.papyrus"
1322
+ }
1323
+ ]
1324
+ }
1325
+ },
1326
+ "scopeName": "source.papyrus.skyrim",
1327
+ "uuid": "01a6e257-d5f5-46f0-8795-b04ebd6eeaa7"
1328
+ }