Skip to content

Commit 7fc4b8b

Browse files
committed
Added syntax for .lang files
1 parent d2871e7 commit 7fc4b8b

File tree

1 file changed

+125
-0
lines changed

1 file changed

+125
-0
lines changed

Language.sublime-syntax

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
%YAML 1.2
2+
---
3+
name: Crackshell Language
4+
file_extensions:
5+
- lang
6+
scope: text.xml.lang
7+
variables:
8+
valid_types: '(string)'
9+
contexts:
10+
preprocessor-expression:
11+
- match: '\b[A-Z0-9_]+\b'
12+
scope: entity.name.constant
13+
- match: '(\|\||&&)'
14+
scope: keyword.operator.logical
15+
- match: '"'
16+
scope: punctuation.definition.string.begin
17+
push:
18+
- meta_scope: string.quoted.double
19+
- match: '"'
20+
scope: punctuation.definition.string.end
21+
pop: true
22+
- match: '$'
23+
pop: true
24+
25+
has-preprocessor:
26+
- match: '^\s*(%)'
27+
captures:
28+
1: keyword.control.import
29+
push:
30+
- meta_scope: meta.preprocessor
31+
- match: '//.*'
32+
scope: comment.line
33+
- match: '(?i)(if|else|endif)\b'
34+
scope: support.function
35+
set: preprocessor-expression
36+
- match: '(PROFILE_START|PROFILE_STOP)\b'
37+
scope: support.function
38+
set:
39+
- meta_scope: string.unquoted
40+
- match: '$'
41+
pop: true
42+
- match: '[A-Za-z_][A-Za-z0-9_]+'
43+
scope: keyword.control.import
44+
set: preprocessor-expression
45+
- match: '$'
46+
pop: true
47+
48+
comment:
49+
- match: '<!--'
50+
scope: punctuation.definition.comment.begin
51+
push:
52+
- meta_scope: comment.block
53+
- match: '-->'
54+
scope: punctuation.definition.comment.end
55+
pop: true
56+
- match: '-{2,}'
57+
scope: invalid.illegal.double-hyphen-within-comment
58+
59+
string:
60+
- meta_scope: string.quoted.double
61+
- match: '"'
62+
scope: punctuation.definition.string.end
63+
pop: true
64+
65+
attributes:
66+
- include: has-preprocessor
67+
- match: '[A-Za-z0-9\-_]+\b'
68+
scope: entity.other.attribute-name
69+
push: attribute-value
70+
- match: '(?=/?>)'
71+
pop: true
72+
73+
attribute-value:
74+
- match: '='
75+
scope: punctuation.separator.key-value
76+
- match: '"'
77+
scope: punctuation.definition.string.begin
78+
push: string
79+
- match: ''
80+
pop: true
81+
82+
main:
83+
- include: comment
84+
- include: has-preprocessor
85+
- match: '(<)/?$'
86+
captures:
87+
1: invalid.illegal.missing-entity
88+
- match: '<'
89+
scope: punctuation.definition.tag.begin
90+
push:
91+
- meta_scope: meta.tag.xml
92+
93+
- match: '/?>'
94+
scope: punctuation.definition.tag.end
95+
pop: true
96+
- match: '/'
97+
scope: punctuation.definition.tag.begin
98+
99+
- match: '\b(lang)\s*\b'
100+
captures:
101+
1: entity.name.tag storage.type
102+
push:
103+
- match: '(name)\b'
104+
scope: support.other
105+
push: attribute-value
106+
- include: attributes
107+
108+
- match: '\b(string)\s*\b'
109+
captures:
110+
1: entity.name.tag storage.type
111+
push:
112+
- match: '(name)\b'
113+
scope: support.other
114+
push: attribute-value
115+
- include: attributes
116+
117+
- match: '\b{{valid_types}}\b'
118+
scope: entity.name.tag storage.type
119+
- match: '\b[A-Za-z0-9\-_]+\b'
120+
scope: invalid.illegal.unsupported-type
121+
- match: '\s+'
122+
push: attributes
123+
- match: '((%)[^%\s]+(%))'
124+
captures:
125+
1: constant.other.placeholder

0 commit comments

Comments
 (0)