dotfiles

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

sed.jsf (2272B)


      1 # Fancy "sed" highlighter
      2 
      3 # Bugs: delimiter should be ignored in [...]
      4 #
      5 #       it would be nice if this did more correct
      6 #       error checking for the sed programmer
      7 
      8 -
      9 
     10 =Idle
     11 =Comment 	green
     12 =String 	cyan
     13 =Escape 	bold cyan
     14 =Bad		red
     15 =Keyword	bold
     16 =Delimiter	magenta
     17 
     18 # Zero address commands: # : }
     19 # Zero or one address: = a i q r
     20 # Range address: { b t c d D h H g G x l n N p P s w y
     21 
     22 :idle Idle
     23 	*		cmd		noeat
     24 	" 	"	idle
     25 	"\n"		idle
     26 	"0-9"		first_addr	recolor=-1
     27 	"$"		first_eof	recolor=-1
     28 	"/"		first_regex_c	recolor=-1
     29 
     30 :first_eof String
     31 	*		first_addr_done	noeat
     32 
     33 :first_regex_c Delimiter
     34 	*		first_regex	noeat
     35 
     36 :first_regex String
     37 	*		first_regex
     38 	"\\"		first_regex_quote	recolor=-1
     39 	"/"		first_regex_e		recolor=-1
     40 
     41 :first_regex_e Delimiter
     42 	*		first_addr_done		noeat
     43 
     44 :first_regex_quote Escape
     45 	*		first_regex
     46 
     47 :first_addr String
     48 	*		first_addr_done	noeat
     49 	"0-9"		first_addr
     50 
     51 :first_addr_done Idle
     52 	*		cmd		noeat
     53 	","		second_addr_start
     54 
     55 :second_addr_start Idle
     56 	*		bad		noeat
     57 	"0-9"		second_addr	recolor=-1
     58 	"$"		second_eof	recolor=-1
     59 	"/"		second_regex	recolor=-1
     60 
     61 :second_eof String
     62 	*		cmd		noeat
     63 
     64 :second_regex String
     65 	*		second_regex
     66 	"/"		cmd
     67 
     68 :second_addr String
     69 	*		cmd		noeat
     70 	"0-9"		second_addr
     71 
     72 :bad Bad
     73 	*		bad
     74 	"\n"		idle
     75 
     76 :cmd Delimiter
     77 	*		the_cmd		noeat
     78 	" 	"	cmd
     79 	"!"		the_cmd
     80 
     81 :the_cmd Idle
     82 	*		bad		noeat
     83 	" 	"	the_cmd
     84 	";"		next		noeat
     85 	"#"		comment		recolor=-1
     86 	"sy"		accepts		recolor=-1
     87 	"{"		accepto		recolor=-1
     88 	"aic"		accept		recolor=-1
     89 	"=:}rqbtdDhHgGxlnNpPw"	acceptc	recolor=-1
     90 
     91 :accepto Keyword
     92 	*		idle		noeat
     93 
     94 :accept Keyword
     95 	*		next		noeat
     96 
     97 :acceptc Keyword
     98 	*		nextallow	noeat
     99 
    100 :accepts Keyword
    101 	*		subst		noeat
    102 
    103 :subst Delimiter
    104 	*		subst_rest	save_c
    105 
    106 :subst_rest String
    107 	*		subst_rest
    108 	&		subst_rest_2_c		recolor=-1
    109 	"\\"		subst_rest_quote	recolor=-1
    110 
    111 :subst_rest_quote Escape
    112 	*		subst_rest
    113 
    114 :subst_rest_2_c Delimiter
    115 	*		subst_rest_2		noeat
    116 
    117 :subst_rest_2 String
    118 	*		subst_rest_2
    119 	&		next_c			recolor=-1
    120 	"\\"		subst_rest_2_quote	recolor=-1
    121 
    122 :next_c Delimiter
    123 	*		nextallow	noeat
    124 
    125 :subst_rest_2_quote Escape
    126 	*		subst_rest_2
    127 
    128 :nextallow Idle
    129 	*		nextallow
    130 	"\n"		idle
    131 	";"		idle
    132 	"#"		comment	recolor=-1
    133 
    134 :next Idle
    135 	*		next
    136 	"\n"		idle
    137 	"\\"		continue
    138 
    139 :continue Idle
    140 	*		next
    141 
    142 :comment Comment
    143 	*		comment
    144 	"\n"		idle