1 # $MirOS: contrib/code/jupp/syntax/xml.jsf.in,v 1.4 2017/12/02 05:38:06 tg Exp $
3 # Improved XML highlighter by: Brian Candler <B.Candler@pobox.com>
5 # Define no. sync lines
8 # - means always start parsing from beginning of file when we lose sync
9 # if nothing is specified, the default is -120
15 # bold inverse blink dim underline
16 # white cyan magenta blue yellow green red black
17 # bg_white bg_cyan bg_magenta bg_blue bg_yellow bg_green bg_red bg_black
19 # The underlines are here right now just because I want to distinguish which
20 # bits have been coloured (say) CdataStart, CdataBody, CdataEnd. And that's
21 # because I think it may be useful to make that distinction for some people.
40 # http://www.w3.org/TR/2004/REC-xml-20040204/
42 # NOTE: For UNICODE compatibility, the ranges
43 # "A-Za-z_:" -- first character of Name
44 # "A-Za-z0-9._:-" -- subsequent characters of Name
45 # ought to be replaced with some appropriate Unicode character classes
50 ">" error noeat recolor=-1
51 "&" entityref recolor=-1
53 # In several contexts a space is an error, and since a coloured space is
54 # not visible, we colour the next non-space character as well.
57 * error_visible noeat recolor=-1
66 * error noeat recolor=-1
67 "A-Za-z0-9._:-" entityref
74 * error noeat recolor=-1
76 "A-Za-z_:" start_or_empty_tag
77 "?" pi_start recolor=-2
78 "!" decl recolor=-2 buffer
83 * error noeat recolor=-1
87 * error noeat recolor=-1
88 "A-Za-z0-9._:-" end_tag2
93 * error noeat recolor=-1
99 :start_or_empty_tag Tag
100 * error noeat recolor=-1
101 "A-Za-z0-9._:-" start_or_empty_tag
109 * error noeat recolor=-1
112 # Matched: <tag SPACE
115 * error noeat recolor=-1
118 "/" empty_tag recolor=-1
119 ">" close_tag recolor=-1
124 * error noeat recolor=-1
128 # Matched: <tag attr=
131 * error noeat recolor=-1
132 "\"" astring recolor=-1
133 "'" bstring recolor=-1
135 # Matched: <tag attr="
139 "<>" error noeat recolor=-1
145 "<>" error noeat recolor=-1
150 * error noeat recolor=-1
151 "A-Za-z0-9._:-" achar
156 * error noeat recolor=-1
157 "A-Za-z0-9._:-" bchar
161 # Matched: <tag attr="foo"
164 * error noeat recolor=-1
166 "/" empty_tag recolor=-1
167 ">" close_tag recolor=-1
169 # This state is just to recolor the final ">" at the end of <tag attr="val">
177 * pi noeat recolor=-1
185 ">" pi_end recolor=-2
188 * content noeat recolor=-1
194 "!--" comment_start recolor=-5
195 "![CDATA[" cdata_start recolor=-10
200 # We allow one level of <...> nesting within declarations
208 :comment_start CommentStart
215 :comment2 CommentBody
219 :comment3 CommentBody
220 * comment_error noeat recolor=-3
221 ">" comment_end recolor=-3
223 :comment_end CommentEnd
224 * content noeat recolor=-1
226 # For compatibility, the string "--" (double-hyphen) MUST NOT occur within
227 # comments. [http://www.w3.org/TR/REC-xml/ section 2.5]
232 ">" comment_end recolor=-3
236 :cdata_start CdataStart
249 ">" cdata_end recolor=-3
252 * content noeat recolor=-1