-
Notifications
You must be signed in to change notification settings - Fork 0
/
kage.sublime-syntax
67 lines (60 loc) · 2.08 KB
/
kage.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
%YAML 1.2
---
file_extensions:
- kage
scope: source.kage
contexts:
main:
- include: keywords
- include: types
- include: builtins
- include: functions
- include: numbers
- include: comments
keywords:
- match: '\b(package|var|func|if|else|for|return|true|false|nil)\b'
scope: keyword.control.kage
types:
- match: '\b(bool|int|float|vec2|vec3|vec4|mat2|mat3|mat4)\b'
scope: constant.language.kage
builtins:
- match: '\b(sin|cos|tan|asin|acos|atan|atan2|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|bcross|normalize|faceforward|reflect|refract|transpose|dfdx|dfdy|fwidth)\b'
scope: entity.name.tag.kage
functions:
- match: '(?<=func )([a-zA-Z][a-zA-Z0-9]+)(?=\()'
scope: entity.name.function.kage
- match: '[a-zA-Z][a-zA-Z0-9]+(?=\(.*\))'
scope: support.function.kage
numbers:
- match: '(((\.\d+|0[xXbBoO][\dbBxXaAbBcCdDeEfF_]*|(?<=[^\w])\d+)\.{0,1}[\dbBxXaAbBcCdDeEfF_]*([eEpP][-+]{0,1}\d+))|((\.\d+|0[xXbBoO][\dbBxXaAbBcCdDeEfF_]*|(?<=[^\w])\d+)\.{0,1}[\dbBxXaAbBcCdDeEfF_]*))i{0,1}'
scope: constant.numeric.kage
comments:
- match: ^/\* =(\s*.*?)\s*= \*/$\n?
scope: comment.block.kage
captures:
1: meta.toc-list.banner.block.kage
- match: /\*
scope: punctuation.definition.comment.kage
push:
- meta_scope: comment.block.kage
- match: \*/
scope: punctuation.definition.comment.kage
pop: true
- match: ^\s*(\*)(?!/)
captures:
1: punctuation.definition.comment.kage
- match: \*/(?!\*)
scope: invalid.illegal.stray-comment-end.kage
- match: ^// =(\s*.*?)\s*=\s*$\n?
scope: comment.line.banner.kage
captures:
1: meta.toc-list.banner.line.kage
- match: //
scope: punctuation.definition.comment.kage
push:
- meta_scope: comment.line.double-slash.kage
- match: '(\\)$\n'
captures:
1: punctuation.separator.continuation.kage
- match: \n
pop: true