dotfiles

My dotfiles.
Log | Files | Refs | LICENSE

haskell.jsf (8712B)


      1 # JOE syntax highlight file for Haskell
      2 
      3 =Idle
      4 =Comment
      5 =Keyword
      6 =Statement	+Keyword
      7 =Conditional	+Statement +Keyword
      8 =Structure	+Type +Keyword
      9 =Bad
     10 =Constant
     11 =Number		+Constant
     12 =FloatNumber	+Number
     13 =DecNumber	+Number
     14 =HexNumber	+Number
     15 =OctNumber	+Number
     16 =String		+Constant
     17 =StringEscape	+Escape +String
     18 =Character	+String
     19 =CharacterEscape +StringEscape
     20 
     21 =StringGap
     22 =Special	+Escape
     23 =ModId		+Type
     24 =VarId		+Ident
     25 =ConId		+Ident
     26 =VarSym		+Operator
     27 =Pragma 	+Preproc
     28 
     29 :reset Idle
     30 	*		reset		
     31 	"a-z_"		varid		buffer recolor=-1
     32 	"A-Z"		conormodid	mark recolor=-1
     33 	":"		consym		buffer recolor=-1
     34 	"!#$%&*+./<=>?@\\^|~" varsym	buffer recolor=-1
     35 	"-"		dashorvarsym	mark buffer recolor=-1
     36 	"(),;[]`}"	special		recolor=-1
     37 	"{"		specialorncomment recolor=-1
     38 	"0-9"		integerstart	mark noeat
     39 	"\'"		charlit		recolor=-1
     40 	"\""		strlit		recolor=-1
     41 	
     42 :special Special
     43 	*		reset		noeat
     44 	
     45 :specialorncomment Special
     46 	*		reset		noeat
     47 	"-"		ncommentstart	recolor=-2
     48 	
     49 :ncommentstart Comment comment
     50 	*		reset		noeat call=.comment()
     51 	"#"		pragma		recolor=-3
     52 
     53 .subr comment
     54 
     55 :ncomment Comment comment
     56 	*		ncomment
     57 	"BFHNTX"	ncomment	noeat call=comment_todo.comment_todo()
     58 	"-"		ncommentmaybeend
     59 	"{"		ncommentmaybenest
     60 
     61 :ncommentmaybeend Comment comment
     62 	*		ncomment	noeat
     63 	"}"		ncomment	return
     64 
     65 :ncommentmaybenest Comment comment
     66 	*		ncomment	noeat
     67 	"-"		ncomment	call=.comment()
     68 
     69 .end
     70 
     71 :pragma Pragma
     72 	*		pragma
     73 	"#"		pragmamaybeend1
     74 	"-"		pragmamaybebadend
     75 
     76 :pragmamaybeend1 Pragma
     77 	*		pragma		noeat
     78 	"-"		pragmamaybeend2
     79 	
     80 :pragmamaybeend2 Pragma
     81 	*		pragma		noeat
     82 	"}"		reset
     83 	
     84 :pragmamaybebadend Bad
     85 	*		pragma		noeat
     86 	"}"		errorstate	recolor=-2
     87 	
     88 :errorstate Bad
     89 	*		reset
     90 
     91 :conormodid ConId
     92 	*		reset		noeat
     93 	"."		probablymodid	recolor=-1
     94 	"a-zA-Z0-9'_"	conormodid
     95 	
     96 # give it color varid to color the dot in case it is *not* a modid in the
     97 # right color
     98 :probablymodid VarSym
     99 	*		ismodid		noeat recolormark recolor=-1
    100 	" \t\r\n\v\f"	reset
    101 	
    102 :ismodid ModId
    103 	*		reset		noeat
    104 
    105 :varid VarId
    106 	*		reset		noeat strings
    107 	"case"		stmt
    108 	"class"		struct
    109 	"data"		struct
    110 	"default"	struct
    111 	"deriving"	struct
    112 	"do"		stmt
    113 	"else"		cond
    114 	"if"		cond
    115 	"import"	kw
    116 	"infix"		struct
    117 	"infixl"	struct
    118 	"infixr"	struct
    119 	"instance"	struct
    120 	"let"		stmt
    121 	"module"	struct
    122 	"newtype"	kw
    123 	"of"		stmt
    124 	"then"		cond
    125 	"type"		kw
    126 	"where"		struct
    127 	"_"		kw
    128 done
    129 	"a-zA-Z0-9_'"	varid
    130 
    131 :kw Keyword
    132 	*		reset		noeat
    133 
    134 :cond Conditional
    135 	*		reset		noeat
    136 
    137 :struct Structure
    138 	*		reset		noeat
    139 
    140 :stmt Statement
    141 	*		reset		noeat
    142 
    143 :consym ConId
    144 	*		reset		noeat strings
    145 	":"		kw
    146 	"::"		kw
    147 done
    148 	"-!#$%&*+./<=>?@\\^|~:" consym
    149 
    150 :varsym VarSym
    151 	*		reset		noeat strings
    152 	".."		kw
    153 	"="		kw
    154 	"\\"		kw
    155 	"|"		kw
    156 	"<-"		kw
    157 	"->"		kw
    158 	"@"		kw
    159 	"~"		kw
    160 done
    161 	"-!#$%&*+./<=>?@\\^|~:" varsym
    162 
    163 :dashorvarsym VarSym
    164 	*		varsym		noeat
    165 	"-"		dashdash	hold
    166 	
    167 :dashdash VarSym
    168 	*		linecomment	recolormark noeat
    169 	"!#$%&*+./<=>?@\\^|~:" varsym
    170 	"-" 		dashdash
    171 	
    172 :linecomment Comment comment
    173 	*		linecomment
    174 	"BFHNTX"	linecomment	noeat call=comment_todo.comment_todo()
    175 	"\n"		reset
    176 
    177 :integerstart DecNumber
    178 	*		decnum
    179 	"0"		intdispatch
    180 
    181 :decnum DecNumber
    182 	*		reset		noeat
    183 	"."		floatmaybemant
    184 	"e"		floatexponentstart
    185 	"0-9"		decnum
    186 	
    187 :intdispatch DecNumber
    188 	*		decnum		noeat
    189 	"oO"		octstart
    190 	"xX"		hexstart
    191 
    192 # Catch "0o " which is "integer 0" "symbol o" "whitespace"
    193 # and "0oo" which is "integer 0" "symbol oo"
    194 :octstart OctNumber
    195 	*		varid		noeat recolor=-2
    196 	"0-7"		octint		recolor=-3
    197 
    198 # Catch "0o08" which is "(octal) integer 0" "integer 8"
    199 :octint OctNumber
    200 	*		reset		noeat
    201 	"0-7"		octint
    202 
    203 :hexstart HexNumber
    204 	*		varid		noeat recolor=-2
    205 	"0-9a-fA-F"	hexint		recolor=-3
    206 
    207 :hexint HexNumber
    208 	*		reset		noeat
    209 	"0-9a-fA-F"	hexint
    210 
    211 # default jumps to varsym because the dot that sent us here is the first
    212 # char of a symbol.
    213 :floatmaybemant FloatNumber
    214 	*		varsym		noeat recolor=-2
    215 	"0-9"		floatmantissa	recolormark
    216 
    217 :floatmantissa FloatNumber
    218 	*		reset		noeat
    219 	"0-9"		floatmantissa
    220 	"eE"		floatexponentstart
    221 
    222 # after an 'e'
    223 # default jump is for identifiers starting with e directly pasted to a
    224 # number
    225 # recolormark is needed in the case we got here from decnum
    226 :floatexponentstart FloatNumber
    227 	*		varid		noeat recolor=-2
    228 	"+-"		floatexponentstart2
    229 	"0-9"		floatexponent	recolormark
    230 
    231 # in case of non-digit:
    232 # the e is a one-char-identifier, the + or - is the start of a symbol
    233 :floatexponentstart2 FloatNumber
    234 	*		unrollfloat	noeat recolor=-3
    235 	"0-9"		floatexponent	recolormark
    236 
    237 :floatexponent FloatNumber
    238 	*		reset		noeat
    239 	"0-9"		floatexponent
    240 
    241 # the error is just for testing...
    242 :unrollfloat VarId
    243 	*		varsym		noeat recolor=-2
    244 
    245 :charlit Character string
    246 	*		charlitend
    247 	"\n"		errorstate	noeat recolor=-2
    248 	"\'"		errorstate	noeat recolor=-2
    249 	"\\"		escape_charlit	mark recolor=-1
    250 
    251 :charlitend Character string
    252 	*		charliterror	noeat
    253 	"\'"		reset
    254 
    255 :escape_charlit CharacterEscape string
    256 	*		charliterror	recolor=-2
    257 	"0-9"		escdecchar
    258 	"o"		escoctcharstart
    259 	"x"		eschexcharstart
    260 	"abfnrtv\\\"\'"	charlitend
    261 	"A-Z"		escasciichar	buffer
    262 	"^"		escasciictrlchar
    263 
    264 :escoctcharstart CharacterEscape string
    265 	*		charliterror	recolor=-3 noeat
    266 	"0-7"		escoctchar
    267 
    268 :escoctchar CharacterEscape string
    269 	*		charlitend	noeat
    270 	"0-7"		escoctchar
    271 
    272 :escdecchar CharacterEscape string
    273 	*		charlitend	noeat
    274 	"0-9"		escdecchar
    275 
    276 :eschexcharstart CharacterEscape string
    277 	*		charliterror	recolor=-3 noeat
    278 	"0-9a-fA-F"	eschexchar
    279 
    280 :eschexchar CharacterEscape string
    281 	*		charlitend	noeat
    282 	"0-9a-fA-F"	eschexchar
    283 
    284 :escascnotfoundchar CharacterEscape string
    285 	*		charliterror	recolormark noeat
    286 	"A-Z"		escasciichar
    287 
    288 :escasciichar CharacterEscape string
    289 	*		charliterror	recolormark
    290 	"A-Z'"		escascnotfoundchar noeat	strings
    291 	"NUL"		asciidonechar
    292 	"STX"		asciidonechar
    293 	"ETX"		asciidonechar
    294 	"EOT"		asciidonechar
    295 	"ENQ"		asciidonechar
    296 	"ACK"		asciidonechar
    297 	"BEL"		asciidonechar
    298 	"BS"		asciidonechar
    299 	"HT"		asciidonechar
    300 	"LF"		asciidonechar
    301 	"VT"		asciidonechar
    302 	"FF"		asciidonechar
    303 	"CR"		asciidonechar
    304 	"SO"		asciiSOchar
    305 	"SI"		asciidonechar
    306 	"DLE"		asciidonechar
    307 	"DC1"		asciidonechar
    308 	"DC2"		asciidonechar
    309 	"DC3"		asciidonechar
    310 	"DC4"		asciidonechar
    311 	"NAK"		asciidonechar
    312 	"SYN"		asciidonechar
    313 	"ETB"		asciidonechar
    314 	"CAN"		asciidonechar
    315 	"EM"		asciidonechar
    316 	"SUB"		asciidonechar
    317 	"ESC"		asciidonechar
    318 	"FS"		asciidonechar
    319 	"GS"		asciidonechar
    320 	"RS"		asciidonechar
    321 	"US"		asciidonechar
    322 	"SP"		asciidonechar
    323 	"DEL"		asciidonechar
    324 done
    325 
    326 :asciiSOchar CharacterEscape string
    327 	*		charliterror	recolormark
    328 	"'"		charlitend	noeat
    329 	"H"		charlitend
    330 
    331 :escasciictrlchar CharacterEscape string
    332 	*		charliterror	noeat recolor=-3
    333 	"A-Z@[\\]^_"	charlitend
    334 
    335 :asciidonechar CharacterEscape string
    336 	*		charlitend noeat
    337 
    338 :charliterror Bad
    339 	*		charliterror
    340 	"\'"		charlitend	noeat
    341 
    342 # now for string literals
    343 
    344 :strlit String string
    345 	*		strlit
    346 	"\""		reset
    347 	"\n"		errorstate	noeat recolor=-2
    348 	"\\"		escape_strlit	mark recolor=-1
    349 
    350 :escape_strlit StringEscape string
    351 	*		strliterror	recolor=-2
    352 	"0-9"		escdecstr
    353 	"o"		escoctstrstart
    354 	"x"		eschexstrstart
    355 	"abfnrtv\\\"\'&"	strlit
    356 	"A-Z"		escasciistr	buffer
    357 	"^"		escasciictrlstr
    358 	" \t\n\r\v"	stringgap	recolor=-2
    359 
    360 :escoctstrstart StringEscape string
    361 	*		strliterror	recolor=-3 noeat
    362 	"0-7"		escoctstr
    363 
    364 :escoctstr StringEscape string
    365 	*		strlit	noeat
    366 	"0-7"		escoctstr
    367 
    368 :escdecstr StringEscape string
    369 	*		strlit	noeat
    370 	"0-9"		escdecstr
    371 
    372 :eschexstrstart StringEscape string
    373 	*		strliterror	recolor=-3 noeat
    374 	"0-9a-fA-F"	eschexstr
    375 
    376 :eschexstr StringEscape string
    377 	*		strlit		noeat
    378 	"0-9a-fA-F"	eschexstr
    379 
    380 :escascnotfoundstr StringEscape string
    381 	*		strliterror	recolormark noeat
    382 	"A-Z"		escasciistr
    383 
    384 :escasciistr StringEscape string
    385 	*		strliterror	noeat recolormark
    386 	"A-Z\""		escascnotfoundstr noeat	strings
    387 	"NUL"		asciidonestr
    388 	"STX"		asciidonestr
    389 	"ETX"		asciidonestr
    390 	"EOT"		asciidonestr
    391 	"ENQ"		asciidonestr
    392 	"ACK"		asciidonestr
    393 	"BEL"		asciidonestr
    394 	"BS"		asciidonestr
    395 	"HT"		asciidonestr
    396 	"LF"		asciidonestr
    397 	"VT"		asciidonestr
    398 	"FF"		asciidonestr
    399 	"CR"		asciidonestr
    400 	"SO"		asciiSOstr
    401 	"SI"		asciidonestr
    402 	"DLE"		asciidonestr
    403 	"DC1"		asciidonestr
    404 	"DC2"		asciidonestr
    405 	"DC3"		asciidonestr
    406 	"DC4"		asciidonestr
    407 	"NAK"		asciidonestr
    408 	"SYN"		asciidonestr
    409 	"ETB"		asciidonestr
    410 	"CAN"		asciidonestr
    411 	"EM"		asciidonestr
    412 	"SUB"		asciidonestr
    413 	"ESC"		asciidonestr
    414 	"FS"		asciidonestr
    415 	"GS"		asciidonestr
    416 	"RS"		asciidonestr
    417 	"US"		asciidonestr
    418 	"SP"		asciidonestr
    419 	"DEL"		asciidonestr
    420 done
    421 
    422 :asciiSOstr StringEscape string
    423 	*		strlit		noeat
    424 	"H"		strlit
    425 
    426 :escasciictrlstr StringEscape string
    427 	*		strliterror	noeat recolor=-3
    428 	"A-Z@[\\]^_"	strlit
    429 
    430 :asciidonestr StringEscape string
    431 	*		strlit		noeat
    432 
    433 :stringgap StringGap string
    434 	*		strgaperror	recolor=-1
    435 	"\\"		strlit
    436 	" \n\r\t\v"	stringgap
    437 
    438 :strgaperror Bad
    439 	*		strgaperror
    440 	"\\"		strlit		
    441 	"\""		reset
    442 
    443 :strliterror Bad
    444 	*		strlit		noeat
    445