This repository has been archived by the owner on Apr 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jai.sublime-syntax
102 lines (90 loc) · 2.48 KB
/
Jai.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
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Jai
file_extensions:
- jai
scope: source.jai
contexts:
main:
- include: comment
- include: constant
- include: keyword
- include: struct
- include: enum
- include: cast
comment:
- include: line-comment
- include: block-comment
line-comment:
- match: //
push:
- meta_scope: comment.line.jai
- match: $
pop: true
block-comment:
- match: /\*
push:
# Allow nested comments.
- include: block-comment
- meta_scope: comment.block.jai
- match: \*/
pop: true
constant:
- match: \btrue\b
scope: constant.language.true.jai
- match: \bfalse\b
scope: constant.language.false.jai
- match: \bnull\b
scope: constant.language.null.jai
- match: '(?<!\w)(0(?:x|h))(?:[[:xdigit:]]|_)+'
scope: constant.numeric.hexadecimal.jai
- match: '(?<!\w)(?:\d|_)+(?:\.(?:\d|_)+)?'
scope: constant.numeric.decimal.jai
- match: '".*?"'
scope: string.quoted.double.jai
- match: (#string) (.*)$
captures:
1: keyword.other.directive.jai
2: constant.other.stringdelimiter.jai
scope:
embed: herestring
escape: ^(\2)$
escape_captures:
1: constant.other.stringdelimiter.jai
herestring:
- meta_scope: string.unquoted.jai
keyword:
- match: '#\w*'
scope: keyword.other.directive.jai
- match: '@\S+'
scope: keyword.other.tag.jai
- match: '\b(?:if|then|else|case|for|while|break|continue|defer|return)\b'
scope: keyword.control.jai
- match: '\b(?:xx|size_of)\b'
scope: keyword.operator.word.jai
- match: '(?:\+|-|\*|/|<|>|!)=?'
scope: keyword.operator.jai
- match: ==|<<|\.\.|&&
scope: keyword.operator.jai
- match: '\b(?:using|it|it_index|push_context|inline|no_inline)\b'
scope: keyword.other.jai
- match: '---|\$\$'
scope: keyword.other.jai
- match: '\b(?:Any|void|string|bool|float|float32|float64|int|u8|u16|u32|u64|s8|s16|s32|s64)\b'
scope: storage.type.jai
struct:
- match: (\w+)\s*::\s*(struct)\b
captures:
1: entity.name.type.struct.jai
2: storage.type.struct.jai
enum:
- match: (\w+)\s*::\s*(enum)\b
captures:
1: entity.name.type.enum.jai
2: storage.type.enum.jai
cast:
- match: \b(cast)\s*\((.+?)\)
captures:
1: keyword.operator.word.cast.jai
2: storage.type.jai