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
|
syntax .xml-entity
state entity
char # hash
char -b a-zA-Z0-9 name
recolor error 1
char "\n" END
eat END error
state hash entity
char xX x
char 0-9 dec
eat END error
state x entity
char 0-9a-fA-F hex
eat END error
state hex entity
char 0-9a-fA-F this
char ";" END entity
eat END error
state dec entity
char 0-9 this
char ";" END entity
eat END error
state name error
char -b a-zA-Z0-9 this
inlist entity semicolon
noeat semicolon
state semicolon error
char ";" END entity
eat END error
list entity \
quot apos amp lt gt
syntax xml
state line1 text
char " \t\n" this
str "<?" xml
str -i "<!doctype" doctype
noeat text
state line2 text
char " \t\n" this
str -i "<!doctype" doctype
noeat text
# Eat <?xml ... ?>
state xml comment
char > line2 comment
char < line2 error
eat this
state doctype comment
char > text comment
char < text error
eat this
state text
str "<!--" comment
char < tag-start
char > this error
char "&" .xml-entity:this
eat this
state comment
str -- --> text comment
eat this
state tag-start tag
char / close-tag
char -b a-zA-Z_: tag-name
char > text tag
eat this error
state close-tag tag
char -b a-zA-Z_: close-tag-name
eat text error
state tag-name tag
char -b a-zA-Z0-9_:.- this
noeat attrs
state close-tag-name tag
char -b a-zA-Z0-9_:.- this
noeat close-tag-end
state close-tag-end special
char " \t\n" this
char > text tag
eat text error
state attrs code
char " \t\n" this
char -b a-zA-Z:_ attr-name
char > text tag
char / short-close
eat this error
state short-close tag
char > text tag
eat text error
state attr-name attr
char a-zA-Z0-9_:.- this
char = attr-eq
noeat attrs
state attr-eq attr
char \" dq
char \' sq
noeat attrs
state dq string
char \" attrs string
char "\n" attrs
char "&" .xml-entity:this
eat this
state sq string
char \' attrs string
char "\n" attrs
char "&" .xml-entity:this
eat this
default special entity
|