dotfiles

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

swift.jsf.in (3967B)


      1 # JOE syntax highlight file for Swift
      2 
      3 =Idle
      4 =Comment	green
      5 =Constant	cyan
      6 =Escape		bold cyan
      7 =Operator	bold
      8 =Keyword	bold
      9 =Bad		bold red
     10 =Rsvd
     11 
     12 :pre_idle Idle
     13 	*		NULL		noeat call=.swift()
     14 
     15 .subr swift
     16 
     17 :idle Idle
     18 	*		idle
     19 	"("		idle		call=.swift(paren)
     20 	"["		idle		call=.swift(brack)
     21 	"{"		idle		call=.swift(squiggly)
     22 .ifdef paren
     23 	")"		idle		return
     24 .else
     25 	")"		stray		recolor=-1
     26 .endif
     27 .ifdef brack
     28 	"]"		idle		return
     29 .else
     30 	"]"		stray		recolor=-1
     31 .endif
     32 .ifdef squiggly
     33 	"}"		idle		return
     34 .else
     35 	"}"		stray		recolor=-1
     36 .endif
     37 	"0"		zero		recolor=-1
     38 	"1-9"		decimal		recolor=-1
     39 	"."		decimal_point	recolor=-1
     40 	"\""		string		recolor=-1
     41 	"/"		slash		recolor=-1
     42 	"@$\i"		ident		buffer
     43 
     44 :stray Bad
     45 	*		idle
     46 
     47 # Comments
     48 
     49 :slash Comment
     50 	*		idle		noeat recolor=-2
     51 	"/"		line_comment
     52 	"*"		idle		call=.block_comment()
     53 
     54 :line_comment Comment
     55 	*		line_comment
     56 	"\n"		idle
     57 
     58 # Numbers
     59 
     60 :bad_number Bad
     61 	*		idle	noeat
     62 	"0-9"		bad_number
     63 
     64 :zero Constant
     65 	*		idle	noeat
     66 	"b"		binary
     67 	"o"		octal
     68 	"x"		hex
     69 	"."		maybe_float
     70 	"eE"		epart
     71 	"0-9_"		decimal	recolor=-1
     72 
     73 :decimal_point Constant
     74 	*		idle	noeat	recolor=-2
     75 	"."		decimal_point_1	recolor=-2
     76 	"\i"		not_ident	recolor=-2
     77 	"0-9_"		float
     78 
     79 :not_ident Idle
     80 	*		idle	noeat
     81 	"\c"		not_ident
     82 
     83 :decimal_point_1 Idle
     84 	*		idle		noeat
     85 	"."		idle
     86 
     87 :octal Constant
     88 	*		idle	noeat
     89 	"0-7_"		octal
     90 	"89"		bad_number	recolor=-1
     91 
     92 :binary Constant
     93 	*		idle	noeat
     94 	"01_"		binary
     95 	"2-9"		bad_number	recolor=-1
     96 
     97 :hex Constant
     98 	*		idle	noeat
     99 	"0-9A-Fa-f_"	hex
    100 	"."		hexfloat
    101 	"pP"		ppart
    102 
    103 :hexfloat Constant
    104 	*		idle	noeat
    105 	"0-9A-Fa-f_"	hexfloat
    106 	"pP"		ppart
    107 
    108 :ppart Constant
    109 	*		idle	noeat
    110 	"0-9+\-"	pnum
    111 
    112 :pnum Constant
    113 	*		idle	noeat
    114 	"0-9_"		pnum
    115 
    116 :decimal Constant
    117 	*		idle	noeat
    118 	"0-9_"		decimal
    119 	"eE"		epart
    120 	"."		maybe_float
    121 
    122 :maybe_float Constant
    123 	*		idle	noeat recolor=-2
    124 	"."		decimal_point_1	recolor=-2
    125 	"eE"		epart
    126 	"0-9_"		float
    127 
    128 :float Constant
    129 	*		idle	noeat
    130 	"eE"		epart
    131 	"0-9_"		float
    132 
    133 :epart Constant
    134 	*		idle	noeat
    135 	"0-9+\-"	enum
    136 
    137 :enum Constant
    138 	*		idle	noeat
    139 	"0-9_"		enum
    140 
    141 # Strings
    142 
    143 :string	Constant
    144 	*		string
    145 	"\""		idle
    146 	"\\"		string_escape	recolor=-1
    147 
    148 :string_escape Escape
    149 	*		string
    150 	"("		string	call=.swift(paren)	recolor=-2
    151 	"u"		string_maybe_uni
    152 
    153 :string_maybe_uni Escape
    154 	*		string
    155 	"{"		string_uni
    156 
    157 :string_uni Escape
    158 	*		string_uni
    159 	"}"		string
    160 
    161 # Identifiers
    162 
    163 :ident Idle
    164 	*		idle	noeat strings
    165 	"class"			kw
    166 	"deinit"		kw
    167 	"enum"			kw
    168 	"extension"		kw
    169 	"func"			kw
    170 	"import"		kw
    171 	"init"			kw
    172 	"inout"			kw
    173 	"internal"		kw
    174 	"let"			kw
    175 	"operator"		kw
    176 	"private"		kw
    177 	"protocol"		kw
    178 	"public"		kw
    179 	"static"		kw
    180 	"struct"		kw
    181 	"subscript"		kw
    182 	"typealias"		kw
    183 	"var"			kw
    184 	"break"			kw
    185 	"case"			kw
    186 	"continue"		kw
    187 	"default"		kw
    188 	"defer"			kw
    189 	"do"			kw
    190 	"else"			kw
    191 	"fallthrough"		kw
    192 	"for"			kw
    193 	"guard"			kw
    194 	"if"			kw
    195 	"in"			kw
    196 	"repeat"		kw
    197 	"return"		kw
    198 	"switch"		kw
    199 	"where"			kw
    200 	"while"			kw
    201 	"as"			kw
    202 	"catch"			kw
    203 	"dynamicType"		kw
    204 	"false"			lit
    205 	"is"			kw
    206 	"nil"			lit
    207 	"rethrows"		kw
    208 	"super"			kw
    209 	"self"			kw
    210 	"Self"			kw
    211 	"throw"			kw
    212 	"throws"		kw
    213 	"true"			lit
    214 	"try"			kw
    215 	"__COLUMN__"		kw
    216 	"__FILE__"		kw
    217 	"__FUNCTION__"		kw
    218 	"__LINE__"		kw
    219 	"_"			kw
    220 	"associativity"		rsvd
    221 	"convenience"		rsvd
    222 	"dynamic"		rsvd
    223 	"didSet"		rsvd
    224 	"final"			rsvd
    225 	"get"			rsvd
    226 	"infix"			rsvd
    227 	"indirect"		rsvd
    228 	"lazy"			rsvd
    229 	"left"			rsvd
    230 	"mutating"		rsvd
    231 	"none"			rsvd
    232 	"nonmutating"		rsvd
    233 	"optional"		rsvd
    234 	"override"		rsvd
    235 	"postfix"		rsvd
    236 	"precedence"		rsvd
    237 	"prefix"		rsvd
    238 	"Protocol"		rsvd
    239 	"required"		rsvd
    240 	"right"			rsvd
    241 	"set"			rsvd
    242 	"Type"			rsvd
    243 	"unowned"		rsvd
    244 	"weak"			rsvd
    245 	"willSet"		rsvd
    246 done
    247 	"$\c"	ident
    248 
    249 :kw Keyword
    250 	*		idle			noeat
    251 
    252 :rsvd Rsvd
    253 	*		idle			noeat
    254 
    255 :lit Constant
    256 	*		idle		noeat
    257 
    258 :operator Operator
    259 	*		idle			noeat
    260 
    261 .end
    262 
    263 # Recursive block comments
    264 
    265 .subr block_comment
    266 
    267 :idle Comment
    268 	*		idle
    269 	"*"		maybe_done
    270 	"/"		maybe_recur
    271 
    272 :maybe_done Comment
    273 	*		idle	noeat
    274 	"/"		idle	return
    275 
    276 :maybe_recur Comment
    277 	*		idle	noeat
    278 	"*"		idle	call=.block_comment()
    279 
    280 .end