dotfiles

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

rust.jsf (4768B)


      1 # JOE syntax highlight file for Rust
      2 
      3 =Idle
      4 =Comment	green
      5 =Shebang	yellow
      6 =Constant	cyan
      7 =Escape		bold cyan
      8 =Operator	bold
      9 =Keyword	bold
     10 =Bad		bold red
     11 =Var		yellow
     12 =Brace		magenta
     13 
     14 =ProcArg	#yellow
     15 =ClassMember	yellow #fg_310 # brown
     16 =GlobalVar	#yellow
     17 =ClassDecl	bold blue
     18 
     19 :pre_idle Idle
     20 	*		NULL		noeat call=.rust()
     21 
     22 .subr rust
     23 
     24 # #! allowed on first line
     25 
     26 :idle Idle
     27 	*		idle
     28 	"{}"		brace		recolor=-1
     29 	"0"		zero		recolor=-1
     30 	"1-9"		decimal		recolor=-1
     31 	"."		decimal_point	recolor=-1
     32 	"\""		string		recolor=-1
     33 	"'"		char		recolor=-1
     34 	"/"		slash		recolor=-1
     35 	"\i"		ident		buffer
     36 	"b"		maybe_byte_string	buffer
     37 	"r"		maybe_raw_string	buffer
     38 
     39 :maybe_byte_string Idle
     40 	*		ident		noeat
     41 	"'"		char		recolor=-2
     42 	"\""		string		recolor=-2
     43 	"r"		maybe_byte_raw_string
     44 
     45 :maybe_raw_string Idle
     46 	*		ident		noeat
     47 	"#"		should_be_raw_string	recolor=-2
     48 
     49 :maybe_byte_raw_string Idle
     50 	*		ident		noeat
     51 	"#"		should_be_raw_string	recolor=-3
     52 
     53 :slash Constant
     54 	*		idle		noeat
     55 	"*"		comment			recolor=-2
     56 	"/"		line_comment	recolor=-2
     57 
     58 :brace Brace
     59 	*		idle		noeat
     60 
     61 :comment Comment
     62 	*		comment
     63 	"*"		maybe_end_comment
     64 
     65 :maybe_end_comment Comment
     66 	*		comment
     67 	"/"		idle
     68 	"*"		maybe_end_comment
     69 
     70 :line_comment Comment
     71 	*		line_comment
     72 	"\n"		idle
     73 
     74 # Numbers
     75 
     76 :bad_number Bad
     77 	*		idle	noeat
     78 	"0-9"		bad_number
     79 
     80 :zero Constant
     81 	*		idle	noeat
     82 	"b"		binary
     83 	"o"		octal
     84 	"x"		hex
     85 	"."		float
     86 	"eE"		epart
     87 	"0-9"		decimal	recolor=-1
     88 	"ui"		int_suffix
     89 	"f"		float_suffix
     90 
     91 :decimal_point Constant
     92 	*		idle	noeat	recolor=-2
     93 	"0-9"		float
     94 
     95 :octal Constant
     96 	*		idle	noeat
     97 	"0-7_"		octal
     98 	"89"		bad_number	recolor=-1
     99 	"ui"		int_suffix
    100 
    101 :binary Constant
    102 	*		idle	noeat
    103 	"01_"		binary
    104 	"2-9"		bad_number	recolor=-1
    105 	"ui"		int_suffix
    106 
    107 :hex Constant
    108 	*		idle	noeat
    109 	"0-9A-Fa-f_"	hex
    110 	"ui"		int_suffix
    111 
    112 :decimal Constant
    113 	*		idle	noeat
    114 	"0-9_"		decimal
    115 	"eE"		epart
    116 	"."		float
    117 	"ui"		int_suffix
    118 	"f"		float_suffix
    119 
    120 :float Constant
    121 	*		idle	noeat
    122 	"eE"		epart
    123 	"0-9_"		float
    124 	"ui"		int_suffix
    125 	"f"		float_suffix
    126 
    127 :epart Constant
    128 	*		idle	noeat
    129 	"0-9+\-"	enum
    130 
    131 :enum Constant
    132 	*		idle	noeat
    133 	"0-9_"		enum
    134 	"ui"		int_suffix
    135 	"f"		float_suffix
    136 
    137 :float_suffix Constant
    138 	*		bad_number	noeat	recolor=-1
    139 	"3"		float_suffix_1
    140 	"6"		float_suffix_2
    141 
    142 :float_suffix_1 Constant
    143 	*		bad_number	noeat	recolor=-1
    144 	"2"		idle
    145 
    146 :float_suffix_2 Constant
    147 	*		bad_number	noeat	recolor=-1
    148 	"4"		idle
    149 
    150 :int_suffix Constant
    151 	*		bad_number	noeat	recolor=-1
    152 	"3"		int_suffix_1
    153 	"6"		int_suffix_2
    154 	"s"		int_suffix_3
    155 
    156 :int_suffix_1 Constant
    157 	*		bad_number	noeat	recolor=-1
    158 	"2"		idle
    159 
    160 :int_suffix_2 Constant
    161 	*		bad_number	noeat	recolor=-1
    162 	"4"		idle
    163 
    164 :int_suffix_3 Constant
    165 	*		bad_number	noeat	recolor=-2
    166 	"i"		int_suffix_4
    167 
    168 :int_suffix_4 Constant
    169 	*		bad_number	noeat	recolor=-3
    170 	"z"		int_suffix_5
    171 
    172 :int_suffix_5 Constant
    173 	*		bad_number	noeat	recolor=-4
    174 	"e"		idle
    175 
    176 # strings like #"hello"#
    177 
    178 :should_be_raw_string Constant
    179 	*		idle	noeat
    180 	"\""		raw_string
    181 
    182 :raw_string Constant
    183 	*		raw_string
    184 	"\""		raw_string_maybe_done
    185 
    186 :raw_string_maybe_done Constant
    187 	*		raw_string	noeat
    188 	"#"		idle
    189 
    190 # strings like "hello"
    191 
    192 :string	Constant
    193 	*		string
    194 	"\""		idle
    195 	"\\"		string_escape	recolor=-1
    196 
    197 :string_escape Escape
    198 	*		string
    199 	"x"		string_hex2
    200 	"u"		string_maybe_uni
    201 
    202 :string_maybe_uni Escape
    203 	*		string		noeat
    204 	"{"		string_uni
    205 
    206 :string_uni Escape
    207 	*		string_uni
    208 	"}"		string
    209 
    210 :string_hex2 Escape
    211 	*		string		noeat
    212 	"0-9a-fA-F"	string_hex1
    213 
    214 :string_hex1 Escape
    215 	*		string		noeat
    216 	"0-9a-fA-F"	string
    217 
    218 # character constants like 'h'
    219 
    220 :char	Constant
    221 	*		char_done
    222 	"\\"		char_escape	recolor=-1
    223 
    224 :char_done Constant
    225 	*		idle		noeat recolor=-3
    226 	"\'"		idle
    227 
    228 :char_escape Escape
    229 	*		char_done	noeat
    230 	"x"		char_hex2
    231 	"u"		char_maybe_uni
    232 
    233 :char_maybe_uni Escape
    234 	*		char_done	noeat
    235 	"{"		char_uni
    236 
    237 :char_uni Escape
    238 	*		char_uni
    239 	"}"		char_done
    240 
    241 :char_hex2 Escape
    242 	*		char_done	noeat
    243 	"0-9a-fA-F"	char_hex1
    244 
    245 :char_hex1 Escape
    246 	*		char_done	noeat
    247 	"0-9a-fA-F"	char
    248 
    249 # Identifiers
    250 
    251 :ident Idle
    252 	*		idle	noeat strings
    253 	"abstract"	kw
    254 	"alignof"	kw
    255 	"as"		operator
    256 	"become"	kw
    257 	"box"		kw
    258 	"break"		kw
    259 	"const"		kw
    260 	"continue"	kw
    261 	"crate"		kw
    262 	"do"		kw
    263 	"else"		kw
    264 	"enum"		kw
    265 	"extern"	kw
    266 	"false"		lit
    267 	"final"		kw
    268 	"fn"		kw
    269 	"for"		kw
    270 	"if"		kw
    271 	"impl"		kw
    272 	"in"		operator
    273 	"let"		kw
    274 	"loop"		kw
    275 	"macro"		kw
    276 	"match"		kw
    277 	"mod"		kw
    278 	"move"		kw
    279 	"mut"		kw
    280 	"offsetof"	kw
    281 	"override"	kw
    282 	"priv"		kw
    283 	"proc"		kw
    284 	"pub"		kw
    285 	"pure"		kw
    286 	"ref"		kw
    287 	"return"	kw
    288 	"Self"		kw
    289 	"self"		kw
    290 	"sizeof"	kw
    291 	"static"	kw
    292 	"struct"	kw
    293 	"super"		kw
    294 	"trait"		kw
    295 	"true"		lit
    296 	"type"		kw
    297 	"typeof"	kw
    298 	"unsafe"	kw
    299 	"unsized"	kw
    300 	"use"		kw
    301 	"virtual"	kw
    302 	"where"		kw
    303 	"while"		kw
    304 	"yield"		kw
    305 done
    306 	"\c"	ident
    307 
    308 :kw Keyword
    309 	*		idle		noeat
    310 
    311 :lit Constant
    312 	*		idle		noeat
    313 
    314 :operator Operator
    315 	*		idle		noeat
    316 
    317 :global_var GlobalVar
    318 	*		idle		noeat
    319 	"\c"		global_var
    320 
    321 .end