-
Notifications
You must be signed in to change notification settings - Fork 173
/
Copy pathfuthark.lang
177 lines (155 loc) · 5.94 KB
/
futhark.lang
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?xml version="1.0" encoding="UTF-8"?>
<!--
Author: Svip <[email protected]>
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<language id="futhark" _name="Futhark" version="2.0" _section="Sources">
<metadata>
<property name="mimetypes">text/x-futhark;application/x-futhark;text/x-futhark-source;application/x-futhark-source</property>
<property name="globs">*.fut</property>
<property name="line-comment-start">--</property>
</metadata>
<styles>
<style id="comment" _name="Comment" map-to="def:comment" />
<!-- <style id="error" _name="Error" map-to="def:error"/>-->
<style id="keyword" _name="Keyword" map-to="def:keyword" />
<style id="builtin-functionlikes" _name="Functionlikes" map-to="def:identifier" />
<style id="variable" _name="Variable"/> <!-- map to nothing -->
<style id="identifier" _name="Identifier"/> <!-- map to nothing -->
<style id="string" _name="String" map-to="def:string" />
<!-- <style id="common-function" _name="Common Function" map-to="def:keyword"/>-->
<style id="operator" _name="Operator" map-to="def:operator"/>
<style id="boolean" _name="Boolean" map-to="def:boolean"/>
<style id="type" _name="Datatype" map-to="def:type"/>
<style id="floating-point" _name="Floating point number" map-to="def:floating-point"/>
<style id="decimal" _name="Decimal number" map-to="def:decimal"/>
<!-- <style id="octal" _name="Octal number" map-to="def:base-n-integer"/>-->
<style id="hexadecimal" _name="Hexadecimal number" map-to="def:decimal"/>
</styles>
<definitions>
<context id="line-comment" style-ref="comment" end-at-line-end="true" extend-parent="false" class="comment" class-disabled="no-spell-check">
<start>--</start>
<include>
<context ref="def:in-line-comment"/>
</include>
</context>
<context id="variable" style-ref="variable">
<match>[a-zA-Z_][a-zA-Z0-9_']*</match>
</context>
<context id="keywords" style-ref="keyword">
<keyword>if</keyword>
<keyword>then</keyword>
<keyword>else</keyword>
<keyword>let</keyword>
<keyword>loop</keyword>
<keyword>with</keyword>
<keyword>def</keyword>
<keyword>entry</keyword>
<keyword>fn</keyword>
<keyword>for</keyword>
<keyword>while</keyword>
<keyword>do</keyword>
<keyword>in</keyword>
<keyword>local</keyword>
<keyword>type</keyword>
<keyword>val</keyword>
<keyword>module</keyword>
<keyword>open</keyword>
<keyword>import</keyword>
</context>
<context id="builtin-functionlikes" style-ref="builtin-functionlikes">
<!-- These 'behave' like builtin-functions, because they take the 'fun'
syntax as their primary input. -->
<keyword>map</keyword>
<keyword>reduce</keyword>
<keyword>reduce_comm</keyword>
<keyword>scan</keyword>
<keyword>filter</keyword>
<keyword>partition</keyword>
<keyword>stream_map</keyword>
<keyword>stream_map_per</keyword>
<keyword>stream_red</keyword>
<keyword>stream_red_per</keyword>
<keyword>stream_seq</keyword>
<keyword>iota</keyword>
</context>
<context id="operators" style-ref="operator" extend-parent="false">
<match>[+\-\*/><%\!=&\|\^:]</match>
</context>
<context id="type" style-ref="type">
<keyword>i8</keyword>
<keyword>i16</keyword>
<keyword>i32</keyword>
<keyword>i64</keyword>
<keyword>u8</keyword>
<keyword>u16</keyword>
<keyword>u32</keyword>
<keyword>u64</keyword>
<keyword>int</keyword>
<keyword>real</keyword>
<keyword>bool</keyword>
<keyword>char</keyword>
<keyword>f32</keyword>
<keyword>f64</keyword>
</context>
<context id="boolean" style-ref="boolean">
<prefix>(?<![\w\.])</prefix>
<keyword>false</keyword>
<keyword>true</keyword>
</context>
<context id="float" style-ref="floating-point">
<match extended="true">
(?<![\w\.])
(([0-9]+(\.[0-9]+)?))
([eE][\+\-]?[0-9]+)?
(f(32|64))?
(?![\w\.])
</match>
</context>
<context id="integer" style-ref="decimal">
<match extended="true">
(?<![\w\.])
[+-]?[0-9]+
([ui](8|16|32|64))?
(?![\w\.])
</match>
</context>
<context id="hexadecimal-number" style-ref="hexadecimal">
<match extended="true">
(?<![\w\.])
[+-]?0x[0-9a-fA-F]+
([ui](8|16|32|64))?
(?![\w\.])
</match>
</context>
<context id="double-quoted-string" style-ref="string">
<start>"</start>
<end>"</end>
</context>
<context id="futhark" class="no-spell-check">
<include>
<context ref="line-comment" />
<context ref="type" />
<context ref="boolean" />
<context ref="keywords" />
<context ref="builtin-functionlikes" />
<context ref="operators" />
<context ref="float" />
<context ref="hexadecimal-number" />
<context ref="integer" />
<context ref="double-quoted-string" />
<context ref="variable" />
</include>
</context>
</definitions>
</language>