forked from vtereshkov/umka-lang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Umka.sublime-syntax
78 lines (65 loc) · 2.18 KB
/
Umka.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
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
file_extensions:
- um
scope: source.umka
contexts:
main:
# Line comments
- match: '//'
scope: punctuation.definition.comment.umka
push: line_comment
# Block comments
- match: '/\*'
scope: punctuation.definition.comment.begin.umka
push: block_comment
# Keywords
- match: '\b(break|case|const|continue|default|else|for|fn|import|interface|if|in|return|str|struct|switch|type|var|weak)\b'
scope: keyword.control.umka
# Operators
- match: '\+|\-|\*|/|%|&|\||~|<<|>>|\+=|\-=|\*=|/=|%=|&=|\|=|~=|<<=|>>=|&&|\|\||!|\++|\--|==|<|>|!=|<=|>=|=|:='
scope: keyword.operator.umka
# Punctuation
- match: '\(|\)|\[|\]|\{|\}|\^|;|:|\.'
scope: punctuation.separator.umka
# Numeric literals
- match: '\b(0[Xx])?[0-9.]+([Ee][+-]?[0-9]*)?\b'
scope: constant.numeric.umka
# String literals
- match: '"'
scope: punctuation.definition.string.begin.umka
push: double_quoted_string
# Character literals
- match: ''''
scope: punctuation.definition.string.begin.umka
push: single_quoted_string
# Predeclared constants
- match: '\b(true|false|null)\b'
scope: storage.constant.umka
# Predeclared types
- match: '\b(void|int8|int16|int32|int|uint8|uint16|uint32|uint|bool|char|real32|real|fiber)\b'
scope: storage.type.umka
double_quoted_string:
- meta_scope: string.quoted.double.umka
- match: '\\.'
scope: constant.character.escape.umka
- match: '"'
scope: punctuation.definition.string.end.umka
pop: true
single_quoted_string:
- meta_scope: string.quoted.single.umka
- match: '\\.'
scope: constant.character.escape.umka
- match: ''''
scope: punctuation.definition.string.end.umka
pop: true
line_comment:
- meta_scope: comment.line.umka
- match: $
pop: true
block_comment:
- meta_scope: comment.block.umka
- match: '\*/'
scope: punctuation.definition.comment.end.umka
pop: true