File: haskell.jsf

package info (click to toggle)
joe 4.6-1.1
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 10,236 kB
  • sloc: ansic: 51,619; sh: 4,326; makefile: 195; csh: 26
file content (445 lines) | stat: -rw-r--r-- 8,712 bytes parent folder | download | duplicates (3)
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
# JOE syntax highlight file for Haskell

=Idle
=Comment
=Keyword
=Statement	+Keyword
=Conditional	+Statement +Keyword
=Structure	+Type +Keyword
=Bad
=Constant
=Number		+Constant
=FloatNumber	+Number
=DecNumber	+Number
=HexNumber	+Number
=OctNumber	+Number
=String		+Constant
=StringEscape	+Escape +String
=Character	+String
=CharacterEscape +StringEscape

=StringGap
=Special	+Escape
=ModId		+Type
=VarId		+Ident
=ConId		+Ident
=VarSym		+Operator
=Pragma 	+Preproc

:reset Idle
	*		reset		
	"a-z_"		varid		buffer recolor=-1
	"A-Z"		conormodid	mark recolor=-1
	":"		consym		buffer recolor=-1
	"!#$%&*+./<=>?@\\^|~" varsym	buffer recolor=-1
	"-"		dashorvarsym	mark buffer recolor=-1
	"(),;[]`}"	special		recolor=-1
	"{"		specialorncomment recolor=-1
	"0-9"		integerstart	mark noeat
	"\'"		charlit		recolor=-1
	"\""		strlit		recolor=-1
	
:special Special
	*		reset		noeat
	
:specialorncomment Special
	*		reset		noeat
	"-"		ncommentstart	recolor=-2
	
:ncommentstart Comment comment
	*		reset		noeat call=.comment()
	"#"		pragma		recolor=-3

.subr comment

:ncomment Comment comment
	*		ncomment
	"BFHNTX"	ncomment	noeat call=comment_todo.comment_todo()
	"-"		ncommentmaybeend
	"{"		ncommentmaybenest

:ncommentmaybeend Comment comment
	*		ncomment	noeat
	"}"		ncomment	return

:ncommentmaybenest Comment comment
	*		ncomment	noeat
	"-"		ncomment	call=.comment()

.end

:pragma Pragma
	*		pragma
	"#"		pragmamaybeend1
	"-"		pragmamaybebadend

:pragmamaybeend1 Pragma
	*		pragma		noeat
	"-"		pragmamaybeend2
	
:pragmamaybeend2 Pragma
	*		pragma		noeat
	"}"		reset
	
:pragmamaybebadend Bad
	*		pragma		noeat
	"}"		errorstate	recolor=-2
	
:errorstate Bad
	*		reset

:conormodid ConId
	*		reset		noeat
	"."		probablymodid	recolor=-1
	"a-zA-Z0-9'_"	conormodid
	
# give it color varid to color the dot in case it is *not* a modid in the
# right color
:probablymodid VarSym
	*		ismodid		noeat recolormark recolor=-1
	" \t\r\n\v\f"	reset
	
:ismodid ModId
	*		reset		noeat

:varid VarId
	*		reset		noeat strings
	"case"		stmt
	"class"		struct
	"data"		struct
	"default"	struct
	"deriving"	struct
	"do"		stmt
	"else"		cond
	"if"		cond
	"import"	kw
	"infix"		struct
	"infixl"	struct
	"infixr"	struct
	"instance"	struct
	"let"		stmt
	"module"	struct
	"newtype"	kw
	"of"		stmt
	"then"		cond
	"type"		kw
	"where"		struct
	"_"		kw
done
	"a-zA-Z0-9_'"	varid

:kw Keyword
	*		reset		noeat

:cond Conditional
	*		reset		noeat

:struct Structure
	*		reset		noeat

:stmt Statement
	*		reset		noeat

:consym ConId
	*		reset		noeat strings
	":"		kw
	"::"		kw
done
	"-!#$%&*+./<=>?@\\^|~:" consym

:varsym VarSym
	*		reset		noeat strings
	".."		kw
	"="		kw
	"\\"		kw
	"|"		kw
	"<-"		kw
	"->"		kw
	"@"		kw
	"~"		kw
done
	"-!#$%&*+./<=>?@\\^|~:" varsym

:dashorvarsym VarSym
	*		varsym		noeat
	"-"		dashdash	hold
	
:dashdash VarSym
	*		linecomment	recolormark noeat
	"!#$%&*+./<=>?@\\^|~:" varsym
	"-" 		dashdash
	
:linecomment Comment comment
	*		linecomment
	"BFHNTX"	linecomment	noeat call=comment_todo.comment_todo()
	"\n"		reset

:integerstart DecNumber
	*		decnum
	"0"		intdispatch

:decnum DecNumber
	*		reset		noeat
	"."		floatmaybemant
	"e"		floatexponentstart
	"0-9"		decnum
	
:intdispatch DecNumber
	*		decnum		noeat
	"oO"		octstart
	"xX"		hexstart

# Catch "0o " which is "integer 0" "symbol o" "whitespace"
# and "0oo" which is "integer 0" "symbol oo"
:octstart OctNumber
	*		varid		noeat recolor=-2
	"0-7"		octint		recolor=-3

# Catch "0o08" which is "(octal) integer 0" "integer 8"
:octint OctNumber
	*		reset		noeat
	"0-7"		octint

:hexstart HexNumber
	*		varid		noeat recolor=-2
	"0-9a-fA-F"	hexint		recolor=-3

:hexint HexNumber
	*		reset		noeat
	"0-9a-fA-F"	hexint

# default jumps to varsym because the dot that sent us here is the first
# char of a symbol.
:floatmaybemant FloatNumber
	*		varsym		noeat recolor=-2
	"0-9"		floatmantissa	recolormark

:floatmantissa FloatNumber
	*		reset		noeat
	"0-9"		floatmantissa
	"eE"		floatexponentstart

# after an 'e'
# default jump is for identifiers starting with e directly pasted to a
# number
# recolormark is needed in the case we got here from decnum
:floatexponentstart FloatNumber
	*		varid		noeat recolor=-2
	"+-"		floatexponentstart2
	"0-9"		floatexponent	recolormark

# in case of non-digit:
# the e is a one-char-identifier, the + or - is the start of a symbol
:floatexponentstart2 FloatNumber
	*		unrollfloat	noeat recolor=-3
	"0-9"		floatexponent	recolormark

:floatexponent FloatNumber
	*		reset		noeat
	"0-9"		floatexponent

# the error is just for testing...
:unrollfloat VarId
	*		varsym		noeat recolor=-2

:charlit Character string
	*		charlitend
	"\n"		errorstate	noeat recolor=-2
	"\'"		errorstate	noeat recolor=-2
	"\\"		escape_charlit	mark recolor=-1

:charlitend Character string
	*		charliterror	noeat
	"\'"		reset

:escape_charlit CharacterEscape string
	*		charliterror	recolor=-2
	"0-9"		escdecchar
	"o"		escoctcharstart
	"x"		eschexcharstart
	"abfnrtv\\\"\'"	charlitend
	"A-Z"		escasciichar	buffer
	"^"		escasciictrlchar

:escoctcharstart CharacterEscape string
	*		charliterror	recolor=-3 noeat
	"0-7"		escoctchar

:escoctchar CharacterEscape string
	*		charlitend	noeat
	"0-7"		escoctchar

:escdecchar CharacterEscape string
	*		charlitend	noeat
	"0-9"		escdecchar

:eschexcharstart CharacterEscape string
	*		charliterror	recolor=-3 noeat
	"0-9a-fA-F"	eschexchar

:eschexchar CharacterEscape string
	*		charlitend	noeat
	"0-9a-fA-F"	eschexchar

:escascnotfoundchar CharacterEscape string
	*		charliterror	recolormark noeat
	"A-Z"		escasciichar

:escasciichar CharacterEscape string
	*		charliterror	recolormark
	"A-Z'"		escascnotfoundchar noeat	strings
	"NUL"		asciidonechar
	"STX"		asciidonechar
	"ETX"		asciidonechar
	"EOT"		asciidonechar
	"ENQ"		asciidonechar
	"ACK"		asciidonechar
	"BEL"		asciidonechar
	"BS"		asciidonechar
	"HT"		asciidonechar
	"LF"		asciidonechar
	"VT"		asciidonechar
	"FF"		asciidonechar
	"CR"		asciidonechar
	"SO"		asciiSOchar
	"SI"		asciidonechar
	"DLE"		asciidonechar
	"DC1"		asciidonechar
	"DC2"		asciidonechar
	"DC3"		asciidonechar
	"DC4"		asciidonechar
	"NAK"		asciidonechar
	"SYN"		asciidonechar
	"ETB"		asciidonechar
	"CAN"		asciidonechar
	"EM"		asciidonechar
	"SUB"		asciidonechar
	"ESC"		asciidonechar
	"FS"		asciidonechar
	"GS"		asciidonechar
	"RS"		asciidonechar
	"US"		asciidonechar
	"SP"		asciidonechar
	"DEL"		asciidonechar
done

:asciiSOchar CharacterEscape string
	*		charliterror	recolormark
	"'"		charlitend	noeat
	"H"		charlitend

:escasciictrlchar CharacterEscape string
	*		charliterror	noeat recolor=-3
	"A-Z@[\\]^_"	charlitend

:asciidonechar CharacterEscape string
	*		charlitend noeat

:charliterror Bad
	*		charliterror
	"\'"		charlitend	noeat

# now for string literals

:strlit String string
	*		strlit
	"\""		reset
	"\n"		errorstate	noeat recolor=-2
	"\\"		escape_strlit	mark recolor=-1

:escape_strlit StringEscape string
	*		strliterror	recolor=-2
	"0-9"		escdecstr
	"o"		escoctstrstart
	"x"		eschexstrstart
	"abfnrtv\\\"\'&"	strlit
	"A-Z"		escasciistr	buffer
	"^"		escasciictrlstr
	" \t\n\r\v"	stringgap	recolor=-2

:escoctstrstart StringEscape string
	*		strliterror	recolor=-3 noeat
	"0-7"		escoctstr

:escoctstr StringEscape string
	*		strlit	noeat
	"0-7"		escoctstr

:escdecstr StringEscape string
	*		strlit	noeat
	"0-9"		escdecstr

:eschexstrstart StringEscape string
	*		strliterror	recolor=-3 noeat
	"0-9a-fA-F"	eschexstr

:eschexstr StringEscape string
	*		strlit		noeat
	"0-9a-fA-F"	eschexstr

:escascnotfoundstr StringEscape string
	*		strliterror	recolormark noeat
	"A-Z"		escasciistr

:escasciistr StringEscape string
	*		strliterror	noeat recolormark
	"A-Z\""		escascnotfoundstr noeat	strings
	"NUL"		asciidonestr
	"STX"		asciidonestr
	"ETX"		asciidonestr
	"EOT"		asciidonestr
	"ENQ"		asciidonestr
	"ACK"		asciidonestr
	"BEL"		asciidonestr
	"BS"		asciidonestr
	"HT"		asciidonestr
	"LF"		asciidonestr
	"VT"		asciidonestr
	"FF"		asciidonestr
	"CR"		asciidonestr
	"SO"		asciiSOstr
	"SI"		asciidonestr
	"DLE"		asciidonestr
	"DC1"		asciidonestr
	"DC2"		asciidonestr
	"DC3"		asciidonestr
	"DC4"		asciidonestr
	"NAK"		asciidonestr
	"SYN"		asciidonestr
	"ETB"		asciidonestr
	"CAN"		asciidonestr
	"EM"		asciidonestr
	"SUB"		asciidonestr
	"ESC"		asciidonestr
	"FS"		asciidonestr
	"GS"		asciidonestr
	"RS"		asciidonestr
	"US"		asciidonestr
	"SP"		asciidonestr
	"DEL"		asciidonestr
done

:asciiSOstr StringEscape string
	*		strlit		noeat
	"H"		strlit

:escasciictrlstr StringEscape string
	*		strliterror	noeat recolor=-3
	"A-Z@[\\]^_"	strlit

:asciidonestr StringEscape string
	*		strlit		noeat

:stringgap StringGap string
	*		strgaperror	recolor=-1
	"\\"		strlit
	" \n\r\t\v"	stringgap

:strgaperror Bad
	*		strgaperror
	"\\"		strlit		
	"\""		reset

:strliterror Bad
	*		strlit		noeat