{ {-# OPTIONS -w #-} -- Suppress warnings from alex-generated code module Text.Highlighting.Illuminate.XML (lexer) where } %wrapper "illuminate" $wordchar = [0-9a-zA-Z\_] $symbol = [\~ \! \% \^ \* \( \) \- \+ \= \[ \] \" \: \; \, \. \/ \? \& \< \> \| \/] $digit = [0-9] $hexdigit = [0-9a-fA-F] @entity = \& [^ $white]+ \; tokens :- { [^ \-]+ { tok Comment } "-->" { tok Comment ==> popContext } \- { tok Comment } } { [^ \>]+ { tok Preproc } \> { tok Preproc ==> popContext } } { [^ \]]+ { tok Preproc } "]]>" { tok Preproc ==> popContext } \] { tok Preproc } } { \> { tok Tag ==> popContext } $wordchar+ / \= { tok Keyword } \= { tok Symbol } \" [^\"]* \" { tok String } \' [^\']* \' { tok String } [0-9]+ { tok Number } } <0> { [^ \< \&]+ { plain } @entity { tok Entity } "