Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit f608299

Browse files
committed
Adds additional color contexts you can customize
Changes by: @joaocarvalhoopen Under `Preferences -> Customize Color Scheme` you can now customize these additional color scopes. ``` // Documentation at https://www.sublimetext.com/docs/color_schemes.html { "rules": [ { "scope": "keyword.operator.odin", "foreground": "#66CCAA" }, { "scope": "keyword.separator.odin", "foreground": "#DDFFCC" }, { "scope": "keyword.pointers.odin", "foreground": "#FFFF00" }, { "scope": "keyword.logic.odin", "foreground": "#00CC00" }, { "scope": "keyword.generic.odin", "foreground": "#AABB00" }, ] } ```
1 parent 5d6a0ed commit f608299

File tree

1 file changed

+55
-19
lines changed

1 file changed

+55
-19
lines changed

Odin.sublime-syntax

Lines changed: 55 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ contexts:
4747
- meta_scope: comment.line.double-slash.odin
4848
- match: \n
4949
pop: true
50+
- match: "#[+]"
51+
scope: punctuation.definition.comment.odin
52+
push:
53+
- meta_scope: comment.line.double-slash.odin
54+
- match: \n
55+
pop: true
5056

5157
keywords:
5258
- match: \b(import|foreign|package)\b
@@ -63,6 +69,8 @@ contexts:
6369
scope: keyword.operator.odin
6470
- match: \b(context)\b
6571
scope: keyword.operator.odin
72+
- match: '(\+|\-|\*|\/|\:|\:\:|\:=|\+\=|\*\=|\=|\-\=|\=\=|\!\=|\<\=|\>\=|\<|\>|\.\.\<|\.\.\=|\?|\~|\||\&\~)'
73+
scope: keyword.operator.odin
6674
- match: \b(nil|true|false)\b
6775
scope: constant.language.odin
6876
- match: '\b(\d(\d|_)*(.\d(\d|_)*)?)((e|E)(\+|-)?\d+)?[ijk]?\b'
@@ -77,25 +85,37 @@ contexts:
7785
scope: keyword.function.odin
7886
- match: '([#]\s*{{identifier}})'
7987
scope: keyword.tag.odin
80-
- match: '(#[+]\s*[[:alpha:]-][[:alnum:]-]*)'
81-
scope: keyword.tag.odin
8288
- match: '(\x40\s*{{identifier}})'
8389
scope: keyword.tag.odin
8490
- match: '(\x40\s*[(]\s*{{identifier}})\s*[)]'
8591
scope: keyword.tag.odin
8692
- match: '@'
8793
scope: keyword.operator.odin
94+
- match: '(\(|\)|\{|\}|\[|\]|,|;)'
95+
scope: keyword.separator.odin
96+
- match: '(\&\&|\|\||\!)'
97+
scope: keyword.logic.odin
98+
- match: '(\&|\^|\.)'
99+
scope: keyword.pointers.odin
100+
# - match: '(\$)'
101+
# scope: keyword.generic.odin
88102

89103
functions-and-declarations:
90-
- match: '\b({{identifier}})\s*[:]\s*[:]\s*(proc)'
104+
- match: '\b({{identifier}})\s*(:)\s*(:)\s*(proc)'
91105
captures:
92106
1: meta.function.odin entity.name.function.odin
93-
2: storage.type.odin
94-
- match: '\b({{identifier}})\s*[:]\s*[:]\s*([#]force_inline|[#]force_no_inline)\s+(proc)'
107+
2: keyword.separator.odin
108+
3: keyword.separator.odin
109+
4: storage.type.odin
110+
111+
- match: '\b({{identifier}})\s*(:)\s*(:)\s*([#]force_inline|[#]force_no_inline)\s+(proc)'
95112
captures:
96113
1: meta.function.odin entity.name.function.odin
97-
2: keyword.control.odin
98-
3: storage.type.odin
114+
2: keyword.separator.odin
115+
3: keyword.separator.odin
116+
4: keyword.control.odin
117+
5: storage.type.odin
118+
99119
- match: \b(size_of|align_of|offset_of|type_of)\b\s*\(
100120
captures:
101121
1: keyword.function.odin
@@ -105,38 +125,54 @@ contexts:
105125
- match: (proc)\s*[\(]
106126
captures:
107127
1: storage.type.odin
108-
- match: ({{identifier}})\s*[!]?\s*[\(]
128+
- match: ({{identifier}})\s*[!]?\s*(\()
109129
captures:
110130
1: support.function.odin
111-
- match: '\b({{identifier}})\s*[:]\s*[:]\s*(struct|union|enum|bit_set)'
131+
2: keyword.separator.odin
132+
133+
- match: '\b({{identifier}})\s*(:)\s*(:)\s*(struct|union|enum|bit_set)'
112134
captures:
113135
1: meta.type.odin entity.name.type.odin
114-
2: storage.type.odin
115-
- match: '\b({{identifier}})\s*[:]\s*[:]\s*([#]\s*type)'
136+
2: keyword.separator.odin
137+
3: keyword.separator.odin
138+
4: storage.type.odin
139+
140+
- match: '\b({{identifier}})\s*(:)\s*(:)\s*([#]\s*type)'
116141
captures:
117142
1: meta.type.odin entity.name.type.odin
118-
2: keyword.tag.odin
119-
- match: '\b({{identifier}})\s*[:]\s*[:]\s*'
143+
2: keyword.operator.odin
144+
3: keyword.operator.odin
145+
4: keyword.tag.odin
146+
147+
- match: '\b({{identifier}})\s*(:)\s*(:)\s*'
120148
captures:
121149
1: meta.constant.odin entity.name.type.odin
150+
2: keyword.operator.odin
151+
3: keyword.operator.odin
152+
122153

123154
types:
124155
- match: '\b(struct|enum|union|bit_set)\b(?:(\{)(\}))?'
125156
captures:
126157
1: storage.type.odin
127-
2: meta.block.odin punctuation.definition.block.begin.odin
158+
2: meta.block.odin punctuation.definition.block.begin.odin
159+
# 2: meta.block.odin keyword.separator.odin
128160
3: meta.block.odin punctuation.definition.block.end.odin
129161
- match: '\b(proc)\b'
130162
scope: storage.type.odin
131163
- match: (\[)(\d*)(\])(?=[[:alpha:]_])
132-
scope: meta.brackets.odin
164+
scope: meta.brackets.odin
133165
captures:
134-
1: punctuation.definition.brackets.begin.odin
166+
1: punctuation.definition.brackets.begin.odin keyword.separator.odin
135167
2: constant.numeric.odin
136-
3: punctuation.definition.brackets.end.odin
168+
3: punctuation.definition.brackets.end.odin keyword.separator.odin
137169
- include: basic-types
138-
- match: '\$\s*({{identifier}})'
139-
scope: storage.type.odin
170+
171+
- match: '(\$)\s*({{identifier}})'
172+
captures:
173+
1: keyword.generic.odin
174+
2: storage.type.odin
175+
140176

141177
basic-types:
142178
- match: '\b(i8|i16|i32|i64|i128|int)\b'

0 commit comments

Comments
 (0)