module Text.Highlighter.Lexers.Mxml (lexer) where import qualified Text.Highlighter.Lexers.ActionScript3 as ActionScript3 import Text.Regex.PCRE.Light import Text.Highlighter.Types lexer :: Lexer lexer = Lexer { lName = "MXML" , lAliases = ["mxml"] , lExtensions = [".mxml"] , lMimetypes = [] , lStart = root' , lFlags = [multiline, dotall] } comment' :: TokenMatcher comment' = [ tok "[^-]+" (Arbitrary "Comment") , tokNext "-->" (Arbitrary "Comment") Pop , tok "-" (Arbitrary "Comment") ] tag' :: TokenMatcher tag' = [ tok "\\s+" (Arbitrary "Text") , tokNext "[a-zA-Z0-9_.:-]+\\s*=" (Arbitrary "Name" :. Arbitrary "Attribute") (GoTo attr') , tokNext "/?\\s*>" (Arbitrary "Name" :. Arbitrary "Tag") Pop ] root' :: TokenMatcher root' = [ tok "[^<&]+" (Arbitrary "Text") , tok "&\\S*?;" (Arbitrary "Name" :. Arbitrary "Entity") , tok "(\\<\\!\\[CDATA\\[)(.*?)(\\]\\]\\>)" (ByGroups [(Arbitrary "Literal" :. Arbitrary "String"), (Using ActionScript3.lexer), (Arbitrary "Literal" :. Arbitrary "String")]) , tokNext "