Skip to content

Commit f43ebf3

Browse files
authored
Syntax highlighting fixes
1 parent c944018 commit f43ebf3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Umka.sublime-syntax

+11-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ file_extensions:
55
- um
66
scope: source.umka
77
variables:
8+
keyword: (break|case|const|continue|default|else|enum|for|fn|import|interface|if|in|map|return|str|struct|switch|type|var|weak)
89
builtin: (abs|append|atan|atan2|cap|ceil|copy|cos|delete|exit|exp|fabs|floor|fprintf|fscanf|insert|keys|len|log|make|memusage|new|printf|resume|round|scanf|selfhasptr|selftypeeq|sin|sizeof|sizeofself|slice|sort|sprintf|sqrt|sscanf|trunc|typeptr|valid|validkey)
910
ident: '[A-Za-z_][A-Za-z_0-9]*'
1011
typeident: '_*[A-Z][A-Za-z_0-9]*'
@@ -164,6 +165,9 @@ contexts:
164165
scope: punctuation.definition.parameters.begin.umka
165166
push: function_param_trap
166167

168+
- match: '\bfn\b'
169+
scope: keyword.control.umka
170+
167171
# Definition
168172
- match: '\b({{ident}}){{space}}(\*?){{space}}(?=\()'
169173
captures:
@@ -361,7 +365,7 @@ contexts:
361365
3: constant.enum.umka
362366

363367
# Keywords
364-
- match: '\b(break|case|const|continue|default|else|enum|for|fn|import|interface|if|in|map|return|str|struct|switch|type|var|weak)\b'
368+
- match: '\b{{keyword}}\b'
365369
scope: keyword.control.umka
366370

367371
# Ternary scoped
@@ -391,6 +395,12 @@ contexts:
391395
3: punctuation.separator.umka
392396
4: storage.type.umka
393397

398+
# Variadic type keyword capture
399+
- match: '(\.\.){{space}}\b{{keyword}}\b'
400+
captures:
401+
1: punctuation.separator.um
402+
2: keyword.control.umka
403+
394404
# Variadic type
395405
- match: '(\.\.){{space}}({{ident}})'
396406
captures:

0 commit comments

Comments
 (0)