comparison src/elisp/urweb-mode.el @ 359:465593c024ca

Reorder font-lock rules to deal better with CDATA
author Adam Chlipala <adamc@hcoop.net>
date Mon, 13 Oct 2008 15:31:02 -0400
parents 583ca86a55a0
children c1e96b387115
comparison
equal deleted inserted replaced
358:583ca86a55a0 359:465593c024ca
179 (inXml depth)) 179 (inXml depth))
180 (progn (backward-char 5) (not (looking-at "/html")))))))) 180 (progn (backward-char 5) (not (looking-at "/html"))))))))
181 181
182 (defconst urweb-font-lock-keywords 182 (defconst urweb-font-lock-keywords
183 `(;;(urweb-font-comments-and-strings) 183 `(;;(urweb-font-comments-and-strings)
184 ("\\(<\\sw+\\)\\(\\s-\\|\\sw\\|=\\|\"[^\"]*\"\\|{[^}]*}\\)*/?\\(>\\)"
185 (1 font-lock-tag-face)
186 (3 font-lock-tag-face))
187 ("\\(</\\sw+>\\)"
188 (1 font-lock-tag-face))
189 ("\\([^<>{}]+\\)"
190 (1 (if (save-excursion (inXml 0))
191 font-lock-string-face
192 nil)))
193
184 ("\\<\\(fun\\|and\\)\\s-+\\(\\sw+\\)\\s-+[^ \t\n=]" 194 ("\\<\\(fun\\|and\\)\\s-+\\(\\sw+\\)\\s-+[^ \t\n=]"
185 (1 font-lock-keyword-face) 195 (1 font-lock-keyword-face)
186 (2 font-lock-function-name-face)) 196 (2 font-lock-function-name-face))
187 ("\\<\\(\\(data\\)?type\\|con\\|class\\)\\s-+\\(\\sw+\\)" 197 ("\\<\\(\\(data\\)?type\\|con\\|class\\)\\s-+\\(\\sw+\\)"
188 (1 font-lock-keyword-face) 198 (1 font-lock-keyword-face)
194 (1 font-lock-keyword-face) 204 (1 font-lock-keyword-face)
195 (2 font-lock-module-def-face)) 205 (2 font-lock-module-def-face))
196 ("\\<\\(signature\\)\\s-+\\(\\sw+\\)" 206 ("\\<\\(signature\\)\\s-+\\(\\sw+\\)"
197 (1 font-lock-keyword-face) 207 (1 font-lock-keyword-face)
198 (2 font-lock-interface-def-face)) 208 (2 font-lock-interface-def-face))
199
200 ("\\(<\\sw+\\)\\(\\s-\\|\\sw\\|=\\|\"[^\"]*\"\\|{[^}]*}\\)*/?\\(>\\)"
201 (1 font-lock-tag-face)
202 (3 font-lock-tag-face))
203 ("\\(</\\sw+>\\)"
204 (1 font-lock-tag-face))
205 ("\\([^<>{}]+\\)"
206 (1 (if (save-excursion (inXml 0))
207 font-lock-string-face
208 nil)))
209 209
210 (,urweb-keywords-regexp . font-lock-keyword-face) 210 (,urweb-keywords-regexp . font-lock-keyword-face)
211 (,urweb-sql-keywords-regexp . font-lock-sql-face) 211 (,urweb-sql-keywords-regexp . font-lock-sql-face)
212 (,urweb-cident-regexp . font-lock-cvariable-face)) 212 (,urweb-cident-regexp . font-lock-cvariable-face))
213 "Regexps matching standard Ur/Web keywords.") 213 "Regexps matching standard Ur/Web keywords.")