-
Notifications
You must be signed in to change notification settings - Fork 3
/
shaderforth.YAML-tmLanguage
107 lines (104 loc) · 2.57 KB
/
shaderforth.YAML-tmLanguage
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
103
104
105
106
107
# [PackageDev] target_format: plist, ext: tmLanguage
---
name: Shaderforth
scopeName: source.shaderforth
fileTypes: [sfr]
uuid: 3f3a3f53-00ee-4b3f-afb8-78cdf3761a3b
patterns:
- comment: comment
name: comment.shaderforth
begin: (?!\s)\((?=\s)
end: (?!\s)\)(?=\s)
patterns:
- include: comment.shaderforth
- comment: numbers
name: constant.numeric.shaderforth
match: (?!\s)#?-?+?([0-9]+|[0-9]+\.[0-9]*|\.[0-9]+)(?=\s)
- comment: words
name: meta.function.shaderforth
begin: (?!\s)(:)\s+([^\s]+)\s+(\(\s+([^\)]+\s+)?\))
beginCaptures:
'2':
name: storage.type.function.shaderforth
'3':
name: keyword.shaderforth
'4':
name: entity.name.function.shaderforth
end: (?!\s);(?=\s)
endCaptures:
'1':
name: storage.type.function.shaderforth
patterns:
- include: $self
- comment: imports
name: keyword.import.shaderforth
match: (?!\s)import\[\s(.*?)\s\](?=\s)
captures:
'1':
name: storage.type.name.shaderforth
- comment: macros
name: meta.function.shaderforth
begin: (?!\s):m\s+([^\s]+)(\s+\(\s+([^\)]+\s+)?\))?
beginCaptures:
'1':
name: storage.type.function.shaderforth
'2':
name: keyword.shaderforth
'3':
name: entity.name.function.shaderforth
end: (?!\s);(?=\s)
endCaptures:
'1':
name: storage.type.function.shaderforth
patterns:
- include: $self
- comment: globals/passes
name: meta.function.shaderforth
begin: (?!\s)(:globals|:passes)(?=\s)
beginCaptures:
'0':
name: storage.type.function.shaderforth
end: (?!\s);(?=\s)
endCaptures:
'0':
name: storage.type.function.shaderforth
patterns:
- include: $self
- comment: arrays
name: meta.array.shaderforth
begin: (?!\s)\[(?=\s)
beginCaptures:
'0':
name: storage.type.array.shaderforth
endCaptures:
'0':
name: storage.type.array.shaderforth
end: (?!\s)\][mv]?(?=\s)
patterns:
- include: $self
- comment: blocks
name: meta.block.shaderforth
begin: (?!\s)[\\/]?\{(\s+\(\s+([^\)]+\s+)?\))?(?=\s)
beginCaptures:
'0':
name: storage.type.block.shaderforth
'1':
name: entity.name.function.shaderforth
endCaptures:
'0':
name: storage.type.block.shaderforth
end: (?!\s)\}(?=\s)
patterns:
- include: $self
- comment: operations
name: keyword.shaderforth
match: (?!\s)[\\/*/+-<>=~!@#$%^&|?]+(?=\s)
- comment: named
name: keyword.shaderforth
match: (?!\s)(->|=>|=|\.|&|\\|/|\*|@)([a-zA-Z0-9\-_~!@#$%^&*()\[\]+=+<>]+)(?=\s)
captures:
'1':
name: keyword.shaderforth
'2':
name: storage.type.name.shaderforth
...