-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSValue.sublime-syntax
132 lines (124 loc) · 3.69 KB
/
SValue.sublime-syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
%YAML 1.2
---
name: Crackshell SValue
file_extensions:
- sval
- lvl
- pfb
- resources.xml
- info.xml
scope: text.xml.sval
variables:
valid_attributes: '(name)'
valid_functions: '(loader|svals|d|dict|a|array)'
valid_types: '(h|hstring|s|string|i|int|long|f|float|b|bool|i?vec[234]|bytes|null)'
contexts:
preprocessor-expression:
- match: '\b[A-Z0-9_]+\b'
scope: entity.name.constant
- match: '(\|\||&&)'
scope: keyword.operator.logical
- match: '"'
scope: punctuation.definition.string.begin
push:
- meta_scope: string.quoted.double
- match: '"'
scope: punctuation.definition.string.end
pop: true
- match: '$'
pop: true
has-preprocessor:
- match: '^\s*(%)'
captures:
1: keyword.control.import
push:
- meta_scope: meta.preprocessor
- match: '//.*'
scope: comment.line
- match: '(?i)(if|else|endif)\b'
scope: support.function
set: preprocessor-expression
- match: '(PROFILE_START|PROFILE_STOP)\b'
scope: support.function
set:
- meta_scope: string.unquoted
- match: '$'
pop: true
- match: '[A-Za-z_][A-Za-z0-9_]+'
scope: keyword.control.import
set: preprocessor-expression
- match: '$'
pop: true
comment:
- match: '<!--'
scope: punctuation.definition.comment.begin
push:
- meta_scope: comment.block
- match: '-->'
scope: punctuation.definition.comment.end
pop: true
- match: '-{2,}'
scope: invalid.illegal.double-hyphen-within-comment
string:
- meta_scope: string.quoted.double
- match: '"'
scope: punctuation.definition.string.end
pop: true
attribute-value:
- match: '='
scope: punctuation.separator.key-value
- match: '"'
scope: punctuation.definition.string.begin
push: string
- match: ''
pop: true
main:
- include: comment
- include: has-preprocessor
- match: '(<)/?$'
captures:
1: invalid.illegal.missing-entity
- match: '<'
scope: punctuation.definition.tag.begin
push:
- meta_scope: meta.tag.xml
- match: '/?>'
scope: punctuation.definition.tag.end
pop: true
- match: '/'
scope: punctuation.definition.tag.begin
- match: '\b(string)\s+(name)(=)((")(class)("))(>)'
captures:
1: entity.name.tag keyword.other
2: support.other
3: punctuation.separator.key-value
4: string.quoted.double
5: punctuation.definition.string.begin
6: entity.name.function
7: punctuation.definition.string.end
8: punctuation.definition.tag.end
set:
- match: '([A-Za-z_][A-Za-z0-9_]+)(::)'
captures:
1: entity.name.namespace
2: punctuation.separator
- match: '[A-Za-z_][A-Za-z0-9_]+'
scope: entity.name.class
- match: ''
pop: true
- match: '\b{{valid_functions}}\b'
scope: entity.name.tag support.function
- match: '\b{{valid_types}}\b'
scope: entity.name.tag keyword.other
- match: '\b[A-Za-z0-9_]+\b'
scope: invalid.illegal.unsupported-type
- match: '\s+'
push:
- match: '{{valid_attributes}}\b'
scope: support.other
push: attribute-value
- match: '[A-Za-z0-9\-]+\b'
scope: invalid.illega.unsupported-attribute
push: attribute-value
- match: '(?=/?>)'
pop: true