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