dotfiles

My dotfiles.
git clone git://git.ryanmj.xyz/dotfiles.git
Log | Files | Refs | LICENSE

js.jsf.in (12062B)


      1 # JOE syntax highlight file for JavaScript
      2 # by Christian Nicolai (http://mycrobase.de) and Rebecca Turner
      3 
      4 # Define colors
      5 
      6 =Idle
      7 =Comment	green
      8 =Constant	cyan
      9 =String		cyan
     10 =StringEscape	bold cyan
     11 =Regexp		cyan
     12 =RegexpEscape	bold cyan
     13 =RegexpOptions	cyan
     14 =Number		cyan
     15 =Type		bold
     16 =CustomType
     17 =Keyword	bold
     18 =Global		bold
     19 =Exports
     20 =ExportItem
     21 =Operator	bold
     22 =Bad		inverse bold red
     23 =Brace		magenta
     24 =Assign		bold
     25 =Paren
     26 =Bracket
     27 =Semicolon
     28 =Comma
     29 =PropSep
     30 =Syntax
     31 =Ident
     32 =Method
     33 
     34 # from html.jsf to support embedded languages
     35 =TagEdge	green
     36 
     37 :begin Idle
     38 	*			begin		noeat call=.js()
     39 	"#"			shebang		recolor=-1
     40 
     41 :shebang Comment
     42 	*			shebang
     43 	"\n"			begin
     44 
     45 .subr js
     46 
     47 :idle Idle
     48 	*			idle
     49 	"/"			re_or_comment	recolor=-1
     50 	"0"			first_digit	recolor=-1
     51 	"1-9"			decimal		recolor=-1
     52 	"."			maybe_float
     53 	"\""			after_term	call=.string() recolor=-1 save_c
     54 	"'"			after_term	call=.string() recolor=-1 save_c
     55 	"`"			after_term	call=.string(template) recolor=-1
     56 	"A-Z"			type_match	mark buffer recolor=-1
     57 	"$a-z_"			ident		mark buffer recolor=-1
     58 	"{}"			brace		recolor=-1
     59 	"()"			paren		noeat recolor=-1
     60 	";"			semicolon	recolor=-1
     61 	","			comma		recolor=-1
     62 	"="			assign_maybe	recolor=-1
     63 	"[]"			bracket		noeat recolor=-1
     64 	"\-"			subtract	recolor=-1
     65 	"+"			add		recolor=-1
     66 	"*|&^%"			mutate_maybe	recolor=-1
     67 	":?~"			syntax		recolor=-1
     68 .ifdef html
     69 	"<"			maybe_done	recolor=-1
     70 	">!"			eqmixer_maybe	recolor=-1
     71 .else
     72 .ifdef php
     73 	"<"			maybe_done	recolor=-1
     74 	">!"			eqmixer_maybe	recolor=-1
     75 .else
     76 .ifdef mason
     77 	"<"			maybe_done	recolor=-1
     78 	">!"			eqmixer_maybe	recolor=-1
     79 .else
     80 	"<>!"			eqmixer_maybe	recolor=-1
     81 .endif
     82 .endif
     83 .endif
     84 
     85 :subtract Assign
     86 	*			mutate_maybe	noeat
     87 	"\-"			assign		recolor=-2
     88 
     89 :add Assign
     90 	*			mutate_maybe	noeat
     91 	"+"			assign		recolor=-2
     92 
     93 :mutate_maybe Assign
     94 	*			syntax		recolor=-2 noeat
     95 	"="			assign		recolor=-2
     96 
     97 :syntax Syntax
     98 	*			idle		recolor=-1 noeat
     99 
    100 :assign Assign
    101 	*			idle		recolor=-1 noeat
    102 
    103 :eqmixer_maybe Syntax
    104 	*			idle		recolor=-1 noeat
    105 	"="			eqmixer_maybe
    106 
    107 :assign_maybe Assign
    108 	*			idle            recolor=-1 noeat
    109 	"="			equality	recolor=-2
    110 
    111 :equality Syntax
    112 	*			idle		recolor=-1 noeat
    113 	"="			syntax
    114 
    115 :maybe_done TagEdge
    116 	*			eqmixer_maybe	noeat
    117 	"/"			idle		noeat return recolor=-2
    118 .ifdef php
    119 	"?"			rtn_embed	call=php.php()
    120 .endif
    121 .ifdef mason
    122 	"&%"			rtn_embed	call=perl.perl()
    123 .endif
    124 
    125 :rtn_embed TagEdge
    126 	*			idle		noeat
    127 
    128 :no_regex Idle
    129 	*			idle		noeat
    130 	"/"			maybe_comment	recolor=-1
    131 	" "			no_regex
    132 
    133 :after_term Idle
    134 	*			after_term
    135 	"\n"			idle
    136 	"/"			maybe_comment	recolor=-1
    137 	"."			prop_sep	recolor=-1
    138 .ifdef typescript
    139 	"\"'A-Za-z_0-9"		idle		noeat
    140 .else
    141 	"a-z"			infix_operator	buffer recolor=-1
    142 	"\"'A-Z_0-9"		bad_after_term	recolor=-1
    143 .endif
    144 	"{}"			brace		recolor=-1
    145 	"()"			paren		noeat recolor=-1
    146 	";"			semicolon	recolor=-1
    147 	"="			assign_maybe	recolor=-1
    148 	","			comma		recolor=-1
    149 	"[]"			bracket		noeat recolor=-1
    150 	"\-"			subtract	recolor=-1
    151 	"+"			add		recolor=-1
    152 	"*|&^%"			mutate_maybe	recolor=-1
    153 	":?~"			syntax		recolor=-1
    154 .ifdef html
    155 	"<"			maybe_done	recolor=-1
    156 	">!"			eqmixer_maybe	recolor=-1
    157 .else
    158 .ifdef php
    159 	"<"			maybe_done	recolor=-1
    160 	">!"			eqmixer_maybe	recolor=-1
    161 .else
    162 .ifdef mason
    163 	"<"			maybe_done	recolor=-1
    164 	">!"			eqmixer_maybe	recolor=-1
    165 .else
    166 	"<>!"			eqmixer_maybe	recolor=-1
    167 .endif
    168 .endif
    169 .endif
    170 
    171 :ident_only Idle
    172 	*			bad_after_term	recolor=-1
    173 	"A-Z"			type_match	mark buffer recolor=-1
    174 	"$a-z_"			ident		mark buffer recolor=-1
    175 	" \t"			ident_only
    176 	"\n"			idle
    177 
    178 :bad_after_term Bad
    179 	*			after_term	noeat markend strings
    180 done
    181 	"\"'"			after_term
    182 	"a-zA-Z0-9_."		bad_after_term
    183 
    184 :re_or_comment Syntax
    185 	*			regex		noeat recolor=-2
    186 	"*/"			maybe_comment	noeat
    187 
    188 :maybe_comment Syntax
    189 	*			syntax		noeat
    190 	"*"			comment		recolor=-2
    191 	"/"			line_comment	recolor=-2
    192 	"="			assign		recolor=-2
    193 
    194 :comment Comment
    195 	*			comment
    196 	# might be TODO label
    197 	"BFHNTX"		comment		noeat call=comment_todo.comment_todo()
    198 	"*"			maybe_end_comment
    199 
    200 :maybe_end_comment Comment
    201 	*			comment		noeat
    202 	"/"			idle
    203 	"*"			maybe_end_comment
    204 
    205 :line_comment Comment
    206 	*			line_comment
    207 	# might be TODO label
    208 	"BFHNTX"		line_comment	noeat call=comment_todo.comment_todo()
    209 	"\n"			idle
    210 
    211 :regex Regexp
    212 	*			regex
    213 	"\\"			regex_quote	recolor=-1
    214 	"["			regex_charclass
    215 	"/"			regex_mod
    216 	"\n"			regex_bad
    217 
    218 :regex_quote RegexpEscape
    219 	*			regex
    220 	"\n"			regex_bad
    221 
    222 :regex_charclass Regexp
    223 	*			regex_charclass
    224 	"\\"			regex_cc_quote	recolor=-1
    225 	"\n"			regex_bad_cc
    226 	"]"			regex
    227 
    228 :regex_cc_quote RegexpEscape
    229 	*			regex_charclass
    230 	"\n"			regex_bad_cc
    231 
    232 :regex_bad Bad
    233 	*			regex_bad
    234 	"\\"			regex_bad_quote
    235 	"["			regex_bad_cc
    236 	"/"			after_term
    237 
    238 :regex_bad_quote Bad
    239 	*			regex_bad
    240 
    241 :regex_bad_cc Bad
    242 	*			regex_bad_cc
    243 	"\\"			regex_bad_quote_cc
    244 	"]"			regex_bad
    245 
    246 :regex_bad_quote_cc Bad
    247 	*			regex_bad_cc
    248 
    249 :regex_mod RegexpOptions
    250 	*			after_term	noeat
    251 	"igm"			regex_mod
    252 
    253 :brace Brace
    254 	*			idle		noeat
    255 
    256 :paren Paren
    257 	"("			idle
    258 	")"			no_regex
    259 
    260 :bracket Bracket
    261 	"["			idle
    262 	"]"			after_term
    263 
    264 :syntax Syntax
    265 	*			idle		noeat
    266 
    267 :comma Comma
    268 	*			idle		noeat
    269 
    270 :semicolon Semicolon
    271 	*			idle		noeat
    272 
    273 :first_digit Number
    274 	*			after_term	noeat
    275 	"xX"			hex
    276 	"."			float
    277 	"eE"			epart
    278 	"0-7"			octal
    279 	"89"			bad_number	recolor=-1
    280 
    281 :bad_number Bad
    282 	*			after_term	noeat
    283 	"0-9"			bad_number
    284 
    285 :octal Number
    286 	*			after_term	noeat
    287 	"0-7"			octal
    288 	"89"			bad_number	recolor=-1
    289 
    290 :hex Number
    291 	*			after_term	noeat
    292 	"0-9A-Fa-f"		hex
    293 
    294 :decimal Number
    295 	*			after_term	noeat
    296 	"0-9"			decimal
    297 	"eE"			epart
    298 	"."			float
    299 
    300 :maybe_float Number
    301 	*			prop_sep	noeat recolor=-2
    302 .ifdef typescript
    303 	"."			ellipsis	recolor=-2
    304 .endif
    305 	"0-9"			float		recolor=-2
    306 
    307 :prop_sep PropSep
    308 	*			ident_only	noeat
    309 
    310 :float Number
    311 	*			after_term	noeat
    312 	"eE"			epart
    313 	"0-9"			float
    314 
    315 :epart Number
    316 	*			after_term	noeat
    317 	"0-9+\-"		enum
    318 
    319 :enum Number
    320 	*			after_term	noeat
    321 	"0-9"			enum
    322 
    323 :infix_operator Bad
    324 	*			bad_op		noeat markend strings
    325 	"in"			operator
    326 	"instanceof"		operator
    327 	"of"			operator
    328 done
    329 	"a-zA-Z0-9_"		infix_operator
    330 
    331 .ifdef typescript
    332 :ellipsis Idle
    333 	*			bad_after_term	recolor=-3
    334 	"."			ident_only
    335 .endif
    336 
    337 :bad_op Bad
    338 	*			idle		noeat
    339 	"a-zA-Z0-9_"		bad_op
    340 
    341 :operator Operator
    342 	*			idle		noeat
    343 
    344 :type_match CustomType
    345 	*			type_end	noeat markend strings
    346 	"Infinity"		lit
    347 	"NaN"			lit
    348 	"Array"			type
    349 	"ArrayBuffer"		type
    350 	"Boolean"		type
    351 	"DataView"		type
    352 	"Date"			type
    353 	"Error"			type
    354 	"EvalError"		type
    355 	"Function"		type
    356 	"Float32Array"		type
    357 	"Float64Array"		type
    358 	"Int16Array"		type
    359 	"Int32Array"		type
    360 	"Int8Array"		type
    361 	"JSON"			type
    362 	"Math"			type
    363 	"Number"		type
    364 	"Object"		type
    365 	"RangeError"		type
    366 	"ReferenceError"	type
    367 	"RegExp"		type
    368 	"String"		type
    369 	"SyntaxError"		type
    370 	"TypeError"		type
    371 	"Uint16Array"		type
    372 	"Uint32Array"		type
    373 	"Uint8Array"		type
    374 	"Uint8ClampedArray"	type
    375 	"URIError"		type
    376 	# node.js
    377 	"Buffer"		type
    378 done
    379 	"a-zA-Z0-9_"		type_match
    380 
    381 :type_end Idle
    382 	*			after_term	noeat
    383 	" "			type_end
    384 	"."			prop_sep	recolor=-1
    385 
    386 .ifdef typescript
    387 
    388 :ident Ident
    389 	*			ident_end	noeat markend strings
    390 	"delete"		operator
    391 	"in"			operator
    392 	"instanceof"		operator
    393 	"typeof"		operator
    394 	"new"			operator
    395 	"arguments"		kw
    396 	"break"			kw
    397 	"case"			kw
    398 	"catch"			kw
    399 	"continue"		kw
    400 	"default"		kw
    401 	"do"			kw
    402 	"else"			kw
    403 	"finally"		kw
    404 	"for"			kw
    405 	"function"		kw
    406 	"if"			kw
    407 	"let"			kw
    408 	"of"			kw
    409 	"return"		kw
    410 	"switch"		kw
    411 	"throw"			kw
    412 	"try"			kw
    413 	"var"			kw
    414 	"void"			kw
    415 	"while"			kw
    416 	"with"			kw
    417 	"false"			lit
    418 	"null"			lit
    419 	"true"			lit
    420 	"decodeURI"		global
    421 	"decodeURIComponent"	global
    422 	"encodeURI"		global
    423 	"encodeURIComponent"	global
    424 	"escape"		global
    425 	"eval"			global
    426 	"isFinite"		global
    427 	"isNaN"			global
    428 	"parseFloat"		global
    429 	"parseInt"		global
    430 	"undefined"		global
    431 	"unescape"		global
    432 	"setImmediate"		global
    433 	"this"			quasikw
    434 	"prototype"		quasikw
    435 	# node.js
    436 	"exports"		export
    437 	"module"		global
    438 	"process"		global
    439 	"global"		global
    440 	"console"		global
    441 	"setTimeout"		global
    442 	"setInterval"		global
    443 	"clearInterval"		global
    444 	"clearTimeout"		global
    445 	"require"		quasikw
    446 	"__filename"		quasikw
    447 	"__dirname"		quasikw
    448 	"const"			kw
    449 	# By convention...
    450 	"self"			quasikw
    451 
    452 	# Typescript-specific
    453 	"abstract"	kw
    454 	"as"		kw
    455 	"async"		kw
    456 	"await"		kw
    457 	"class"		kw
    458 	"constructor"	kw
    459 	"declare"	kw
    460 	"enum"		kw
    461 	"extends"	kw
    462 	"export"	kw
    463 	"from"		kw
    464 	"get"		kw
    465 	"implements"	kw
    466 	"import"	kw
    467 	"instanceof"	kw
    468 	"interface"	kw
    469 	"is"		kw
    470 	"module"	kw
    471 	"namespace"	kw
    472 	"private"	kw
    473 	"public"	kw
    474 	"require"	kw
    475 	"set"		kw
    476 	"static"	kw
    477 	"super"		kw
    478 	"typeof"	kw
    479 	
    480 	"any"		type
    481 	"boolean"	type
    482 	"number"	type
    483 	"string"	type
    484 
    485 done
    486 	"$a-zA-Z0-9_"		ident
    487 
    488 .else
    489 
    490 :ident Ident
    491 	*			ident_end	noeat markend strings
    492 	"delete"		operator
    493 	"in"			operator
    494 	"instanceof"		operator
    495 	"typeof"		operator
    496 	"new"			operator
    497 	"arguments"		kw
    498 	"break"			kw
    499 	"case"			kw
    500 	"catch"			kw
    501 	"continue"		kw
    502 	"default"		kw
    503 	"do"			kw
    504 	"else"			kw
    505 	"finally"		kw
    506 	"for"			kw
    507 	"function"		kw
    508 	"if"			kw
    509 	"let"			kw
    510 	"of"			kw
    511 	"return"		kw
    512 	"switch"		kw
    513 	"throw"			kw
    514 	"try"			kw
    515 	"var"			kw
    516 	"void"			kw
    517 	"while"			kw
    518 	"with"			kw
    519 	"false"			lit
    520 	"null"			lit
    521 	"true"			lit
    522 	"decodeURI"		global
    523 	"decodeURIComponent"	global
    524 	"encodeURI"		global
    525 	"encodeURIComponent"	global
    526 	"escape"		global
    527 	"eval"			global
    528 	"isFinite"		global
    529 	"isNaN"			global
    530 	"parseFloat"		global
    531 	"parseInt"		global
    532 	"undefined"		global
    533 	"unescape"		global
    534 	"setImmediate"		global
    535 	"this"			quasikw
    536 	"prototype"		quasikw
    537 	# node.js
    538 	"exports"		export
    539 	"module"		global
    540 	"process"		global
    541 	"global"		global
    542 	"console"		global
    543 	"setTimeout"		global
    544 	"setInterval"		global
    545 	"clearInterval"		global
    546 	"clearTimeout"		global
    547 	"require"		quasikw
    548 	"__filename"		quasikw
    549 	"__dirname"		quasikw
    550 	"const"			kw
    551 	# By convention...
    552 	"self"			quasikw
    553 done
    554 	"$a-zA-Z0-9_"		ident
    555 
    556 .endif
    557 
    558 :ident_end Idle
    559 	*			after_term	noeat
    560 	" "			ident_end
    561 	"."			prop_sep	recolor=-1
    562 	"("			method_start	recolor=-1
    563 
    564 :method_start Paren
    565 	*			method_end	noeat recolormark
    566 
    567 :method_end Method
    568 	*			idle		noeat
    569 
    570 :type Type
    571 	*			after_term	noeat
    572 
    573 :kw Keyword
    574 	*			idle	noeat
    575 
    576 :quasikw Keyword
    577 	*			after_term	noeat
    578 
    579 :global Global
    580 	*			after_term	noeat
    581 
    582 :export Exports
    583 	*			export_end	noeat
    584 
    585 :export_end Exports
    586 	*			after_term	noeat
    587 	" "			export_end
    588 	"."			export_item_start
    589 
    590 :export_item_start ExportItem
    591 	*			bad_after_term	recolor=-1 noeat
    592 	" "			export_item_start
    593 	"a-zA-Z_"		export_item
    594 
    595 :export_item ExportItem
    596 	*			after_term	noeat
    597 	"a-zA-Z0-9_"		export_item
    598 
    599 :lit Constant
    600 	*			lit_end		noeat
    601 
    602 :lit_end Constant
    603 	*			after_term	noeat
    604 	" "			lit_end
    605 	"."			prop_sep	recolor=-1
    606 
    607 .end
    608 
    609 .subr string
    610 
    611 :string		String
    612 	*			string_body	noeat mark
    613 
    614 :string_body	String
    615 	*			string
    616 	"\n"			string_bad
    617 .ifdef template
    618 	"$"			string_template
    619 	"`"			after_term	return		# save_c saves ` as ' (by-design)
    620 .else
    621 	&			after_term	return
    622 .endif
    623 	"\\"			string_escape	recolor=-1
    624 
    625 :string_bad Bad
    626 	*			string_bad
    627 	"\\"			string_bad_escape
    628 .ifdef template
    629 	"`"			after_term	return
    630 .else
    631 	&			after_term	return
    632 .endif
    633 
    634 :string_bad_escape Bad
    635 	*			string_bad
    636 
    637 :string_template StringEscape
    638 	*			string_bad
    639 	"{"			string_template_expr
    640 
    641 :string_template_expr Type
    642 	*			string_template_expr
    643 .ifdef template
    644 	"`"			string_body		noeat
    645 .else
    646 	&			string_body		noeat
    647 .endif
    648 	"}"			string_template_end	noeat
    649 
    650 :string_template_end StringEscape
    651 	*			string
    652 
    653 :string_escape StringEscape
    654 	*			string
    655 	"x"			string_hex1
    656 	"u"			string_uni1
    657 	"0-7"			string_octal2
    658 	"\n"			string_bad	noeat
    659 
    660 :string_hex1 StringEscape
    661 	*			string		noeat
    662 	"0-9a-fA-F"		string_hex2
    663 
    664 :string_hex2 StringEscape
    665 	*			string		noeat
    666 	"0-9a-fA-F"		string
    667 
    668 :string_uni1 StringEscape
    669 	*			string		noeat
    670 	"{"			string_uni_brackets
    671 	"0-9a-fA-F"		string_uni2
    672 
    673 :string_uni2 StringEscape
    674 	*			string		noeat
    675 	"0-9a-fA-F"		string_uni3
    676 
    677 :string_uni3 StringEscape
    678 	*			string		noeat
    679 	"0-9a-fA-F"		string_uni4
    680 
    681 :string_uni4 StringEscape
    682 	*			string		noeat
    683 	"0-9a-fA-F"		string
    684 
    685 :string_uni_brackets StringEscape
    686 	*			string_bad_escape	noeat
    687 .ifdef template
    688 	"`"			string			noeat
    689 .else
    690 	&			string			noeat
    691 .endif
    692 	"}"			string
    693 	"0-9a-fA-F"		string_uni_brackets
    694 
    695 :string_octal2 StringEscape
    696 	*			string		noeat
    697 	"0-7"			string_octal3
    698 
    699 :string_octal3 StringEscape
    700 	*			string		noeat
    701 	"0-7"			string
    702 
    703 .end
    704