dotfiles

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

python.jsf.in (4885B)


      1 # JOE syntax highlight file for Python
      2 
      3 =Idle
      4 =Comment 	green
      5 =Docstring	green
      6 =DocstringLabel	bold green
      7 =DocEscape	bold cyan
      8 =Constant 	cyan
      9 =Escape 	bold cyan
     10 =Keyword 	bold
     11 =Bad		bold red
     12 =Brace		magenta
     13 
     14 =PrivateMember	yellow #fg_310 # brown
     15 =Decorator	red
     16 =Declaration	bold blue
     17 
     18 :idle Idle
     19 	*		idle
     20 	"#"		comment		recolor=-1
     21 	"0-9"		first_digit	recolor=-1
     22 	"'\""		string_quot_1	recolor=-1 save_c
     23 	"\i"		ident		noeat
     24 	"{}"		brace		recolor=-1
     25 	"@"		decorator	recolor=-1
     26 
     27 :brace Brace
     28 	*		idle		noeat
     29 
     30 # annotations
     31 :decorator Decorator
     32 	*		decorator
     33 	" (\t\r\n"	idle		noeat
     34 
     35 :comment Comment comment
     36 	*		comment
     37 	# might be TODO label
     38 	"BFHNTX"	comment		noeat call=comment_todo.comment_todo()
     39 	"\n"		idle
     40 
     41 :first_digit Constant
     42 	*		idle		noeat
     43 	"xX"		hex
     44 	"."		float
     45 	"eE"		epart
     46 	"0-9"		first_number
     47 
     48 :hex Constant
     49 	*		idle		noeat
     50 	"0-9A-Fa-f"	hex
     51 
     52 :first_number Constant
     53 	*		idle		noeat
     54 	"0-9"		first_number
     55 	"."		float
     56 
     57 :maybe_float Constant
     58 	*		idle		recolor=-2	noeat
     59 	"0-9"		float		recolor=-2
     60 
     61 :float Constant
     62 	*		idle		noeat
     63 	"eE"		epart
     64 	"0-9"		float
     65 
     66 :epart Constant
     67 	*		idle		noeat
     68 	"0-9+\-"	enum
     69 
     70 :enum Constant
     71 	*		idle		noeat
     72 	"0-9"		enum
     73 
     74 :ident Idle
     75 	*		ident1		noeat buffer
     76 	"_"		priv_member	recolor=-1
     77 
     78 :ident1 Idle
     79 	*		idle		noeat strings
     80 	"and"		kw
     81 	"as"		kw
     82 	"assert"	kw
     83 	"break"		kw
     84 	"class"		declkw
     85 	"continue"	kw
     86 	"def"		declkw
     87 	"del"		kw
     88 	"elif"		kw
     89 	"else"		kw
     90 	"except"	kw
     91 	"exec"		kw
     92 	"finally"	kw
     93 	"for"		kw
     94 	"from"		kw
     95 	"global"	kw
     96 	"if"		kw
     97 	"import"	kw
     98 	"in"		kw
     99 	"is"		kw
    100 	"lambda"	kw
    101 	"not"		kw
    102 	"or"		kw
    103 	"pass"		kw
    104 	"print"		kw
    105 	"raise"		kw
    106 	"return"	kw
    107 	"try"		kw
    108 	"while"		kw
    109 	"with"		kw
    110 	"yield"		kw
    111 	
    112 	# quasi-keywords
    113 	"False"		lit
    114 	"None"		lit
    115 	"True"		lit
    116 done
    117 	"'\""		idle 		noeat istrings
    118 	"u"		string_pre
    119 	"b"		string_pre
    120 	"r"		string_raw_pre
    121 	"br"		string_raw_pre
    122 	"rb"		string_raw_pre
    123 done
    124 	"\c"		ident1
    125 
    126 :kw Keyword
    127 	*		idle		noeat
    128 
    129 :lit Keyword
    130 	*		idle		noeat
    131 
    132 :declkw Keyword
    133 	*		idle 		noeat recolor=-1
    134 	"\i"		declkw
    135 	" \t"		declname_1
    136 
    137 :declname_1 Declaration
    138 	*		declname
    139 	"_"		priv_member	recolor=-1
    140 
    141 :declname Declaration
    142 	*		idle		noeat recolor=-1
    143 	"\c"		declname
    144 
    145 :priv_member PrivateMember
    146 	*		idle		noeat
    147 	"\c"		priv_member
    148 
    149 # Handle string prefixes up to the string itself.
    150 :string_pre Constant
    151 	*		idle noeat
    152 	"'\""		string_quot_1 	save_c
    153 
    154 :string_raw_pre Constant
    155 	*		idle noeat
    156 	"'\""		string_quot_raw_1 save_c
    157 
    158 # Differentiate between docstrings and regular strings, carrying with it raw state
    159 :string_quot_1 Constant
    160 	*		idle call=.string() noeat
    161 	&		string_quot_2
    162 
    163 :string_quot_2 Constant
    164 	*		idle noeat
    165 	&		idle call=.string(docstring) recolor=-3
    166 
    167 :string_quot_raw_1 Constant
    168 	*		idle call=.string(raw)
    169 	&		string_quot_raw_2
    170 
    171 :string_quot_raw_2 Constant
    172 	*		idle noeat
    173 	&		idle call=.string(docstring raw) recolor=-3
    174 
    175 .subr string
    176 
    177 .ifdef docstring	# Long strings
    178 :string Docstring string
    179 	*		string
    180 	"BFHNTX"	string		noeat call=.comment_todo_docstr()
    181 .ifdef raw
    182 .else
    183 	"\\"		string_esc	mark
    184 .endif
    185 	&		doc_end_1
    186 
    187 :doc_end_1 Docstring
    188 	*		string noeat
    189 	&		doc_end_2
    190 
    191 :doc_end_2 Docstring
    192 	*		string noeat
    193 	&		string return
    194 
    195 .else			# Short strings
    196 
    197 :string Constant string
    198 	*		string
    199 	"\n"		string return
    200 .ifdef raw
    201 .else
    202 	"\\"		string_esc mark
    203 .endif
    204 	&		string return
    205 
    206 .endif
    207 
    208 :string_esc Constant
    209 	*		string_esc_done
    210 	"x"		string_hex2
    211 	"u"		string_hex4
    212 	"U"		string_hex8
    213 	"0-7"		string_octal2
    214 	"\n"		string_esc_done
    215 
    216 # Recolor whole escape sequence based on whether this is a docstring.
    217 :string_esc_done Constant
    218 	*		string_esc_really_done noeat markend recolormark
    219 
    220 .ifdef docstring
    221 :string_esc_really_done DocEscape
    222 	*		string 		noeat
    223 .else
    224 :string_esc_really_done Escape
    225 	*		string 		noeat
    226 .endif
    227 
    228 :string_hex1 Escape
    229 	*		string_esc_done	noeat
    230 	"0-9a-fA-F"	string_esc_done
    231 
    232 :string_hex2 Escape
    233 	*		string_esc_done	noeat
    234 	"0-9a-fA-F"	string_hex1
    235 
    236 :string_hex3 Escape
    237 	*		string_esc_done	noeat
    238 	"0-9a-fA-F"	string_hex2
    239 
    240 :string_hex4 Escape
    241 	*		string_esc_done	noeat
    242 	"0-9a-fA-F"	string_hex3
    243 
    244 :string_hex5 Escape
    245 	*		string_esc_done	noeat
    246 	"0-9a-fA-F"	string_hex4
    247 
    248 :string_hex6 Escape
    249 	*		string_esc_done	noeat
    250 	"0-9a-fA-F"	string_hex5
    251 
    252 :string_hex7 Escape
    253 	*		string_esc_done	noeat
    254 	"0-9a-fA-F"	string_hex6
    255 
    256 :string_hex8 Escape
    257 	*		string_esc_done	noeat
    258 	"0-9a-fA-F"	string_hex7
    259 
    260 :string_octal1 Escape
    261 	*		string_esc_done	noeat
    262 	"0-7"		string_esc_done
    263 
    264 :string_octal2 Escape
    265 	*		string_esc_done	noeat
    266 	"0-7"		string_octal1
    267 
    268 .end
    269 
    270 .subr comment_todo_docstr
    271 # initial state
    272 :comment_todo_init Docstring
    273 	*		comment_todo_guess	buffer
    274 
    275 # highlight common TODO labels
    276 :comment_todo_guess Docstring
    277 	*		comment_todo_unknown	noeat strings
    278 	"BUG"		comment_todo
    279 	"FIXME"		comment_todo
    280 	"HACK"		comment_todo
    281 	"NOTE"		comment_todo
    282 	"TODO"		comment_todo
    283 	"XXX"		comment_todo
    284 done
    285 	"A-Z"		comment_todo_guess
    286 
    287 :comment_todo_unknown Docstring
    288 	*		NULL		noeat return
    289 
    290 :comment_todo DocstringLabel
    291 	*		NULL		noeat return
    292 .end