highlighter2 (empty) → 0.2.3
raw patch · 122 files changed
+8848/−0 lines, 122 filesdep +basedep +blaze-htmldep +blaze-markupsetup-changed
Dependencies added: base, blaze-html, blaze-markup, bytestring, containers, filepath, mtl, pcre-light, text
Files
- LICENSE +30/−0
- Setup.hs +3/−0
- highlighter2.cabal +185/−0
- src/Main.hs +37/−0
- src/Text/Highlighter.hs +15/−0
- src/Text/Highlighter/Formatters/Html.hs +55/−0
- src/Text/Highlighter/Lexer.hs +155/−0
- src/Text/Highlighter/Lexers.hs +236/−0
- src/Text/Highlighter/Lexers/ABAP.hs +52/−0
- src/Text/Highlighter/Lexers/ActionScript.hs +36/−0
- src/Text/Highlighter/Lexers/ActionScript3.hs +58/−0
- src/Text/Highlighter/Lexers/Ada.hs +125/−0
- src/Text/Highlighter/Lexers/Antlr.hs +118/−0
- src/Text/Highlighter/Lexers/ApacheConf.hs +36/−0
- src/Text/Highlighter/Lexers/AppleScript.hs +55/−0
- src/Text/Highlighter/Lexers/Asymptote.hs +79/−0
- src/Text/Highlighter/Lexers/Atomo.hs +147/−0
- src/Text/Highlighter/Lexers/Autohotkey.hs +146/−0
- src/Text/Highlighter/Lexers/BBCode.hs +30/−0
- src/Text/Highlighter/Lexers/Bash.hs +79/−0
- src/Text/Highlighter/Lexers/Batch.hs +54/−0
- src/Text/Highlighter/Lexers/Befunge.hs +31/−0
- src/Text/Highlighter/Lexers/BlitzMax.hs +51/−0
- src/Text/Highlighter/Lexers/Boo.hs +68/−0
- src/Text/Highlighter/Lexers/Brainfuck.hs +37/−0
- src/Text/Highlighter/Lexers/C.hs +102/−0
- src/Text/Highlighter/Lexers/CMake.hs +51/−0
- src/Text/Highlighter/Lexers/Clojure.hs +37/−0
- src/Text/Highlighter/Lexers/CoffeeScript.hs +55/−0
- src/Text/Highlighter/Lexers/Coldfusion.hs +43/−0
- src/Text/Highlighter/Lexers/CommonLisp.hs +76/−0
- src/Text/Highlighter/Lexers/Cpp.hs +81/−0
- src/Text/Highlighter/Lexers/Css.hs +68/−0
- src/Text/Highlighter/Lexers/Cython.hs +167/−0
- src/Text/Highlighter/Lexers/D.hs +129/−0
- src/Text/Highlighter/Lexers/DarcsPatch.hs +58/−0
- src/Text/Highlighter/Lexers/DebianControl.hs +64/−0
- src/Text/Highlighter/Lexers/Diff.hs +27/−0
- src/Text/Highlighter/Lexers/Django.hs +57/−0
- src/Text/Highlighter/Lexers/Duel.hs +30/−0
- src/Text/Highlighter/Lexers/Dylan.hs +44/−0
- src/Text/Highlighter/Lexers/Erlang.hs +56/−0
- src/Text/Highlighter/Lexers/Factor.hs +100/−0
- src/Text/Highlighter/Lexers/Felix.hs +181/−0
- src/Text/Highlighter/Lexers/Fortran.hs +50/−0
- src/Text/Highlighter/Lexers/GLShader.hs +36/−0
- src/Text/Highlighter/Lexers/Gas.hs +63/−0
- src/Text/Highlighter/Lexers/GenshiText.hs +41/−0
- src/Text/Highlighter/Lexers/Gettext.hs +26/−0
- src/Text/Highlighter/Lexers/Gherkin.hs +134/−0
- src/Text/Highlighter/Lexers/Gnuplot.hs +144/−0
- src/Text/Highlighter/Lexers/Go.hs +36/−0
- src/Text/Highlighter/Lexers/GoodDataCL.hs +42/−0
- src/Text/Highlighter/Lexers/Groff.hs +49/−0
- src/Text/Highlighter/Lexers/Haskell.hs +108/−0
- src/Text/Highlighter/Lexers/Haxe.hs +255/−0
- src/Text/Highlighter/Lexers/Html.hs +64/−0
- src/Text/Highlighter/Lexers/Hybris.hs +51/−0
- src/Text/Highlighter/Lexers/Ini.hs +23/−0
- src/Text/Highlighter/Lexers/Io.hs +41/−0
- src/Text/Highlighter/Lexers/Ioke.hs +107/−0
- src/Text/Highlighter/Lexers/IrcLogs.hs +31/−0
- src/Text/Highlighter/Lexers/Java.hs +51/−0
- src/Text/Highlighter/Lexers/Javascript.hs +56/−0
- src/Text/Highlighter/Lexers/LighttpdConf.hs +29/−0
- src/Text/Highlighter/Lexers/Llvm.hs +45/−0
- src/Text/Highlighter/Lexers/Logtalk.hs +141/−0
- src/Text/Highlighter/Lexers/Lua.hs +78/−0
- src/Text/Highlighter/Lexers/MOOCode.hs +31/−0
- src/Text/Highlighter/Lexers/Mako.hs +53/−0
- src/Text/Highlighter/Lexers/Maql.hs +39/−0
- src/Text/Highlighter/Lexers/Matlab.hs +42/−0
- src/Text/Highlighter/Lexers/MiniD.hs +45/−0
- src/Text/Highlighter/Lexers/Modelica.hs +83/−0
- src/Text/Highlighter/Lexers/Modula2.hs +84/−0
- src/Text/Highlighter/Lexers/MoinWiki.hs +40/−0
- src/Text/Highlighter/Lexers/MuPAD.hs +43/−0
- src/Text/Highlighter/Lexers/Mxml.hs +49/−0
- src/Text/Highlighter/Lexers/MySql.hs +44/−0
- src/Text/Highlighter/Lexers/Nasm.hs +65/−0
- src/Text/Highlighter/Lexers/Newspeak.hs +60/−0
- src/Text/Highlighter/Lexers/NginxConf.hs +52/−0
- src/Text/Highlighter/Lexers/NumPy.hs +149/−0
- src/Text/Highlighter/Lexers/Objdump.hs +30/−0
- src/Text/Highlighter/Lexers/ObjectiveC.hs +115/−0
- src/Text/Highlighter/Lexers/ObjectiveJ.hs +149/−0
- src/Text/Highlighter/Lexers/Ocaml.hs +72/−0
- src/Text/Highlighter/Lexers/Ooc.hs +52/−0
- src/Text/Highlighter/Lexers/Perl.hs +157/−0
- src/Text/Highlighter/Lexers/Php.hs +76/−0
- src/Text/Highlighter/Lexers/PostScript.hs +48/−0
- src/Text/Highlighter/Lexers/Povray.hs +33/−0
- src/Text/Highlighter/Lexers/Prolog.hs +45/−0
- src/Text/Highlighter/Lexers/Properties.hs +22/−0
- src/Text/Highlighter/Lexers/ProtoBuf.hs +54/−0
- src/Text/Highlighter/Lexers/Python.hs +149/−0
- src/Text/Highlighter/Lexers/Python3.hs +149/−0
- src/Text/Highlighter/Lexers/Python3Traceback.hs +32/−0
- src/Text/Highlighter/Lexers/PythonTraceback.hs +32/−0
- src/Text/Highlighter/Lexers/Ragel.hs +91/−0
- src/Text/Highlighter/Lexers/RagelEmbedded.hs +29/−0
- src/Text/Highlighter/Lexers/Redcode.hs +28/−0
- src/Text/Highlighter/Lexers/S.hs +86/−0
- src/Text/Highlighter/Lexers/Scala.hs +85/−0
- src/Text/Highlighter/Lexers/Scheme.hs +35/−0
- src/Text/Highlighter/Lexers/Scss.hs +144/−0
- src/Text/Highlighter/Lexers/Smalltalk.hs +118/−0
- src/Text/Highlighter/Lexers/Smarty.hs +38/−0
- src/Text/Highlighter/Lexers/SourcesList.hs +48/−0
- src/Text/Highlighter/Lexers/Sql.hs +38/−0
- src/Text/Highlighter/Lexers/SquidConf.hs +36/−0
- src/Text/Highlighter/Lexers/Tcl.hs +147/−0
- src/Text/Highlighter/Lexers/Tcsh.hs +67/−0
- src/Text/Highlighter/Lexers/Tex.hs +64/−0
- src/Text/Highlighter/Lexers/Vala.hs +89/−0
- src/Text/Highlighter/Lexers/VbNet.hs +79/−0
- src/Text/Highlighter/Lexers/Velocity.hs +63/−0
- src/Text/Highlighter/Lexers/Verilog.hs +78/−0
- src/Text/Highlighter/Lexers/Vim.hs +33/−0
- src/Text/Highlighter/Lexers/Xml.hs +49/−0
- src/Text/Highlighter/Lexers/Xslt.hs +49/−0
- src/Text/Highlighter/Types.hs +215/−0
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright Alex Suraci 2010++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution.++ * Neither the name of Alex Suraci nor the names of other+ contributors may be used to endorse or promote products derived+ from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ Setup.hs view
@@ -0,0 +1,3 @@+#!/usr/bin/env runhaskell+import Distribution.Simple+main = defaultMain
+ highlighter2.cabal view
@@ -0,0 +1,185 @@+name: highlighter2+version: 0.2.3+synopsis: source code highlighting+description:+ Processes source code using tons of lexers, tokenizing it and formatting it as e.g. HTML.+ .+ Very similar to the Python Pygments library; many lexers directly converted from it.+license: BSD3+license-file: LICENSE+author: Alex Suraci+maintainer: i.am@toogeneric.com+stability: Experimental++category: Text++build-type: Simple++cabal-version: >= 1.6++flag executable+ description: Install a "highlighter" executable for highlighting source code as HTML.+ default: False++library+ hs-source-dirs: src++ exposed-modules:+ { Text.Highlighter+ , Text.Highlighter.Types+ , Text.Highlighter.Lexer+ , Text.Highlighter.Lexers+ , Text.Highlighter.Formatters.Html+ , Text.Highlighter.Lexers.ABAP+ , Text.Highlighter.Lexers.ActionScript+ , Text.Highlighter.Lexers.ActionScript3+ , Text.Highlighter.Lexers.Ada+ , Text.Highlighter.Lexers.Antlr+ , Text.Highlighter.Lexers.ApacheConf+ , Text.Highlighter.Lexers.AppleScript+ , Text.Highlighter.Lexers.Asymptote+ , Text.Highlighter.Lexers.Atomo+ , Text.Highlighter.Lexers.Autohotkey+ , Text.Highlighter.Lexers.Bash+ , Text.Highlighter.Lexers.Batch+ , Text.Highlighter.Lexers.BBCode+ , Text.Highlighter.Lexers.Befunge+ , Text.Highlighter.Lexers.BlitzMax+ , Text.Highlighter.Lexers.Boo+ , Text.Highlighter.Lexers.Brainfuck+ , Text.Highlighter.Lexers.C+ , Text.Highlighter.Lexers.Clojure+ , Text.Highlighter.Lexers.CMake+ , Text.Highlighter.Lexers.CoffeeScript+ , Text.Highlighter.Lexers.Coldfusion+ , Text.Highlighter.Lexers.CommonLisp+ , Text.Highlighter.Lexers.Cpp+ , Text.Highlighter.Lexers.Css+ , Text.Highlighter.Lexers.Cython+ , Text.Highlighter.Lexers.D+ , Text.Highlighter.Lexers.DarcsPatch+ , Text.Highlighter.Lexers.DebianControl+ , Text.Highlighter.Lexers.Diff+ , Text.Highlighter.Lexers.Django+ , Text.Highlighter.Lexers.Duel+ , Text.Highlighter.Lexers.Dylan+ , Text.Highlighter.Lexers.Erlang+ , Text.Highlighter.Lexers.Factor+ , Text.Highlighter.Lexers.Felix+ , Text.Highlighter.Lexers.Fortran+ , Text.Highlighter.Lexers.Gas+ , Text.Highlighter.Lexers.GenshiText+ , Text.Highlighter.Lexers.Gettext+ , Text.Highlighter.Lexers.Gherkin+ , Text.Highlighter.Lexers.GLShader+ , Text.Highlighter.Lexers.Gnuplot+ , Text.Highlighter.Lexers.Go+ , Text.Highlighter.Lexers.GoodDataCL+ , Text.Highlighter.Lexers.Groff+ , Text.Highlighter.Lexers.Haskell+ , Text.Highlighter.Lexers.Haxe+ , Text.Highlighter.Lexers.Html+ , Text.Highlighter.Lexers.Hybris+ , Text.Highlighter.Lexers.Ini+ , Text.Highlighter.Lexers.Io+ , Text.Highlighter.Lexers.Ioke+ , Text.Highlighter.Lexers.IrcLogs+ , Text.Highlighter.Lexers.Java+ , Text.Highlighter.Lexers.Javascript+ , Text.Highlighter.Lexers.LighttpdConf+ , Text.Highlighter.Lexers.Llvm+ , Text.Highlighter.Lexers.Logtalk+ , Text.Highlighter.Lexers.Lua+ , Text.Highlighter.Lexers.Mako+ , Text.Highlighter.Lexers.Maql+ , Text.Highlighter.Lexers.Matlab+ , Text.Highlighter.Lexers.MiniD+ , Text.Highlighter.Lexers.Modelica+ , Text.Highlighter.Lexers.Modula2+ , Text.Highlighter.Lexers.MoinWiki+ , Text.Highlighter.Lexers.MOOCode+ , Text.Highlighter.Lexers.MuPAD+ , Text.Highlighter.Lexers.Mxml+ , Text.Highlighter.Lexers.MySql+ , Text.Highlighter.Lexers.Nasm+ , Text.Highlighter.Lexers.Newspeak+ , Text.Highlighter.Lexers.NginxConf+ , Text.Highlighter.Lexers.NumPy+ , Text.Highlighter.Lexers.Objdump+ , Text.Highlighter.Lexers.ObjectiveC+ , Text.Highlighter.Lexers.ObjectiveJ+ , Text.Highlighter.Lexers.Ocaml+ , Text.Highlighter.Lexers.Ooc+ , Text.Highlighter.Lexers.Perl+ , Text.Highlighter.Lexers.Php+ , Text.Highlighter.Lexers.PostScript+ , Text.Highlighter.Lexers.Povray+ , Text.Highlighter.Lexers.Prolog+ , Text.Highlighter.Lexers.Properties+ , Text.Highlighter.Lexers.ProtoBuf+ , Text.Highlighter.Lexers.Python+ , Text.Highlighter.Lexers.Python3+ , Text.Highlighter.Lexers.Python3Traceback+ , Text.Highlighter.Lexers.PythonTraceback+ , Text.Highlighter.Lexers.Ragel+ , Text.Highlighter.Lexers.RagelEmbedded+ , Text.Highlighter.Lexers.Redcode+ , Text.Highlighter.Lexers.S+ , Text.Highlighter.Lexers.Scala+ , Text.Highlighter.Lexers.Scheme+ , Text.Highlighter.Lexers.Scss+ , Text.Highlighter.Lexers.Smalltalk+ , Text.Highlighter.Lexers.Smarty+ , Text.Highlighter.Lexers.SourcesList+ , Text.Highlighter.Lexers.Sql+ , Text.Highlighter.Lexers.SquidConf+ , Text.Highlighter.Lexers.Tcl+ , Text.Highlighter.Lexers.Tcsh+ , Text.Highlighter.Lexers.Tex+ , Text.Highlighter.Lexers.Vala+ , Text.Highlighter.Lexers.VbNet+ , Text.Highlighter.Lexers.Velocity+ , Text.Highlighter.Lexers.Verilog+ , Text.Highlighter.Lexers.Vim+ , Text.Highlighter.Lexers.Xml+ , Text.Highlighter.Lexers.Xslt+ }++ build-depends:+ { base >= 4 && < 5+ , blaze-html+ , bytestring+ , filepath+ , mtl >= 2.2.1+ , pcre-light+ , text+ , containers+ }++executable highlighter+ if !flag(executable)+ buildable: False++ hs-source-dirs: src+ main-is: Main.hs++ ghc-options: -Wall -fno-warn-unused-do-bind -O2 ++ extensions: OverloadedStrings++ build-depends:+ { base >= 4 && < 5+ , blaze-html+ , blaze-markup+ , bytestring+ , filepath+ , mtl+ , pcre-light+ , text+ , containers+ }++source-repository head+ type: git+ branch: master+ location: https://github.com:chemist/highlighter.git
+ src/Main.hs view
@@ -0,0 +1,37 @@+import Prelude hiding (head)++import Text.Highlighter+import Text.Highlighter.Formatters.Html++import System.Environment+import Text.Blaze.Html.Renderer.String+import Text.Blaze.Html5+import Text.Blaze.Html5.Attributes+import qualified Data.ByteString as BS++main :: IO ()+main = do+ as <- getArgs++ case as of+ [fn] -> do+ case lexerFromFilename fn of+ Just l -> do+ s <- BS.readFile fn+ case runLexer l s of+ Right ts ->+ putStrLn . renderHtml . mainPage . format True $ ts++ Left e ->+ error (show e)+ Nothing -> error "unknown file type"++ _ -> putStrLn "usage: hspygments FILENAME"++mainPage :: Html -> Html+mainPage h =+ docTypeHtml $ do+ head $+ link ! rel "stylesheet" ! href "highlight.css"++ body h
+ src/Text/Highlighter.hs view
@@ -0,0 +1,15 @@+module Text.Highlighter+ ( module Text.Highlighter.Lexer+ , module Text.Highlighter.Lexers+ , module Text.Highlighter.Types+ , lexerFromFilename+ ) where++import Text.Highlighter.Lexer+import Text.Highlighter.Lexers+import Text.Highlighter.Types++import System.FilePath++lexerFromFilename :: FilePath -> Maybe Lexer+lexerFromFilename = flip lookup lexers . takeExtension
+ src/Text/Highlighter/Formatters/Html.hs view
@@ -0,0 +1,55 @@+{-# LANGUAGE OverloadedStrings #-}+module Text.Highlighter.Formatters.Html (format, formatInline) where++import Data.Text (Text)+import Data.Text.Encoding (decodeUtf8)+import Prelude hiding (div, span)+import Text.Blaze.Html5+import Text.Blaze.Html5.Attributes hiding (span)+import qualified Data.ByteString as BS++import Text.Highlighter.Types+++format :: Bool -> [Token] -> Html+format ls ts+ | ls =+ table ! class_ "highlighttable" $ tr $ do+ td ! class_ "linenos" $+ div ! class_ "linenodiv" $+ pre (lineNos (countLines ts))++ td ! class_ "code" $+ div ! class_ "highlight" $+ pre $ highlight ts+ | otherwise =+ div ! class_ "highlight" $+ pre $ highlight ts++formatInline :: [Token] -> Html+formatInline = code . highlight++highlight :: [Token] -> Html+highlight [] = return ()+highlight (Token t s:ts) = do+ span ! class_ (toValue $ shortName t) $ toHtml (decodeUtf8 s)+ highlight ts++countLines :: [Token] -> Int+countLines [] = 0+countLines (Token _ s:ts) =+ length (BS.elemIndices (toEnum . fromEnum $ '\n') s) + countLines ts++lineNos :: Int -> Html+lineNos n = lineNos' 1+ where+ lineNos' c+ | c <= n = do+ a ! href (toValue $ "#L-" ++ show c)+ ! name (toValue $ "L-" ++ show c) $+ toHtml (show c)++ toHtml ("\n" :: Text)++ lineNos' (c + 1)+ | otherwise = return ()
+ src/Text/Highlighter/Lexer.hs view
@@ -0,0 +1,155 @@+module Text.Highlighter.Lexer (runLexer) where++import Control.Monad.Except (ExceptT, runExceptT, throwError, catchError)+import Control.Monad.State (State, gets, modify, evalState)+import Text.Regex.PCRE.Light hiding (compile)+import Text.Regex.PCRE.Light.Char8 (compile)+import qualified Data.ByteString as BS+import Data.Sequence (Seq, empty, singleton, (><), viewl, null, ViewL(..))+import Data.Monoid ((<>))+import Control.Applicative ((<$>))+import Data.Foldable (toList, foldr1, mapM_)+import Prelude hiding (lex, foldr1, mapM_, concat, head, drop, tail, reverse, dropWhile, null)+import qualified Prelude as P++import Text.Highlighter.Types+++data LexerState =+ LexerState+ { lsLexer :: Lexer+ , lsInput :: BS.ByteString+ , lsState :: [TokenMatcher]+ , lsLexed :: (Seq Token)+ , lastNotNull :: Bool+ }+ deriving Show++type LexerM = ExceptT LexerError (State LexerState)++data LexerError+ = NoMatchFor BS.ByteString+ | OtherLexerError String+ deriving Show++runLexer :: Lexer -> BS.ByteString -> Either LexerError [Token]+runLexer l s = toList <$> runLexer' l s++runLexer' :: Lexer -> BS.ByteString -> Either LexerError (Seq Token)+runLexer' l s = evalState (runExceptT lex) (LexerState l s [lStart l] empty True)++lex :: LexerM (Seq Token)+lex = do+ done <- gets (BS.null . lsInput)++ if done+ then gets lsLexed+ else do++ ms <- getState+ ts <- tryAll ms+ if null ts || (BS.null . tText . head $ ts)+ then modify $ \ls -> ls { lsLexed = lsLexed ls >< ts }+ else modify $ \ls -> ls { lsLexed = lsLexed ls >< ts + , lastNotNull = (BS.last . tText . head $ ts) == 10+ }+ lex+ where+ getState = gets (P.head . lsState)++isBOL :: LexerM Bool+isBOL = gets lastNotNull++head :: Seq a -> a+head x = let (b :< _) = viewl x+ in b++tryAll :: [Match] -> LexerM (Seq Token)+tryAll [] = do+ i <- gets lsInput+ throwError (NoMatchFor i)+tryAll (AnyOf ms:ms') =+ tryAll (ms ++ ms')+tryAll (m:ms) = do+ atbol <- isBOL+ fs <- gets (lFlags . lsLexer)++ let opts+ | atbol = [exec_anchored]+ | otherwise = [exec_anchored, exec_notbol]++ i <- gets lsInput+ case match (compile (mRegexp m) fs) i opts of+ Just [] -> do+ nextState (mNextState m) []+ return empty++ Just (s:ss) -> do+ modify $ \ls -> ls { lsInput = BS.drop (BS.length s) i }++ nextState (mNextState m) (s:ss)++ toTokens (s:ss) (mType m)++ Nothing ->+ tryAll ms `catchError` trySkipping+ where+ trySkipping (NoMatchFor _) = tryAllFirst (m:ms)+ trySkipping e = throwError e++tryAllFirst :: [Match] -> LexerM (Seq Token)+tryAllFirst [] = do+ i <- gets lsInput+ throwError (NoMatchFor i)+tryAllFirst (AnyOf ms:ms') =+ tryAllFirst (ms ++ ms')+tryAllFirst (m:ms) = do+ atbol <- isBOL+ fs <- gets (lFlags . lsLexer)++ let opts+ | atbol = []+ | otherwise = [exec_notbol]++ i <- gets lsInput+ case match (compile (mRegexp m) fs) i opts of+ Just (s:ss) -> do+ let (skipped, next) = skipFailed i s+ modify $ \ls -> ls { lsInput = next }+ ts <- toTokens (s:ss) (mType m)+ return . singleton . Token Error $ (skipped <> (tText $ head ts))++ _ -> tryAllFirst ms++toTokens :: [BS.ByteString] -> TokenType -> LexerM (Seq Token)+toTokens (s:_) (Using l) = either throwError return (runLexer' l s)+toTokens (_:ss) (ByGroups ts) = foldr1 (><) <$> mapM (\(s,t) -> toTokens [s] t) (P.zip ss ts)+toTokens (s:_) t = return $ singleton $ Token t s+toTokens [] _ = return empty++-- Given the starting point, return the text preceding and after+-- the failing regexp match+skipFailed :: BS.ByteString -> BS.ByteString -> (BS.ByteString, BS.ByteString)+skipFailed i r+ | r `BS.isPrefixOf` i = (BS.empty, BS.drop (BS.length r) i)+ | otherwise =+ let (pre, next) = skipFailed (BS.tail i) r+ in (BS.cons (BS.head i) pre, next)++nextState :: NextState -> [BS.ByteString] -> LexerM ()+nextState Continue _ = return ()+nextState Pop _ =+ modify $ \ls -> ls { lsState = P.tail (lsState ls) }+nextState (PopNum n) _ =+ modify $ \ls -> ls { lsState = P.drop n (lsState ls) }+nextState Push _ =+ modify $ \ls -> ls { lsState = P.head (lsState ls) : lsState ls }+nextState (GoTo n) _ =+ modify $ \ls -> ls { lsState = n : lsState ls }+nextState (CapturesTo f) cs =+ modify $ \ls -> ls { lsState = f (map fromBS cs) : lsState ls }+ where+ fromBS = map (toEnum . fromEnum) . BS.unpack+nextState (DoAll nss) cs = mapM_ (flip nextState cs) nss+nextState (Combined nss) _ =+ modify $ \ls -> ls { lsState = P.concat nss : lsState ls }
+ src/Text/Highlighter/Lexers.hs view
@@ -0,0 +1,236 @@+module Text.Highlighter.Lexers where++import Text.Highlighter.Types++import qualified Text.Highlighter.Lexers.ABAP+import qualified Text.Highlighter.Lexers.ActionScript+import qualified Text.Highlighter.Lexers.ActionScript3+import qualified Text.Highlighter.Lexers.Ada+import qualified Text.Highlighter.Lexers.Antlr+import qualified Text.Highlighter.Lexers.ApacheConf+import qualified Text.Highlighter.Lexers.AppleScript+import qualified Text.Highlighter.Lexers.Asymptote+import qualified Text.Highlighter.Lexers.Atomo+import qualified Text.Highlighter.Lexers.Autohotkey+import qualified Text.Highlighter.Lexers.Bash+import qualified Text.Highlighter.Lexers.Batch+import qualified Text.Highlighter.Lexers.BBCode+import qualified Text.Highlighter.Lexers.Befunge+import qualified Text.Highlighter.Lexers.BlitzMax+import qualified Text.Highlighter.Lexers.Boo+import qualified Text.Highlighter.Lexers.Brainfuck+import qualified Text.Highlighter.Lexers.C+import qualified Text.Highlighter.Lexers.Clojure+import qualified Text.Highlighter.Lexers.CMake+import qualified Text.Highlighter.Lexers.CoffeeScript+import qualified Text.Highlighter.Lexers.Coldfusion+import qualified Text.Highlighter.Lexers.CommonLisp+import qualified Text.Highlighter.Lexers.Cpp+import qualified Text.Highlighter.Lexers.Css+import qualified Text.Highlighter.Lexers.Cython+import qualified Text.Highlighter.Lexers.D+import qualified Text.Highlighter.Lexers.DarcsPatch+import qualified Text.Highlighter.Lexers.DebianControl+import qualified Text.Highlighter.Lexers.Diff+import qualified Text.Highlighter.Lexers.Django+import qualified Text.Highlighter.Lexers.Duel+import qualified Text.Highlighter.Lexers.Dylan+import qualified Text.Highlighter.Lexers.Erlang+import qualified Text.Highlighter.Lexers.Factor+import qualified Text.Highlighter.Lexers.Felix+import qualified Text.Highlighter.Lexers.Fortran+import qualified Text.Highlighter.Lexers.Gas+import qualified Text.Highlighter.Lexers.GenshiText+import qualified Text.Highlighter.Lexers.Gettext+import qualified Text.Highlighter.Lexers.Gherkin+import qualified Text.Highlighter.Lexers.GLShader+import qualified Text.Highlighter.Lexers.Gnuplot+import qualified Text.Highlighter.Lexers.Go+import qualified Text.Highlighter.Lexers.GoodDataCL+import qualified Text.Highlighter.Lexers.Groff+import qualified Text.Highlighter.Lexers.Haskell+import qualified Text.Highlighter.Lexers.Haxe+import qualified Text.Highlighter.Lexers.Html+import qualified Text.Highlighter.Lexers.Hybris+import qualified Text.Highlighter.Lexers.Ini+import qualified Text.Highlighter.Lexers.Io+import qualified Text.Highlighter.Lexers.Ioke+import qualified Text.Highlighter.Lexers.IrcLogs+import qualified Text.Highlighter.Lexers.Java+import qualified Text.Highlighter.Lexers.Javascript+import qualified Text.Highlighter.Lexers.LighttpdConf+import qualified Text.Highlighter.Lexers.Llvm+import qualified Text.Highlighter.Lexers.Logtalk+import qualified Text.Highlighter.Lexers.Lua+import qualified Text.Highlighter.Lexers.Mako+import qualified Text.Highlighter.Lexers.Maql+import qualified Text.Highlighter.Lexers.Matlab+import qualified Text.Highlighter.Lexers.MiniD+import qualified Text.Highlighter.Lexers.Modelica+import qualified Text.Highlighter.Lexers.Modula2+import qualified Text.Highlighter.Lexers.MoinWiki+import qualified Text.Highlighter.Lexers.MOOCode+import qualified Text.Highlighter.Lexers.MuPAD+import qualified Text.Highlighter.Lexers.Mxml+import qualified Text.Highlighter.Lexers.MySql+import qualified Text.Highlighter.Lexers.Nasm+import qualified Text.Highlighter.Lexers.Newspeak+import qualified Text.Highlighter.Lexers.NginxConf+import qualified Text.Highlighter.Lexers.NumPy+import qualified Text.Highlighter.Lexers.Objdump+import qualified Text.Highlighter.Lexers.ObjectiveC+import qualified Text.Highlighter.Lexers.ObjectiveJ+import qualified Text.Highlighter.Lexers.Ocaml+import qualified Text.Highlighter.Lexers.Ooc+import qualified Text.Highlighter.Lexers.Perl+import qualified Text.Highlighter.Lexers.Php+import qualified Text.Highlighter.Lexers.PostScript+import qualified Text.Highlighter.Lexers.Povray+import qualified Text.Highlighter.Lexers.Prolog+import qualified Text.Highlighter.Lexers.Properties+import qualified Text.Highlighter.Lexers.ProtoBuf+import qualified Text.Highlighter.Lexers.Python+import qualified Text.Highlighter.Lexers.Python3+import qualified Text.Highlighter.Lexers.Python3Traceback+import qualified Text.Highlighter.Lexers.PythonTraceback+import qualified Text.Highlighter.Lexers.Ragel+import qualified Text.Highlighter.Lexers.RagelEmbedded+import qualified Text.Highlighter.Lexers.Redcode+import qualified Text.Highlighter.Lexers.S+import qualified Text.Highlighter.Lexers.Scala+import qualified Text.Highlighter.Lexers.Scheme+import qualified Text.Highlighter.Lexers.Scss+import qualified Text.Highlighter.Lexers.Smalltalk+import qualified Text.Highlighter.Lexers.Smarty+import qualified Text.Highlighter.Lexers.SourcesList+import qualified Text.Highlighter.Lexers.Sql+import qualified Text.Highlighter.Lexers.SquidConf+import qualified Text.Highlighter.Lexers.Tcl+import qualified Text.Highlighter.Lexers.Tcsh+import qualified Text.Highlighter.Lexers.Tex+import qualified Text.Highlighter.Lexers.Vala+import qualified Text.Highlighter.Lexers.VbNet+import qualified Text.Highlighter.Lexers.Velocity+import qualified Text.Highlighter.Lexers.Verilog+import qualified Text.Highlighter.Lexers.Vim+import qualified Text.Highlighter.Lexers.Xml+import qualified Text.Highlighter.Lexers.Xslt+++lexers :: [(String, Lexer)]+lexers = concat+ [ map (\e -> (e, Text.Highlighter.Lexers.ABAP.lexer)) (lExtensions Text.Highlighter.Lexers.ABAP.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.ActionScript.lexer)) (lExtensions Text.Highlighter.Lexers.ActionScript.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.ActionScript3.lexer)) (lExtensions Text.Highlighter.Lexers.ActionScript3.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Ada.lexer)) (lExtensions Text.Highlighter.Lexers.Ada.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Antlr.lexer)) (lExtensions Text.Highlighter.Lexers.Antlr.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.ApacheConf.lexer)) (lExtensions Text.Highlighter.Lexers.ApacheConf.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.AppleScript.lexer)) (lExtensions Text.Highlighter.Lexers.AppleScript.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Asymptote.lexer)) (lExtensions Text.Highlighter.Lexers.Asymptote.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Atomo.lexer)) (lExtensions Text.Highlighter.Lexers.Atomo.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Autohotkey.lexer)) (lExtensions Text.Highlighter.Lexers.Autohotkey.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Bash.lexer)) (lExtensions Text.Highlighter.Lexers.Bash.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Batch.lexer)) (lExtensions Text.Highlighter.Lexers.Batch.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.BBCode.lexer)) (lExtensions Text.Highlighter.Lexers.BBCode.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Befunge.lexer)) (lExtensions Text.Highlighter.Lexers.Befunge.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.BlitzMax.lexer)) (lExtensions Text.Highlighter.Lexers.BlitzMax.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Boo.lexer)) (lExtensions Text.Highlighter.Lexers.Boo.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Brainfuck.lexer)) (lExtensions Text.Highlighter.Lexers.Brainfuck.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.C.lexer)) (lExtensions Text.Highlighter.Lexers.C.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Clojure.lexer)) (lExtensions Text.Highlighter.Lexers.Clojure.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.CMake.lexer)) (lExtensions Text.Highlighter.Lexers.CMake.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.CoffeeScript.lexer)) (lExtensions Text.Highlighter.Lexers.CoffeeScript.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Coldfusion.lexer)) (lExtensions Text.Highlighter.Lexers.Coldfusion.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.CommonLisp.lexer)) (lExtensions Text.Highlighter.Lexers.CommonLisp.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Cpp.lexer)) (lExtensions Text.Highlighter.Lexers.Cpp.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Css.lexer)) (lExtensions Text.Highlighter.Lexers.Css.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Cython.lexer)) (lExtensions Text.Highlighter.Lexers.Cython.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.D.lexer)) (lExtensions Text.Highlighter.Lexers.D.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.DarcsPatch.lexer)) (lExtensions Text.Highlighter.Lexers.DarcsPatch.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.DebianControl.lexer)) (lExtensions Text.Highlighter.Lexers.DebianControl.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Diff.lexer)) (lExtensions Text.Highlighter.Lexers.Diff.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Django.lexer)) (lExtensions Text.Highlighter.Lexers.Django.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Duel.lexer)) (lExtensions Text.Highlighter.Lexers.Duel.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Dylan.lexer)) (lExtensions Text.Highlighter.Lexers.Dylan.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Erlang.lexer)) (lExtensions Text.Highlighter.Lexers.Erlang.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Factor.lexer)) (lExtensions Text.Highlighter.Lexers.Factor.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Felix.lexer)) (lExtensions Text.Highlighter.Lexers.Felix.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Fortran.lexer)) (lExtensions Text.Highlighter.Lexers.Fortran.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Gas.lexer)) (lExtensions Text.Highlighter.Lexers.Gas.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.GenshiText.lexer)) (lExtensions Text.Highlighter.Lexers.GenshiText.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Gettext.lexer)) (lExtensions Text.Highlighter.Lexers.Gettext.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Gherkin.lexer)) (lExtensions Text.Highlighter.Lexers.Gherkin.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.GLShader.lexer)) (lExtensions Text.Highlighter.Lexers.GLShader.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Gnuplot.lexer)) (lExtensions Text.Highlighter.Lexers.Gnuplot.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Go.lexer)) (lExtensions Text.Highlighter.Lexers.Go.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.GoodDataCL.lexer)) (lExtensions Text.Highlighter.Lexers.GoodDataCL.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Groff.lexer)) (lExtensions Text.Highlighter.Lexers.Groff.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Haskell.lexer)) (lExtensions Text.Highlighter.Lexers.Haskell.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Haxe.lexer)) (lExtensions Text.Highlighter.Lexers.Haxe.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Html.lexer)) (lExtensions Text.Highlighter.Lexers.Html.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Hybris.lexer)) (lExtensions Text.Highlighter.Lexers.Hybris.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Ini.lexer)) (lExtensions Text.Highlighter.Lexers.Ini.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Io.lexer)) (lExtensions Text.Highlighter.Lexers.Io.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Ioke.lexer)) (lExtensions Text.Highlighter.Lexers.Ioke.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.IrcLogs.lexer)) (lExtensions Text.Highlighter.Lexers.IrcLogs.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Java.lexer)) (lExtensions Text.Highlighter.Lexers.Java.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Javascript.lexer)) (lExtensions Text.Highlighter.Lexers.Javascript.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.LighttpdConf.lexer)) (lExtensions Text.Highlighter.Lexers.LighttpdConf.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Llvm.lexer)) (lExtensions Text.Highlighter.Lexers.Llvm.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Logtalk.lexer)) (lExtensions Text.Highlighter.Lexers.Logtalk.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Lua.lexer)) (lExtensions Text.Highlighter.Lexers.Lua.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Mako.lexer)) (lExtensions Text.Highlighter.Lexers.Mako.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Maql.lexer)) (lExtensions Text.Highlighter.Lexers.Maql.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Matlab.lexer)) (lExtensions Text.Highlighter.Lexers.Matlab.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.MiniD.lexer)) (lExtensions Text.Highlighter.Lexers.MiniD.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Modelica.lexer)) (lExtensions Text.Highlighter.Lexers.Modelica.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Modula2.lexer)) (lExtensions Text.Highlighter.Lexers.Modula2.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.MoinWiki.lexer)) (lExtensions Text.Highlighter.Lexers.MoinWiki.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.MOOCode.lexer)) (lExtensions Text.Highlighter.Lexers.MOOCode.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.MuPAD.lexer)) (lExtensions Text.Highlighter.Lexers.MuPAD.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Mxml.lexer)) (lExtensions Text.Highlighter.Lexers.Mxml.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.MySql.lexer)) (lExtensions Text.Highlighter.Lexers.MySql.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Nasm.lexer)) (lExtensions Text.Highlighter.Lexers.Nasm.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Newspeak.lexer)) (lExtensions Text.Highlighter.Lexers.Newspeak.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.NginxConf.lexer)) (lExtensions Text.Highlighter.Lexers.NginxConf.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.NumPy.lexer)) (lExtensions Text.Highlighter.Lexers.NumPy.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Objdump.lexer)) (lExtensions Text.Highlighter.Lexers.Objdump.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.ObjectiveC.lexer)) (lExtensions Text.Highlighter.Lexers.ObjectiveC.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.ObjectiveJ.lexer)) (lExtensions Text.Highlighter.Lexers.ObjectiveJ.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Ocaml.lexer)) (lExtensions Text.Highlighter.Lexers.Ocaml.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Ooc.lexer)) (lExtensions Text.Highlighter.Lexers.Ooc.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Perl.lexer)) (lExtensions Text.Highlighter.Lexers.Perl.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Php.lexer)) (lExtensions Text.Highlighter.Lexers.Php.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.PostScript.lexer)) (lExtensions Text.Highlighter.Lexers.PostScript.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Povray.lexer)) (lExtensions Text.Highlighter.Lexers.Povray.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Prolog.lexer)) (lExtensions Text.Highlighter.Lexers.Prolog.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Properties.lexer)) (lExtensions Text.Highlighter.Lexers.Properties.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.ProtoBuf.lexer)) (lExtensions Text.Highlighter.Lexers.ProtoBuf.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Python.lexer)) (lExtensions Text.Highlighter.Lexers.Python.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Python3.lexer)) (lExtensions Text.Highlighter.Lexers.Python3.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Python3Traceback.lexer)) (lExtensions Text.Highlighter.Lexers.Python3Traceback.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.PythonTraceback.lexer)) (lExtensions Text.Highlighter.Lexers.PythonTraceback.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Ragel.lexer)) (lExtensions Text.Highlighter.Lexers.Ragel.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.RagelEmbedded.lexer)) (lExtensions Text.Highlighter.Lexers.RagelEmbedded.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Redcode.lexer)) (lExtensions Text.Highlighter.Lexers.Redcode.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.S.lexer)) (lExtensions Text.Highlighter.Lexers.S.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Scala.lexer)) (lExtensions Text.Highlighter.Lexers.Scala.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Scheme.lexer)) (lExtensions Text.Highlighter.Lexers.Scheme.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Scss.lexer)) (lExtensions Text.Highlighter.Lexers.Scss.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Smalltalk.lexer)) (lExtensions Text.Highlighter.Lexers.Smalltalk.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Smarty.lexer)) (lExtensions Text.Highlighter.Lexers.Smarty.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.SourcesList.lexer)) (lExtensions Text.Highlighter.Lexers.SourcesList.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Sql.lexer)) (lExtensions Text.Highlighter.Lexers.Sql.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.SquidConf.lexer)) (lExtensions Text.Highlighter.Lexers.SquidConf.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Tcl.lexer)) (lExtensions Text.Highlighter.Lexers.Tcl.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Tcsh.lexer)) (lExtensions Text.Highlighter.Lexers.Tcsh.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Tex.lexer)) (lExtensions Text.Highlighter.Lexers.Tex.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Vala.lexer)) (lExtensions Text.Highlighter.Lexers.Vala.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.VbNet.lexer)) (lExtensions Text.Highlighter.Lexers.VbNet.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Velocity.lexer)) (lExtensions Text.Highlighter.Lexers.Velocity.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Verilog.lexer)) (lExtensions Text.Highlighter.Lexers.Verilog.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Vim.lexer)) (lExtensions Text.Highlighter.Lexers.Vim.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Xml.lexer)) (lExtensions Text.Highlighter.Lexers.Xml.lexer)+ , map (\e -> (e, Text.Highlighter.Lexers.Xslt.lexer)) (lExtensions Text.Highlighter.Lexers.Xslt.lexer)+ ]+
+ src/Text/Highlighter/Lexers/ABAP.hs view
@@ -0,0 +1,52 @@+module Text.Highlighter.Lexers.ABAP (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "ABAP"+ , lAliases = ["abap"]+ , lExtensions = [".abap"]+ , lMimetypes = ["text/x-abap"]+ , lStart = root'+ , lFlags = [caseless, multiline]+ }++variableNames' :: TokenMatcher+variableNames' =+ [ tok "<[\\S_]+>" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "[\\w][\\w_\126]*(?:(\\[\\])|->\\*)?" (Arbitrary "Name" :. Arbitrary "Variable")+ ]++root' :: TokenMatcher+root' =+ [ anyOf common'+ , tok "(CALL\\s+(?:BADI|CUSTOMER-FUNCTION|FUNCTION))(\\s+)(\\'?\\S+\\'?)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function")])+ , tok "(CALL\\s+(?:DIALOG|SCREEN|SUBSCREEN|SELECTION-SCREEN|TRANSACTION|TRANSFORMATION))\\b" (Arbitrary "Keyword")+ , tok "(FORM|PERFORM)(\\s+)([\\w_]+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function")])+ , tok "(PERFORM)(\\s+)(\\()([\\w_]+)(\\))" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Punctuation"), (Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Punctuation")])+ , tok "(MODULE)(\\s+)(\\S+)(\\s+)(INPUT|OUTPUT)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Keyword")])+ , tok "(METHOD)(\\s+)([\\w_\126]+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function")])+ , tok "(\\s+)([\\w_\\-]+)([=\\-]>)([\\w_\\-\126]+)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Operator"), (Arbitrary "Name" :. Arbitrary "Function")])+ , tok "(?<=(=|-)>)([\\w_\\-\126]+)(?=\\()" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "(ADD-CORRESPONDING|AUTHORITY-CHECK|CLASS-DATA|CLASS-EVENTS|CLASS-METHODS|CLASS-POOL|DELETE-ADJACENT|DIVIDE-CORRESPONDING|EDITOR-CALL|ENHANCEMENT-POINT|ENHANCEMENT-SECTION|EXIT-COMMAND|FIELD-GROUPS|FIELD-SYMBOLS|FUNCTION-POOL|INTERFACE-POOL|INVERTED-DATE|LOAD-OF-PROGRAM|LOG-POINT|MESSAGE-ID|MOVE-CORRESPONDING|MULTIPLY-CORRESPONDING|NEW-LINE|NEW-PAGE|NEW-SECTION|NO-EXTENSION|OUTPUT-LENGTH|PRINT-CONTROL|SELECT-OPTIONS|START-OF-SELECTION|SUBTRACT-CORRESPONDING|SYNTAX-CHECK|SYSTEM-EXCEPTIONS|TYPE-POOL|TYPE-POOLS)\\b" (Arbitrary "Keyword")+ , tok "CREATE\\s+(PUBLIC|PRIVATE|DATA|OBJECT)|((PUBLIC|PRIVATE|PROTECTED)\\s+SECTION|(TYPE|LIKE)(\\s+(LINE\\s+OF|REF\\s+TO|(SORTED|STANDARD|HASHED)\\s+TABLE\\s+OF))?|FROM\\s+(DATABASE|MEMORY)|CALL\\s+METHOD|(GROUP|ORDER) BY|HAVING|SEPARATED BY|GET\\s+(BADI|BIT|CURSOR|DATASET|LOCALE|PARAMETER|PF-STATUS|(PROPERTY|REFERENCE)\\s+OF|RUN\\s+TIME|TIME\\s+(STAMP)?)?|SET\\s+(BIT|BLANK\\s+LINES|COUNTRY|CURSOR|DATASET|EXTENDED\\s+CHECK|HANDLER|HOLD\\s+DATA|LANGUAGE|LEFT\\s+SCROLL-BOUNDARY|LOCALE|MARGIN|PARAMETER|PF-STATUS|PROPERTY\\s+OF|RUN\\s+TIME\\s+(ANALYZER|CLOCK\\s+RESOLUTION)|SCREEN|TITLEBAR|UPADTE\\s+TASK\\s+LOCAL|USER-COMMAND)|CONVERT\\s+((INVERTED-)?DATE|TIME|TIME\\s+STAMP|TEXT)|(CLOSE|OPEN)\\s+(DATASET|CURSOR)|(TO|FROM)\\s+(DATA BUFFER|INTERNAL TABLE|MEMORY ID|DATABASE|SHARED\\s+(MEMORY|BUFFER))|DESCRIBE\\s+(DISTANCE\\s+BETWEEN|FIELD|LIST|TABLE)|FREE\\s(MEMORY|OBJECT)?|PROCESS\\s+(BEFORE\\s+OUTPUT|AFTER\\s+INPUT|ON\\s+(VALUE-REQUEST|HELP-REQUEST))|AT\\s+(LINE-SELECTION|USER-COMMAND|END\\s+OF|NEW)|AT\\s+SELECTION-SCREEN(\\s+(ON(\\s+(BLOCK|(HELP|VALUE)-REQUEST\\s+FOR|END\\s+OF|RADIOBUTTON\\s+GROUP))?|OUTPUT))?|SELECTION-SCREEN:?\\s+((BEGIN|END)\\s+OF\\s+((TABBED\\s+)?BLOCK|LINE|SCREEN)|COMMENT|FUNCTION\\s+KEY|INCLUDE\\s+BLOCKS|POSITION|PUSHBUTTON|SKIP|ULINE)|LEAVE\\s+(LIST-PROCESSING|PROGRAM|SCREEN|TO LIST-PROCESSING|TO TRANSACTION)(ENDING|STARTING)\\s+AT|FORMAT\\s+(COLOR|INTENSIFIED|INVERSE|HOTSPOT|INPUT|FRAMES|RESET)|AS\\s+(CHECKBOX|SUBSCREEN|WINDOW)|WITH\\s+(((NON-)?UNIQUE)?\\s+KEY|FRAME)|(BEGIN|END)\\s+OF|DELETE(\\s+ADJACENT\\s+DUPLICATES\\sFROM)?|COMPARING(\\s+ALL\\s+FIELDS)?|INSERT(\\s+INITIAL\\s+LINE\\s+INTO|\\s+LINES\\s+OF)?|IN\\s+((BYTE|CHARACTER)\\s+MODE|PROGRAM)|END-OF-(DEFINITION|PAGE|SELECTION)|WITH\\s+FRAME(\\s+TITLE)|AND\\s+(MARK|RETURN)|CLIENT\\s+SPECIFIED|CORRESPONDING\\s+FIELDS\\s+OF|IF\\s+FOUND|FOR\\s+EVENT|INHERITING\\s+FROM|LEAVE\\s+TO\\s+SCREEN|LOOP\\s+AT\\s+(SCREEN)?|LOWER\\s+CASE|MATCHCODE\\s+OBJECT|MODIF\\s+ID|MODIFY\\s+SCREEN|NESTING\\s+LEVEL|NO\\s+INTERVALS|OF\\s+STRUCTURE|RADIOBUTTON\\s+GROUP|RANGE\\s+OF|REF\\s+TO|SUPPRESS DIALOG|TABLE\\s+OF|UPPER\\s+CASE|TRANSPORTING\\s+NO\\s+FIELDS|VALUE\\s+CHECK|VISIBLE\\s+LENGTH|HEADER\\s+LINE)\\b" (Arbitrary "Keyword")+ , tok "(^|(?<=(\\s|\\.)))(ABBREVIATED|ADD|ALIASES|APPEND|ASSERT|ASSIGN(ING)?|AT(\\s+FIRST)?|BACK|BLOCK|BREAK-POINT|CASE|CATCH|CHANGING|CHECK|CLASS|CLEAR|COLLECT|COLOR|COMMIT|CREATE|COMMUNICATION|COMPONENTS?|COMPUTE|CONCATENATE|CONDENSE|CONSTANTS|CONTEXTS|CONTINUE|CONTROLS|DATA|DECIMALS|DEFAULT|DEFINE|DEFINITION|DEFERRED|DEMAND|DETAIL|DIRECTORY|DIVIDE|DO|ELSE(IF)?|ENDAT|ENDCASE|ENDCLASS|ENDDO|ENDFORM|ENDFUNCTION|ENDIF|ENDLOOP|ENDMETHOD|ENDMODULE|ENDSELECT|ENDTRY|ENHANCEMENT|EVENTS|EXCEPTIONS|EXIT|EXPORT|EXPORTING|EXTRACT|FETCH|FIELDS?|FIND|FOR|FORM|FORMAT|FREE|FROM|HIDE|ID|IF|IMPORT|IMPLEMENTATION|IMPORTING|IN|INCLUDE|INCLUDING|INDEX|INFOTYPES|INITIALIZATION|INTERFACE|INTERFACES|INTO|LENGTH|LINES|LOAD|LOCAL|JOIN|KEY|MAXIMUM|MESSAGE|METHOD[S]?|MINIMUM|MODULE|MODIFY|MOVE|MULTIPLY|NODES|OBLIGATORY|OF|OFF|ON|OVERLAY|PACK|PARAMETERS|PERCENTAGE|POSITION|PROGRAM|PROVIDE|PUBLIC|PUT|RAISE|RAISING|RANGES|READ|RECEIVE|REFRESH|REJECT|REPORT|RESERVE|RESUME|RETRY|RETURN|RETURNING|RIGHT|ROLLBACK|SCROLL|SEARCH|SELECT|SHIFT|SINGLE|SKIP|SORT|SPLIT|STATICS|STOP|SUBMIT|SUBTRACT|SUM|SUMMARY|SUMMING|SUPPLY|TABLE|TABLES|TIMES|TITLE|TO|TOP-OF-PAGE|TRANSFER|TRANSLATE|TRY|TYPES|ULINE|UNDER|UNPACK|UPDATE|USING|VALUE|VALUES|VIA|WAIT|WHEN|WHERE|WHILE|WITH|WINDOW|WRITE)\\b" (Arbitrary "Keyword")+ , tok "(abs|acos|asin|atan|boolc|boolx|bit_set|char_off|charlen|ceil|cmax|cmin|condense|contains|contains_any_of|contains_any_not_of|concat_lines_of|cos|cosh|count|count_any_of|count_any_not_of|dbmaxlen|distance|escape|exp|find|find_end|find_any_of|find_any_not_of|floor|frac|from_mixed|insert|lines|log|log10|match|matches|nmax|nmin|numofchar|repeat|replace|rescale|reverse|round|segment|shift_left|shift_right|sign|sin|sinh|sqrt|strlen|substring|substring_after|substring_from|substring_before|substring_to|tan|tanh|to_upper|to_lower|to_mixed|translate|trunc|xstrlen)(\\()\\b" (ByGroups [(Arbitrary "Name" :. Arbitrary "Builtin"), (Arbitrary "Punctuation")])+ , tok "&[0-9]" (Arbitrary "Name")+ , tok "[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "(?<=(\\s|.))(AND|EQ|NE|GT|LT|GE|LE|CO|CN|CA|NA|CS|NOT|NS|CP|NP|BYTE-CO|BYTE-CN|BYTE-CA|BYTE-NA|BYTE-CS|BYTE-NS|IS\\s+(NOT\\s+)?(INITIAL|ASSIGNED|REQUESTED|BOUND))\\b" (Arbitrary "Operator")+ , anyOf variableNames'+ , tok "[?*<>=\\-+]" (Arbitrary "Operator")+ , tok "'(''|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "[/;:()\\[\\],\\.]" (Arbitrary "Punctuation")+ ]++common' :: TokenMatcher+common' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "^\\*.*$" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "\\\".*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ ]+
+ src/Text/Highlighter/Lexers/ActionScript.hs view
@@ -0,0 +1,36 @@+module Text.Highlighter.Lexers.ActionScript (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "ActionScript"+ , lAliases = ["as", "actionscript"]+ , lExtensions = [".as"]+ , lMimetypes = ["application/x-actionscript", "text/x-actionscript", "text/actionscript"]+ , lStart = root'+ , lFlags = [dotall]+ }++root' :: TokenMatcher+root' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "//.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/\\*.*?\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "/(\\\\\\\\|\\\\/|[^/\\n])*/[gim]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ , tok "[\126\\^\\*!%&<>\\|+=:;,/?\\\\-]+" (Arbitrary "Operator")+ , tok "[{}\\[\\]();.]+" (Arbitrary "Punctuation")+ , tok "(case|default|for|each|in|while|do|break|return|continue|if|else|throw|try|catch|var|with|new|typeof|arguments|instanceof|this|switch)\\b" (Arbitrary "Keyword")+ , tok "(class|public|final|internal|native|override|private|protected|static|import|extends|implements|interface|intrinsic|return|super|dynamic|function|const|get|namespace|package|set)\\b" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , tok "(true|false|null|NaN|Infinity|-Infinity|undefined|Void)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tok "(Accessibility|AccessibilityProperties|ActionScriptVersion|ActivityEvent|AntiAliasType|ApplicationDomain|AsBroadcaster|Array|AsyncErrorEvent|AVM1Movie|BevelFilter|Bitmap|BitmapData|BitmapDataChannel|BitmapFilter|BitmapFilterQuality|BitmapFilterType|BlendMode|BlurFilter|Boolean|ByteArray|Camera|Capabilities|CapsStyle|Class|Color|ColorMatrixFilter|ColorTransform|ContextMenu|ContextMenuBuiltInItems|ContextMenuEvent|ContextMenuItem|ConvultionFilter|CSMSettings|DataEvent|Date|DefinitionError|DeleteObjectSample|Dictionary|DisplacmentMapFilter|DisplayObject|DisplacmentMapFilterMode|DisplayObjectContainer|DropShadowFilter|Endian|EOFError|Error|ErrorEvent|EvalError|Event|EventDispatcher|EventPhase|ExternalInterface|FileFilter|FileReference|FileReferenceList|FocusDirection|FocusEvent|Font|FontStyle|FontType|FrameLabel|FullScreenEvent|Function|GlowFilter|GradientBevelFilter|GradientGlowFilter|GradientType|Graphics|GridFitType|HTTPStatusEvent|IBitmapDrawable|ID3Info|IDataInput|IDataOutput|IDynamicPropertyOutputIDynamicPropertyWriter|IEventDispatcher|IExternalizable|IllegalOperationError|IME|IMEConversionMode|IMEEvent|int|InteractiveObject|InterpolationMethod|InvalidSWFError|InvokeEvent|IOError|IOErrorEvent|JointStyle|Key|Keyboard|KeyboardEvent|KeyLocation|LineScaleMode|Loader|LoaderContext|LoaderInfo|LoadVars|LocalConnection|Locale|Math|Matrix|MemoryError|Microphone|MorphShape|Mouse|MouseEvent|MovieClip|MovieClipLoader|Namespace|NetConnection|NetStatusEvent|NetStream|NewObjectSample|Number|Object|ObjectEncoding|PixelSnapping|Point|PrintJob|PrintJobOptions|PrintJobOrientation|ProgressEvent|Proxy|QName|RangeError|Rectangle|ReferenceError|RegExp|Responder|Sample|Scene|ScriptTimeoutError|Security|SecurityDomain|SecurityError|SecurityErrorEvent|SecurityPanel|Selection|Shape|SharedObject|SharedObjectFlushStatus|SimpleButton|Socket|Sound|SoundChannel|SoundLoaderContext|SoundMixer|SoundTransform|SpreadMethod|Sprite|StackFrame|StackOverflowError|Stage|StageAlign|StageDisplayState|StageQuality|StageScaleMode|StaticText|StatusEvent|String|StyleSheet|SWFVersion|SyncEvent|SyntaxError|System|TextColorType|TextField|TextFieldAutoSize|TextFieldType|TextFormat|TextFormatAlign|TextLineMetrics|TextRenderer|TextSnapshot|Timer|TimerEvent|Transform|TypeError|uint|URIError|URLLoader|URLLoaderDataFormat|URLRequest|URLRequestHeader|URLRequestMethod|URLStream|URLVariabeles|VerifyError|Video|XML|XMLDocument|XMLList|XMLNode|XMLNodeType|XMLSocket|XMLUI)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(decodeURI|decodeURIComponent|encodeURI|escape|eval|isFinite|isNaN|isXMLName|clearInterval|fscommand|getTimer|getURL|getVersion|isFinite|parseFloat|parseInt|setInterval|trace|updateAfterEvent|unescape)\\b" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "[$a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Other")+ , tok "[0-9][0-9]*\\.[0-9]+([eE][0-9]+)?[fd]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0x[0-9a-f]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "'(\\\\\\\\|\\\\'|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ ]+
+ src/Text/Highlighter/Lexers/ActionScript3.hs view
@@ -0,0 +1,58 @@+module Text.Highlighter.Lexers.ActionScript3 (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "ActionScript 3"+ , lAliases = ["as3", "actionscript3"]+ , lExtensions = [".as"]+ , lMimetypes = ["application/x-actionscript", "text/x-actionscript", "text/actionscript"]+ , lStart = root'+ , lFlags = [multiline, dotall]+ }++defval' :: TokenMatcher+defval' =+ [ tokNext "(=)(\\s*)([^(),]+)(\\s*)(,?)" (ByGroups [(Arbitrary "Operator"), (Arbitrary "Text"), (Using lexer), (Arbitrary "Text"), (Arbitrary "Operator")]) Pop+ , tokNext ",?" (Arbitrary "Operator") Pop+ ]++type' :: TokenMatcher+type' =+ [ tokNext "(\\s*)(:)(\\s*)([$a-zA-Z_][a-zA-Z0-9_]*|\\*)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Operator"), (Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Type")]) (PopNum 2)+ , tokNext "\\s*" (Arbitrary "Text") (PopNum 2)+ ]++root' :: TokenMatcher+root' =+ [ tok "\\s+" (Arbitrary "Text")+ , tokNext "(function\\s+)([$a-zA-Z_][a-zA-Z0-9_]*)(\\s*)(\\()" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Declaration"), (Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Operator")]) (GoTo funcparams')+ , tok "(var|const)(\\s+)([$a-zA-Z_][a-zA-Z0-9_]*)(\\s*)(:)(\\s*)([$a-zA-Z_][a-zA-Z0-9_]*)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Declaration"), (Arbitrary "Text"), (Arbitrary "Name"), (Arbitrary "Text"), (Arbitrary "Punctuation"), (Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Type")])+ , tok "(import|package)(\\s+)((?:[$a-zA-Z_][a-zA-Z0-9_]*|\\.)+)(\\s*)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Namespace"), (Arbitrary "Text")])+ , tok "(new)(\\s+)([$a-zA-Z_][a-zA-Z0-9_]*)(\\s*)(\\()" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Type"), (Arbitrary "Text"), (Arbitrary "Operator")])+ , tok "//.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/\\*.*?\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "/(\\\\\\\\|\\\\/|[^\\n])*/[gisx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ , tok "(\\.)([$a-zA-Z_][a-zA-Z0-9_]*)" (ByGroups [(Arbitrary "Operator"), (Arbitrary "Name" :. Arbitrary "Attribute")])+ , tok "(case|default|for|each|in|while|do|break|return|continue|if|else|throw|try|catch|with|new|typeof|arguments|instanceof|this|switch|import|include|as|is)\\b" (Arbitrary "Keyword")+ , tok "(class|public|final|internal|native|override|private|protected|static|import|extends|implements|interface|intrinsic|return|super|dynamic|function|const|get|namespace|package|set)\\b" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , tok "(true|false|null|NaN|Infinity|-Infinity|undefined|void)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tok "(decodeURI|decodeURIComponent|encodeURI|escape|eval|isFinite|isNaN|isXMLName|clearInterval|fscommand|getTimer|getURL|getVersion|isFinite|parseFloat|parseInt|setInterval|trace|updateAfterEvent|unescape)\\b" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "[$a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name")+ , tok "[0-9][0-9]*\\.[0-9]+([eE][0-9]+)?[fd]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0x[0-9a-f]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "'(\\\\\\\\|\\\\'|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "[\126\\^\\*!%&<>\\|+=:;,/?\\\\{}\\[\\]();.-]+" (Arbitrary "Operator")+ ]++funcparams' :: TokenMatcher+funcparams' =+ [ tok "\\s+" (Arbitrary "Text")+ , tokNext "(\\s*)(\\.\\.\\.)?([$a-zA-Z_][a-zA-Z0-9_]*)(\\s*)(:)(\\s*)([$a-zA-Z_][a-zA-Z0-9_]*|\\*)(\\s*)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Punctuation"), (Arbitrary "Name"), (Arbitrary "Text"), (Arbitrary "Operator"), (Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Type"), (Arbitrary "Text")]) (GoTo defval')+ , tokNext "\\)" (Arbitrary "Operator") (GoTo type')+ ]+
+ src/Text/Highlighter/Lexers/Ada.hs view
@@ -0,0 +1,125 @@+module Text.Highlighter.Lexers.Ada (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Ada"+ , lAliases = ["ada", "ada95ada2005"]+ , lExtensions = [".adb", ".ads", ".ada"]+ , lMimetypes = ["text/x-ada"]+ , lStart = root'+ , lFlags = [caseless, multiline]+ }++package_instantiation' :: TokenMatcher+package_instantiation' =+ [ tok "(\"[^\"]+\"|[a-z0-9_]+)(\\s+)(=>)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Text"), (Arbitrary "Punctuation")])+ , tok "[a-z0-9._\\'\"]" (Arbitrary "Text")+ , tokNext "\\)" (Arbitrary "Punctuation") Pop+ , anyOf root'+ ]++formal_part' :: TokenMatcher+formal_part' =+ [ tokNext "\\)" (Arbitrary "Punctuation") Pop+ , tok "([a-z0-9_]+)(\\s*)(,|:[^=])" (ByGroups [(Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Text"), (Arbitrary "Punctuation")])+ , tok "(in|not|null|out|access)\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , anyOf root'+ ]++attribute' :: TokenMatcher+attribute' =+ [ tok "(')([a-zA-Z0-9_]+)" (ByGroups [(Arbitrary "Punctuation"), (Arbitrary "Name" :. Arbitrary "Attribute")])+ ]++subprogram' :: TokenMatcher+subprogram' =+ [ tokNext "\\(" (Arbitrary "Punctuation") (DoAll [Pop, (GoTo formal_part')])+ , tokNext ";" (Arbitrary "Punctuation") Pop+ , tokNext "is\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved") Pop+ , tok "\"[^\"]+\"|[a-z0-9_]+" (Arbitrary "Name" :. Arbitrary "Function")+ , anyOf root'+ ]++numbers' :: TokenMatcher+numbers' =+ [ tok "[0-9_]+#[0-9a-f]+#" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "[0-9_]+\\.[0-9_]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "[0-9_]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ ]++type_def' :: TokenMatcher+type_def' =+ [ tokNext ";" (Arbitrary "Punctuation") Pop+ , tokNext "\\(" (Arbitrary "Punctuation") (GoTo formal_part')+ , tok "with|and|use" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tokNext "array\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved") (DoAll [Pop, (GoTo array_def')])+ , tokNext "record\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved") (GoTo formal_part')+ , anyOf root'+ ]++end' :: TokenMatcher+end' =+ [ tok "(if|case|record|loop|select)" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "\"[^\"]+\"|[a-zA-Z0-9_]+" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "[\10\\s]+" (Arbitrary "Text")+ , tokNext ";" (Arbitrary "Punctuation") Pop+ ]++array_def' :: TokenMatcher+array_def' =+ [ tokNext ";" (Arbitrary "Punctuation") Pop+ , tok "([a-z0-9_]+)(\\s+)(range)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Type"), (Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Reserved")])+ , anyOf root'+ ]++package' :: TokenMatcher+package' =+ [ tok "body" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , tok "is\\s+new|renames" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tokNext "is" (Arbitrary "Keyword" :. Arbitrary "Reserved") Pop+ , tokNext ";" (Arbitrary "Punctuation") Pop+ , tokNext "\\(" (Arbitrary "Punctuation") (GoTo package_instantiation')+ , tok "([a-zA-Z0-9_.]+)" (Arbitrary "Name" :. Arbitrary "Class")+ , anyOf root'+ ]++import' :: TokenMatcher+import' =+ [ tokNext "[a-z0-9_.]+" (Arbitrary "Name" :. Arbitrary "Namespace") Pop+ ]++root' :: TokenMatcher+root' =+ [ tok "[^\\S\\n]+" (Arbitrary "Text")+ , tok "--.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "[^\\S\\n]+" (Arbitrary "Text")+ , tokNext "function|procedure|entry" (Arbitrary "Keyword" :. Arbitrary "Declaration") (GoTo subprogram')+ , tokNext "(subtype|type)(\\s+)([a-z0-9_]+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Declaration"), (Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Type")]) (GoTo type_def')+ , tok "task|protected" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , tok "(subtype)(\\s+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Declaration"), (Arbitrary "Text")])+ , tokNext "(end)(\\s+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Reserved"), (Arbitrary "Text")]) (GoTo end')+ , tok "(pragma)(\\s+)([a-zA-Z0-9_]+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Reserved"), (Arbitrary "Text"), (Arbitrary "Comment" :. Arbitrary "Preproc")])+ , tok "(true|false|null)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tok "(Byte|Character|Float|Integer|Long_Float|Long_Integer|Long_Long_Float|Long_Long_Integer|Natural|Positive|Short_Float|Short_Integer|Short_Short_Float|Short_Short_Integer|String|Wide_String|Duration)\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "(and(\\s+then)?|in|mod|not|or(\\s+else)|rem)\\b" (Arbitrary "Operator" :. Arbitrary "Word")+ , tok "generic|private" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , tokNext "package" (Arbitrary "Keyword" :. Arbitrary "Declaration") (GoTo package')+ , tokNext "array\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved") (GoTo array_def')+ , tokNext "(with|use)(\\s+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text")]) (GoTo import')+ , tok "([a-z0-9_]+)(\\s*)(:)(\\s*)(constant)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Constant"), (Arbitrary "Text"), (Arbitrary "Punctuation"), (Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Reserved")])+ , tok "<<[a-z0-9_]+>>" (Arbitrary "Name" :. Arbitrary "Label")+ , tok "([a-z0-9_]+)(\\s*)(:)(\\s*)(declare|begin|loop|for|while)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Label"), (Arbitrary "Text"), (Arbitrary "Punctuation"), (Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Reserved")])+ , tok "\\b(abort|abs|abstract|accept|access|aliased|all|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|interface|for|goto|if|is|limited|loop|new|null|of|or|others|out|overriding|pragma|protected|raise|range|record|renames|requeue|return|reverse|select|separate|subtype|synchronized|task|tagged|terminate|then|type|until|when|while|xor)\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "\"[^\"]*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , anyOf attribute'+ , anyOf numbers'+ , tok "'[^']'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Character")+ , tok "([a-z0-9_]+)(\\s*|[(,])" (ByGroups [(Arbitrary "Name"), (Using lexer)])+ , tok "(<>|=>|:=|[\\(\\)\\|:;,.'])" (Arbitrary "Punctuation")+ , tok "[*<>+=/&-]" (Arbitrary "Operator")+ , tok "\\n+" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Antlr.hs view
@@ -0,0 +1,118 @@+module Text.Highlighter.Lexers.Antlr (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "ANTLR"+ , lAliases = ["antlr"]+ , lExtensions = []+ , lMimetypes = []+ , lStart = root'+ , lFlags = [multiline]+ }++tokens' :: TokenMatcher+tokens' =+ [ anyOf whitespace'+ , anyOf comments'+ , tok "{" (Arbitrary "Punctuation")+ , tok "([A-Z][A-Za-z_0-9]*)(\\s*)(=)?(\\s*)(\\'(?:\\\\\\\\|\\\\\\'|[^\\']*)\\')?(\\s*)(;)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Label"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Punctuation"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Literal" :. Arbitrary "String"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Punctuation")])+ , tokNext "}" (Arbitrary "Punctuation") Pop+ ]++exception' :: TokenMatcher+exception' =+ [ tokNext "\\n" (Arbitrary "Text" :. Arbitrary "Whitespace") Pop+ , tok "\\s" (Arbitrary "Text" :. Arbitrary "Whitespace")+ , anyOf comments'+ , tokNext "\\[" (Arbitrary "Punctuation") (GoTo nestedArgAction')+ , tokNext "\\{" (Arbitrary "Punctuation") (GoTo action')+ ]++whitespace' :: TokenMatcher+whitespace' =+ [ tok "\\s+" (Arbitrary "Text" :. Arbitrary "Whitespace")+ ]++action' :: TokenMatcher+action' =+ [ tok "([^\\${}\\'\"/\\\\]+|\"(\\\\\\\\|\\\\\"|[^\"])*\"|'(\\\\\\\\|\\\\'|[^'])*'|//.*$\\n?|/\\*(.|\\n)*?\\*/|/(?!\\*)(\\\\\\\\|\\\\/|[^/])*/|\\\\(?!%)|/)+" (Arbitrary "Other")+ , tok "(\\\\)(%)" (ByGroups [(Arbitrary "Punctuation"), (Arbitrary "Other")])+ , tok "(\\$[a-zA-Z]+)(\\.?)(text|value)?" (ByGroups [(Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Punctuation"), (Arbitrary "Name" :. Arbitrary "Property")])+ , tokNext "{" (Arbitrary "Punctuation") Push+ , tokNext "}" (Arbitrary "Punctuation") Pop+ ]++nestedArgAction' :: TokenMatcher+nestedArgAction' =+ [ tok "([^\\$\\[\\]\\'\"/]+|\"(\\\\\\\\|\\\\\"|[^\"])*\"|'(\\\\\\\\|\\\\'|[^'])*'|//.*$\\n?|/\\*(.|\\n)*?\\*/|/(?!\\*)(\\\\\\\\|\\\\/|[^/])*/|/)+" (Arbitrary "Other")+ , tokNext "\\[" (Arbitrary "Punctuation") Push+ , tokNext "\\]" (Arbitrary "Punctuation") Pop+ , tok "(\\$[a-zA-Z]+)(\\.?)(text|value)?" (ByGroups [(Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Punctuation"), (Arbitrary "Name" :. Arbitrary "Property")])+ , tok "(\\\\\\\\|\\\\\\]|\\\\\\[|[^\\[\\]])+" (Arbitrary "Other")+ ]++rulePrelims' :: TokenMatcher+rulePrelims' =+ [ anyOf whitespace'+ , anyOf comments'+ , tok "returns\\b" (Arbitrary "Keyword")+ , tokNext "\\[" (Arbitrary "Punctuation") (GoTo nestedArgAction')+ , tokNext "\\{" (Arbitrary "Punctuation") (GoTo action')+ , tok "(throws)(\\s+)([A-Za-z][A-Za-z_0-9]*)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Name" :. Arbitrary "Label")])+ , tok "(?:(,)(\\s*)([A-Za-z][A-Za-z_0-9]*))+" (ByGroups [(Arbitrary "Punctuation"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Name" :. Arbitrary "Label")])+ , tokNext "options\\b" (Arbitrary "Keyword") (GoTo options')+ , tokNext "(scope)(\\s+)({)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Punctuation")]) (GoTo action')+ , tok "(scope)(\\s+)([A-Za-z][A-Za-z_0-9]*)(\\s*)(;)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Name" :. Arbitrary "Label"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Punctuation")])+ , tokNext "(@[A-Za-z][A-Za-z_0-9]*)(\\s*)({)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Label"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Punctuation")]) (GoTo action')+ , tokNext ":" (Arbitrary "Punctuation") Pop+ ]++root' :: TokenMatcher+root' =+ [ anyOf whitespace'+ , anyOf comments'+ , tok "(lexer|parser|tree)?(\\s*)(grammar\\b)(\\s*)([A-Za-z][A-Za-z_0-9]*)(;)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Keyword"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Punctuation")])+ , tokNext "options\\b" (Arbitrary "Keyword") (GoTo options')+ , tokNext "tokens\\b" (Arbitrary "Keyword") (GoTo tokens')+ , tokNext "(scope)(\\s*)([A-Za-z][A-Za-z_0-9]*)(\\s*)({)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Punctuation")]) (GoTo action')+ , tokNext "(catch|finally)\\b" (Arbitrary "Keyword") (GoTo exception')+ , tokNext "(@[A-Za-z][A-Za-z_0-9]*)(\\s*)(::)?(\\s*)([A-Za-z][A-Za-z_0-9]*)(\\s*)({)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Label"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Punctuation"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Name" :. Arbitrary "Label"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Punctuation")]) (GoTo action')+ , tokNext "((?:protected|private|public|fragment)\\b)?(\\s*)([A-Za-z][A-Za-z_0-9]*)(!)?" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Name" :. Arbitrary "Label"), (Arbitrary "Punctuation")]) (DoAll [(GoTo ruleAlts'), (GoTo rulePrelims')])+ ]++ruleAlts' :: TokenMatcher+ruleAlts' =+ [ anyOf whitespace'+ , anyOf comments'+ , tokNext "options\\b" (Arbitrary "Keyword") (GoTo options')+ , tok ":" (Arbitrary "Punctuation")+ , tok "'(\\\\\\\\|\\\\'|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "<<([^>]|>[^>])>>" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\$?[A-Z_][A-Za-z_0-9]*" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "\\$?[a-z_][A-Za-z_0-9]*" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "(\\+|\\||->|=>|=|\\(|\\)|\\.\\.|\\.|\\?|\\*|\\^|!|\\#|\126)" (Arbitrary "Operator")+ , tok "," (Arbitrary "Punctuation")+ , tokNext "\\[" (Arbitrary "Punctuation") (GoTo nestedArgAction')+ , tokNext "\\{" (Arbitrary "Punctuation") (GoTo action')+ , tokNext ";" (Arbitrary "Punctuation") Pop+ ]++comments' :: TokenMatcher+comments' =+ [ tok "//.*$" (Arbitrary "Comment")+ , tok "/\\*(.|\\n)*?\\*/" (Arbitrary "Comment")+ ]++options' :: TokenMatcher+options' =+ [ anyOf whitespace'+ , anyOf comments'+ , tok "{" (Arbitrary "Punctuation")+ , tok "([A-Za-z][A-Za-z_0-9]*)(\\s*)(=)(\\s*)([A-Za-z][A-Za-z_0-9]*|\\'(?:\\\\\\\\|\\\\\\'|[^\\']*)\\'|[0-9]+|\\*)(\\s*)(;)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Punctuation"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Text"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Punctuation")])+ , tokNext "}" (Arbitrary "Punctuation") Pop+ ]+
+ src/Text/Highlighter/Lexers/ApacheConf.hs view
@@ -0,0 +1,36 @@+module Text.Highlighter.Lexers.ApacheConf (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "ApacheConf"+ , lAliases = ["apacheconf", "aconf", "apache"]+ , lExtensions = [".htaccess", "apache.conf", "apache2.conf"]+ , lMimetypes = ["text/x-apacheconf"]+ , lStart = root'+ , lFlags = [caseless, multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "(#.*?)$" (Arbitrary "Comment")+ , tok "(<[^\\s>]+)(?:(\\s+)(.*?))?(>)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Tag"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String"), (Arbitrary "Name" :. Arbitrary "Tag")])+ , tokNext "([a-zA-Z][a-zA-Z0-9]*)(\\s+)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Builtin"), (Arbitrary "Text")]) (GoTo value')+ , tok "\\.+" (Arbitrary "Text")+ ]++value' :: TokenMatcher+value' =+ [ tokNext "$" (Arbitrary "Text") Pop+ , tok "[^\\S\\n]+" (Arbitrary "Text")+ , tok "\\d+\\.\\d+\\.\\d+\\.\\d+(?:/\\d+)?" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "\\d+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "/([a-zA-Z0-9][a-zA-Z0-9_./-]+)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ , tok "(on|off|none|any|all|double|email|dns|min|minimal|os|productonly|full|emerg|alert|crit|error|warn|notice|info|debug|registry|script|inetd|standalone|user|group)\\b" (Arbitrary "Keyword")+ , tok "\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "[^\\s\"]+" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/AppleScript.hs view
@@ -0,0 +1,55 @@+module Text.Highlighter.Lexers.AppleScript (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "AppleScript"+ , lAliases = ["applescript"]+ , lExtensions = [".applescript"]+ , lMimetypes = []+ , lStart = root'+ , lFlags = [multiline, dotall]+ }++comment' :: TokenMatcher+comment' =+ [ tokNext "\\(\\*" (Arbitrary "Comment" :. Arbitrary "Multiline") Push+ , tokNext "\\*\\)" (Arbitrary "Comment" :. Arbitrary "Multiline") Pop+ , tok "[^*(]+" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "[*(]" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]++root' :: TokenMatcher+root' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "\172\\n" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "'s\\s+" (Arbitrary "Text")+ , tok "(--|#).*?$" (Arbitrary "Comment")+ , tokNext "\\(\\*" (Arbitrary "Comment" :. Arbitrary "Multiline") (GoTo comment')+ , tok "[\\(\\){}!,.:]" (Arbitrary "Punctuation")+ , tok "(\171)([^\187]+)(\187)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Builtin"), (Arbitrary "Text")])+ , tok "\\b((?:considering|ignoring)\\s*)(application responses|case|diacriticals|hyphens|numeric strings|punctuation|white space)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Name" :. Arbitrary "Builtin")])+ , tok "(-|\\*|\\+|&|\8800|>=?|<=?|=|\8805|\8804|/|\247|\\^)" (Arbitrary "Operator")+ , tok "\\b(and|or|is equal|equals|(is )?equal to|is not|isn't|isn't equal( to)?|is not equal( to)?|doesn't equal|does not equal|(is )?greater than|comes after|is not less than or equal( to)?|isn't less than or equal( to)?|(is )?less than|comes before|is not greater than or equal( to)?|isn't greater than or equal( to)?|(is )?greater than or equal( to)?|is not less than|isn't less than|does not come before|doesn't come before|(is )?less than or equal( to)?|is not greater than|isn't greater than|does not come after|doesn't come after|starts? with|begins? with|ends? with|contains?|does not contain|doesn't contain|is in|is contained by|is not in|is not contained by|isn't contained by|div|mod|not|(a )?(ref( to)?|reference to)|is|does)\\b" (Arbitrary "Operator" :. Arbitrary "Word")+ , tok "^(\\s*(?:on|end)\\s+)(accept outline drop|accept table drop|action|activated|alert ended|awake from nib|became key|became main|begin editing|bounds changed|cell value|cell value changed|change cell value|change item value|changed|child of item|choose menu item|clicked|clicked toolbar item|closed|column clicked|column moved|column resized|conclude drop|data representation|deminiaturized|dialog ended|document nib name|double clicked|drag( (entered|exited|updated))?|drop|end editing|exposed|idle|item expandable|item value|item value changed|items changed|keyboard down|keyboard up|launched|load data representation|miniaturized|mouse down|mouse dragged|mouse entered|mouse exited|mouse moved|mouse up|moved|number of browser rows|number of items|number of rows|open untitled|opened|panel ended|parameters updated|plugin loaded|prepare drop|prepare outline drag|prepare outline drop|prepare table drag|prepare table drop|read from file|resigned active|resigned key|resigned main|resized( sub views)?|right mouse down|right mouse dragged|right mouse up|rows changed|scroll wheel|selected tab view item|selection changed|selection changing|should begin editing|should close|should collapse item|should end editing|should expand item|should open( untitled)?|should quit( after last window closed)?|should select column|should select item|should select row|should select tab view item|should selection change|should zoom|shown|update menu item|update parameters|update toolbar item|was hidden|was miniaturized|will become active|will close|will dismiss|will display browser cell|will display cell|will display item cell|will display outline cell|will finish launching|will hide|will miniaturize|will move|will open|will pop up|will quit|will resign active|will resize( sub views)?|will select tab view item|will show|will zoom|write to file|zoomed)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Name" :. Arbitrary "Function")])+ , tok "^(\\s*)(in|on|script|to)(\\s+)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text")])+ , tok "\\b(as )(alias |application |boolean |class |constant |date |file |integer |list |number |POSIX file |real |record |reference |RGB color |script |text |unit types|(Unicode )?text|string)\\b" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Name" :. Arbitrary "Class")])+ , tok "\\b(AppleScript|current application|false|linefeed|missing value|pi|quote|result|return|space|tab|text item delimiters|true|version)\\b" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "\\b(ASCII (character|number)|activate|beep|choose URL|choose application|choose color|choose file( name)?|choose folder|choose from list|choose remote application|clipboard info|close( access)?|copy|count|current date|delay|delete|display (alert|dialog)|do shell script|duplicate|exists|get eof|get volume settings|info for|launch|list (disks|folder)|load script|log|make|mount volume|new|offset|open( (for access|location))?|path to|print|quit|random number|read|round|run( script)?|say|scripting components|set (eof|the clipboard to|volume)|store script|summarize|system attribute|system info|the clipboard|time to GMT|write|quoted form)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "\\b(considering|else|error|exit|from|if|ignoring|in|repeat|tell|then|times|to|try|until|using terms from|while|whith|with timeout( of)?|with transaction|by|continue|end|its?|me|my|return|of|as)\\b" (Arbitrary "Keyword")+ , tok "\\b(global|local|prop(erty)?|set|get)\\b" (Arbitrary "Keyword")+ , tok "\\b(but|put|returning|the)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "\\b(attachment|attribute run|character|day|month|paragraph|word|year)s?\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "\\b(about|above|against|apart from|around|aside from|at|below|beneath|beside|between|for|given|instead of|on|onto|out of|over|since)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "\\b(accepts arrow key|action method|active|alignment|allowed identifiers|allows branch selection|allows column reordering|allows column resizing|allows column selection|allows customization|allows editing text attributes|allows empty selection|allows mixed state|allows multiple selection|allows reordering|allows undo|alpha( value)?|alternate image|alternate increment value|alternate title|animation delay|associated file name|associated object|auto completes|auto display|auto enables items|auto repeat|auto resizes( outline column)?|auto save expanded items|auto save name|auto save table columns|auto saves configuration|auto scroll|auto sizes all columns to fit|auto sizes cells|background color|bezel state|bezel style|bezeled|border rect|border type|bordered|bounds( rotation)?|box type|button returned|button type|can choose directories|can choose files|can draw|can hide|cell( (background color|size|type))?|characters|class|click count|clicked( data)? column|clicked data item|clicked( data)? row|closeable|collating|color( (mode|panel))|command key down|configuration|content(s| (size|view( margins)?))?|context|continuous|control key down|control size|control tint|control view|controller visible|coordinate system|copies( on scroll)?|corner view|current cell|current column|current( field)? editor|current( menu)? item|current row|current tab view item|data source|default identifiers|delta (x|y|z)|destination window|directory|display mode|displayed cell|document( (edited|rect|view))?|double value|dragged column|dragged distance|dragged items|draws( cell)? background|draws grid|dynamically scrolls|echos bullets|edge|editable|edited( data)? column|edited data item|edited( data)? row|enabled|enclosing scroll view|ending page|error handling|event number|event type|excluded from windows menu|executable path|expanded|fax number|field editor|file kind|file name|file type|first responder|first visible column|flipped|floating|font( panel)?|formatter|frameworks path|frontmost|gave up|grid color|has data items|has horizontal ruler|has horizontal scroller|has parent data item|has resize indicator|has shadow|has sub menu|has vertical ruler|has vertical scroller|header cell|header view|hidden|hides when deactivated|highlights by|horizontal line scroll|horizontal page scroll|horizontal ruler view|horizontally resizable|icon image|id|identifier|ignores multiple clicks|image( (alignment|dims when disabled|frame style|scaling))?|imports graphics|increment value|indentation per level|indeterminate|index|integer value|intercell spacing|item height|key( (code|equivalent( modifier)?|window))?|knob thickness|label|last( visible)? column|leading offset|leaf|level|line scroll|loaded|localized sort|location|loop mode|main( (bunde|menu|window))?|marker follows cell|matrix mode|maximum( content)? size|maximum visible columns|menu( form representation)?|miniaturizable|miniaturized|minimized image|minimized title|minimum column width|minimum( content)? size|modal|modified|mouse down state|movie( (controller|file|rect))?|muted|name|needs display|next state|next text|number of tick marks|only tick mark values|opaque|open panel|option key down|outline table column|page scroll|pages across|pages down|palette label|pane splitter|parent data item|parent window|pasteboard|path( (names|separator))?|playing|plays every frame|plays selection only|position|preferred edge|preferred type|pressure|previous text|prompt|properties|prototype cell|pulls down|rate|released when closed|repeated|requested print time|required file type|resizable|resized column|resource path|returns records|reuses columns|rich text|roll over|row height|rulers visible|save panel|scripts path|scrollable|selectable( identifiers)?|selected cell|selected( data)? columns?|selected data items?|selected( data)? rows?|selected item identifier|selection by rect|send action on arrow key|sends action when done editing|separates columns|separator item|sequence number|services menu|shared frameworks path|shared support path|sheet|shift key down|shows alpha|shows state by|size( mode)?|smart insert delete enabled|sort case sensitivity|sort column|sort order|sort type|sorted( data rows)?|sound|source( mask)?|spell checking enabled|starting page|state|string value|sub menu|super menu|super view|tab key traverses cells|tab state|tab type|tab view|table view|tag|target( printer)?|text color|text container insert|text container origin|text returned|tick mark position|time stamp|title(d| (cell|font|height|position|rect))?|tool tip|toolbar|trailing offset|transparent|treat packages as directories|truncated labels|types|unmodified characters|update views|use sort indicator|user defaults|uses data source|uses ruler|uses threaded animation|uses title from previous column|value wraps|version|vertical( (line scroll|page scroll|ruler view))?|vertically resizable|view|visible( document rect)?|volume|width|window|windows menu|wraps|zoomable|zoomed)\\b" (Arbitrary "Name" :. Arbitrary "Attribute")+ , tok "\\b(action cell|alert reply|application|box|browser( cell)?|bundle|button( cell)?|cell|clip view|color well|color-panel|combo box( item)?|control|data( (cell|column|item|row|source))?|default entry|dialog reply|document|drag info|drawer|event|font(-panel)?|formatter|image( (cell|view))?|matrix|menu( item)?|item|movie( view)?|open-panel|outline view|panel|pasteboard|plugin|popup button|progress indicator|responder|save-panel|scroll view|secure text field( cell)?|slider|sound|split view|stepper|tab view( item)?|table( (column|header cell|header view|view))|text( (field( cell)?|view))?|toolbar( item)?|user-defaults|view|window)s?\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "\\b(animate|append|call method|center|close drawer|close panel|display|display alert|display dialog|display panel|go|hide|highlight|increment|item for|load image|load movie|load nib|load panel|load sound|localized string|lock focus|log|open drawer|path for|pause|perform action|play|register|resume|scroll|select( all)?|show|size to fit|start|step back|step forward|stop|synchronize|unlock focus|update)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "\\b((in )?back of|(in )?front of|[0-9]+(st|nd|rd|th)|first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|after|back|before|behind|every|front|index|last|middle|some|that|through|thru|where|whose)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "\\b([a-zA-Z]\\w*)\\b" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "[-+]?(\\d+\\.\\d*|\\d*\\.\\d+)(E[-+][0-9]+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "[-+]?\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ ]+
+ src/Text/Highlighter/Lexers/Asymptote.hs view
@@ -0,0 +1,79 @@+module Text.Highlighter.Lexers.Asymptote (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Asymptote"+ , lAliases = ["asy", "asymptote"]+ , lExtensions = [".asy"]+ , lMimetypes = ["text/x-asymptote"]+ , lStart = root'+ , lFlags = [multiline]+ }++function' :: TokenMatcher+function' =+ [ anyOf whitespace'+ , anyOf statements'+ , tok ";" (Arbitrary "Punctuation")+ , tokNext "{" (Arbitrary "Punctuation") Push+ , tokNext "}" (Arbitrary "Punctuation") Pop+ ]++statements' :: TokenMatcher+statements' =+ [ tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "'" (Arbitrary "Literal" :. Arbitrary "String") (GoTo string')+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+)[eE][+-]?\\d+[lL]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+[fF])[fF]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0x[0-9a-fA-F]+[Ll]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "0[0-7]+[Ll]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "\\d+[Ll]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "[\126!%^&*+=|?:<>/-]" (Arbitrary "Operator")+ , tok "[()\\[\\],.]" (Arbitrary "Punctuation")+ , tok "\\b(case)(.+?)(:)" (ByGroups [(Arbitrary "Keyword"), (Using lexer), (Arbitrary "Text")])+ , tok "(and|controls|tension|atleast|curl|if|else|while|for|do|return|break|continue|struct|typedef|new|access|import|unravel|from|include|quote|static|public|private|restricted|this|explicit|true|false|null|cycle|newframe|operator)\\b" (Arbitrary "Keyword")+ , tok "(Braid|FitResult|Label|Legend|TreeNode|abscissa|arc|arrowhead|binarytree|binarytreeNode|block|bool|bool3|bounds|bqe|circle|conic|coord|coordsys|cputime|ellipse|file|filltype|frame|grid3|guide|horner|hsv|hyperbola|indexedTransform|int|inversion|key|light|line|linefit|marginT|marker|mass|object|pair|parabola|path|path3|pen|picture|point|position|projection|real|revolution|scaleT|scientific|segment|side|slice|splitface|string|surface|tensionSpecifier|ticklocate|ticksgridT|tickvalues|transform|transformation|tree|triangle|trilinear|triple|vector|vertex|void)(?=([ ]{1,}[a-zA-Z]))" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "(Braid|FitResult|TreeNode|abscissa|arrowhead|block|bool|bool3|bounds|coord|frame|guide|horner|int|linefit|marginT|pair|pen|picture|position|real|revolution|slice|splitface|ticksgridT|tickvalues|tree|triple|vertex|void)\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "[a-zA-Z_][a-zA-Z0-9_]*:(?!:)" (Arbitrary "Name" :. Arbitrary "Label")+ , tok "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name")+ ]++whitespace' :: TokenMatcher+whitespace' =+ [ tok "\\n" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ , tok "\\\\\\n" (Arbitrary "Text")+ , tok "//(\\n|(.|\\n)*?[^\\\\]\\n)" (Arbitrary "Comment")+ , tok "/(\\\\\\n)?[*](.|\\n)*?[*](\\\\\\n)?/" (Arbitrary "Comment")+ ]++statement' :: TokenMatcher+statement' =+ [ anyOf whitespace'+ , anyOf statements'+ , tok "[{}]" (Arbitrary "Punctuation")+ , tokNext ";" (Arbitrary "Punctuation") Pop+ ]++root' :: TokenMatcher+root' =+ [ anyOf whitespace'+ , tokNext "((?:[a-zA-Z0-9_*\\s])+?(?:\\s|[*]))([a-zA-Z_][a-zA-Z0-9_]*)(\\s*\\([^;]*?\\))((?:\\s|//.*?\\n|/[*].*?[*]/)+)({)" (ByGroups [(Using lexer), (Arbitrary "Name" :. Arbitrary "Function"), (Using lexer), (Using lexer), (Arbitrary "Punctuation")]) (GoTo function')+ , tok "((?:[a-zA-Z0-9_*\\s])+?(?:\\s|[*]))([a-zA-Z_][a-zA-Z0-9_]*)(\\s*\\([^;]*?\\))((?:\\s|//.*?\\n|/[*].*?[*]/)+)(;)" (ByGroups [(Using lexer), (Arbitrary "Name" :. Arbitrary "Function"), (Using lexer), (Using lexer), (Arbitrary "Punctuation")])+ , tokNext "" (Arbitrary "Text") (GoTo statement')+ ]++string' :: TokenMatcher+string' =+ [ tokNext "'" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\([\\\\abfnrtv\"\\'?]|x[a-fA-F0-9]{2,4}|[0-7]{1,3})" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "\\n" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "[^\\\\'\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\n" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\" (Arbitrary "Literal" :. Arbitrary "String")+ ]+
+ src/Text/Highlighter/Lexers/Atomo.hs view
@@ -0,0 +1,147 @@+module Text.Highlighter.Lexers.Atomo (lexer) where++import Data.List (intercalate)+import Text.Printf+import Text.Regex.PCRE.Light++import Text.Highlighter.Types+++lexer :: Lexer+lexer = Lexer+ { lName = "Atomo"+ , lAliases = ["atomo"]+ , lExtensions = [".atomo"]+ , lMimetypes = ["text/x-atomo"]+ , lStart = root+ , lFlags = [multiline]+ }++ascii :: [String]+ascii =+ ["NUL","SOH","[SE]TX","EOT","ENQ","ACK",+ "BEL","BS","HT","LF","VT","FF","CR","S[OI]","DLE",+ "DC[1-4]","NAK","SYN","ETB","CAN",+ "EM","SUB","ESC","[FGRU]S","SP","DEL"]++reserved :: [String]+reserved = ["operator", "macro", "for-macro", "this"]++identifier :: String+identifier = "[a-zA-Z0-9_!#%&\\*\\+\\.\\\\/<=>\\?@^\\|~\\-]"++operator :: String+operator = "[:!#%&\\*\\+\\.\\\\/<=>\\?@^\\|~\\-]"++root :: TokenMatcher+root =+ -- Comments+ [ tok "--.*?$" (Comment :. Single)+ , tokNext "{-" (Comment :. Multiline) (GoTo comment)++ -- Boolean+ , tok "True|False" (Keyword :. Constant)++ -- Numbers+ , tok "[\\+\\-]?\\d+[eE][\\+\\-]?\\d+" (Number :. Float)+ , tok "[\\+\\-]?\\d+\\.\\d+([eE][\\+\\-]?\\d+)?" (Number :. Float)+ , tok "[\\+\\-]?0[oO][0-7]+" (Number :. Oct)+ , tok "[\\+\\-]?0[xX][\\da-fA-F]+" (Number :. Hex)+ , tok "[\\+\\-]?\\d+/[\\+\\-]?\\d+" Number+ , tok "[\\+\\-]?\\d+" (Number :. Integer)++ -- Internal representations (TODO: these should get less ambiguous syntax.)+ , tokNext "<[a-z]" (Generic :. Output) (GoTo internal)++ -- Macro-Quote+ , tokNext ("(?![\"$|`;~@])(" ++ identifier ++ "+)([\"$|`'~@])") (String :. Other) (CapturesTo macroQuote)+ , tokNext ("(?![\"$|`;~@])(" ++ identifier ++ "+)\\(") (String :. Other) (GoTo (macroQuoteDelim "\\)"))+ , tokNext ("(?![\"$|`;~@])(" ++ identifier ++ "+)\\{") (String :. Other) (GoTo (macroQuoteDelim "\\}"))+ , tokNext ("(?![\"$|`;~@])(" ++ identifier ++ "+)\\[") (String :. Other) (GoTo (macroQuoteDelim "\\]"))++ -- Identifiers+ , tok (printf "\\b(%s)\\b(?!%s)" (intercalate "|" reserved) operator)+ (Keyword :. Reserved)+ , tok ("(?![@$~])(?!" ++ operator ++ "+(\\s|$))" ++ identifier ++ "+:") (Name :. Function)+ {-, tok ("[A-Z]" ++ identifier ++ "*") (Name :. Variable :. Global)-}+ , tok ("(?![@$~])(?!" ++ operator ++ "+(\\s|$))" ++ identifier ++ "+") Name++ -- Operators+ , tok ("(?![@$~])" ++ operator ++ "+") Operator++ -- Whitespace+ , tok "\\s+" Text++ -- Characters & Strings+ , tokNext "\\$" (String :. Char) (GoTo character)+ , tokNext "\"" String (GoTo string)++ -- Quoting+ , tok ("'" ++ identifier ++ "+") (String :. Symbol)+ , tok "'" (String :. Symbol)+ , tok ("`" ++ identifier ++ "+") (String :. Symbol)+ , tok "`" (String :. Symbol)+ , tok ("~" ++ identifier ++ "+") (String :. Interpol)+ , tok "~" (String :. Interpol)++ -- Particles+ , tok ("@(" ++ identifier ++ "+:)+") (Name :. Decorator)+ , tok ("@" ++ identifier ++ "+") (Name :. Decorator)+ , tok "@" (Name :. Decorator)++ -- Punctuation+ , tok "[][(),;{}|]" Punctuation+ ]++internal :: TokenMatcher+internal =+ [ tok "[^<>]+" (Generic :. Output)+ , tokNext "<" (Generic :. Output) Push+ , tokNext ">" (Generic :. Output) Pop+ ]++comment :: TokenMatcher+comment =+ [ tok "[^\\-\\{\\}]+" (Comment :. Multiline)+ , tokNext "{-" (Comment :. Multiline) Push+ , tokNext "-}" (Comment :. Multiline) Pop+ , tok "[-{}]" (Comment :. Multiline)+ ]++character :: TokenMatcher+character =+ [ tokNext "[^\\\\]" (String :. Char) Pop+ , tokNext "\\\\[^\\s]+" (String :. Escape) Pop+ ]++string :: TokenMatcher+string =+ [ tok "[^\\\\\"]+" String+ , tokNext "\\\\" (String :. Escape) (GoTo escape)+ , tokNext "\"" String Pop+ ]++macroQuoteDelim :: String -> TokenMatcher+macroQuoteDelim c =+ [ tok ("[^\\\\" ++ c ++ "]+") (String :. Other)+ , tokNext "\\\\." (String :. Other) Continue+ , tokNext (c ++ "([[:alpha:]]*)") (String :. Other) Pop+ ]++macroQuote :: [String] -> TokenMatcher+macroQuote cs =+ [ tok ("[^\\\\" ++ (cs !! 2) ++ "]+") (String :. Other)+ , tokNext "\\\\." (String :. Other) Continue+ , tokNext ((cs !! 2) ++ "([[:alpha:]]*)") (String :. Other) Pop+ ]++escape :: TokenMatcher+escape =+ [ tokNext "[abfnrtv\"&\\\\]" (String :. Escape) Pop+ , tokNext "\\^[\\]\\[A-Z@\\^_]" (String :. Escape) Pop+ , tokNext (intercalate "|" ascii) (String :. Escape) Pop+ , tokNext "o[0-7]+" (String :. Escape) Pop+ , tokNext "x[\\da-fA-F]+" (String :. Escape) Pop+ , tokNext "\\d+" (String :. Escape) Pop+ , tokNext "\\s+\\\\" (String :. Escape) Pop+ ]
+ src/Text/Highlighter/Lexers/Autohotkey.hs view
@@ -0,0 +1,146 @@+module Text.Highlighter.Lexers.Autohotkey (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "autohotkey"+ , lAliases = ["ahk"]+ , lExtensions = [".ahk", ".ahkl"]+ , lMimetypes = ["text/x-autohotkey"]+ , lStart = root'+ , lFlags = [caseless, multiline, dotall]+ }++commands' :: TokenMatcher+commands' =+ [ tokNext "(autotrim|blockinput|break|click|clipwait|continue|control|controlclick|controlfocus|controlget|controlgetfocus|controlgetpos|controlgettext|controlmove|controlsend|controlsendraw|controlsettext|coordmode|critical|detecthiddentext|detecthiddenwindows|dllcall|drive|driveget|drivespacefree|else|envadd|envdiv|envget|envmult|envset|envsub|envupdate|exit|exitapp|fileappend|filecopy|filecopydir|filecreatedir|filecreateshortcut|filedelete|filegetattrib|filegetshortcut|filegetsize|filegettime|filegetversion|fileinstall|filemove|filemovedir|fileread|filereadline|filerecycle|filerecycleempty|fileremovedir|fileselectfile|fileselectfolder|filesetattrib|filesettime|formattime|gosub|goto|groupactivate|groupadd|groupclose|groupdeactivate|gui|guicontrol|guicontrolget|hotkey|ifexist|ifgreater|ifgreaterorequal|ifinstring|ifless|iflessorequal|ifmsgbox|ifnotequal|ifnotexist|ifnotinstring|ifwinactive|ifwinexist|ifwinnotactive|ifwinnotexist|imagesearch|inidelete|iniread|iniwrite|input|inputbox|keyhistory|keywait|listhotkeys|listlines|listvars|loop|menu|mouseclick|mouseclickdrag|mousegetpos|mousemove|msgbox|onmessage|onexit|outputdebug|pixelgetcolor|pixelsearch|postmessage|process|progress|random|regexmatch|regexreplace|registercallback|regdelete|regread|regwrite|reload|repeat|return|run|runas|runwait|send|sendevent|sendinput|sendmessage|sendmode|sendplay|sendraw|setbatchlines|setcapslockstate|setcontroldelay|setdefaultmousespeed|setenv|setformat|setkeydelay|setmousedelay|setnumlockstate|setscrolllockstate|setstorecapslockmode|settimer|settitlematchmode|setwindelay|setworkingdir|shutdown|sleep|sort|soundbeep|soundget|soundgetwavevolume|soundplay|soundset|soundsetwavevolume|splashimage|splashtextoff|splashtexton|splitpath|statusbargettext|statusbarwait|stringcasesense|stringgetpos|stringleft|stringlen|stringlower|stringmid|stringreplace|stringright|stringsplit|stringtrimleft|stringtrimright|stringupper|suspend|sysget|thread|tooltip|transform|traytip|urldownloadtofile|while|varsetcapacity|winactivate|winactivatebottom|winclose|winget|wingetactivestats|wingetactivetitle|wingetclass|wingetpos|wingettext|wingettitle|winhide|winkill|winmaximize|winmenuselectitem|winminimize|winminimizeall|winminimizeallundo|winmove|winrestore|winset|winsettitle|winshow|winwait|winwaitactive|winwaitclose|winwaitnotactivetrue|false|NULL)\\b" (Arbitrary "Keyword") (GoTo command')+ ]++literals' :: TokenMatcher+literals' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo string')+ , tok "A_\\w+" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "%[]\\w#@$?[]+?%" (Arbitrary "Name" :. Arbitrary "Variable")+ , tokNext "[-\126!%^&*+|?:<>/=]=?" (Arbitrary "Operator") (GoTo expressions')+ , tokNext "==" (Arbitrary "Operator") (GoTo expressions')+ , tok "[{()},.%#`;]" (Arbitrary "Punctuation")+ , tok "\\\\" (Arbitrary "Punctuation")+ , anyOf keywords'+ , tok "\\w+" (Arbitrary "Text")+ ]++string' :: TokenMatcher+string' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\"\"|`." (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "[^\\`\"\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ ]++parameters' :: TokenMatcher+parameters' =+ [ tokNext "\\)" (Arbitrary "Punctuation") Pop+ , tokNext "\\(" (Arbitrary "Punctuation") Push+ , anyOf numbers'+ , anyOf literals'+ , anyOf whitespace'+ ]++keynames' :: TokenMatcher+keynames' =+ [ tokNext "\\[[^\\]]+\\]" (Arbitrary "Keyword") (GoTo keynames')+ ]++continuation' :: TokenMatcher+continuation' =+ [ tokNext "\\n\\)" (Arbitrary "Punctuation") Pop+ , tok "\\s[^\\n\\)]+" (Arbitrary "Literal" :. Arbitrary "String")+ ]++labels' :: TokenMatcher+labels' =+ [ tok "(^\\s*)([^:\\s]+?:{1,2})" (ByGroups [(Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Name" :. Arbitrary "Label")])+ , tok "(^\\s*)(::[]\\w#@$?[]+?::)" (ByGroups [(Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Name" :. Arbitrary "Label")])+ ]++comments' :: TokenMatcher+comments' =+ [ tok "^;+.*?$" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "(?<=\\s);+.*?$" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "^/\\*.*?\\n\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "(?<!\\n)/\\*.*?\\n\\*/" (Arbitrary "Error")+ ]++command' :: TokenMatcher+command' =+ [ anyOf comments'+ , anyOf whitespace'+ , tokNext "^\\(" (Arbitrary "Literal" :. Arbitrary "String") (GoTo continuation')+ , tokNext "[^\\n]*?(?=;*|$)" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , anyOf numbers'+ , anyOf literals'+ ]++numbers' :: TokenMatcher+numbers' =+ [ tok "(\\d+\\.\\d*|\\d*\\.\\d+)([eE][+-]?[0-9]+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "\\d+[eE][+-]?[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0[0-7]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "0[xX][a-fA-F0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "\\d+L" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer" :. Arbitrary "Long")+ , tok "\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ ]++keywords' :: TokenMatcher+keywords' =+ [ tok "(static|global|local)\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "(if|else|and|or)\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ ]++directives' :: TokenMatcher+directives' =+ [ tok "#\\w+?\\s" (Arbitrary "Keyword")+ ]++expressions' :: TokenMatcher+expressions' =+ [ anyOf comments'+ , anyOf whitespace'+ , anyOf numbers'+ , anyOf literals'+ , tokNext "([]\\w#@$?[]+)(\\s*)(\\()" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Punctuation")]) (GoTo parameters')+ , tok "A_\\w+" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "%[]\\w#@$?[]+?%" (Arbitrary "Name" :. Arbitrary "Variable")+ , tokNext "{" (Arbitrary "Punctuation") (GoTo block')+ ]++root' :: TokenMatcher+root' =+ [ anyOf whitespace'+ , tokNext "^\\(" (Arbitrary "Literal" :. Arbitrary "String") (GoTo continuation')+ , anyOf comments'+ , tokNext "(^\\s*)(\\w+)(\\s*)(=)" (ByGroups [(Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Name"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Operator")]) (GoTo command')+ , tokNext "([\\w#@$?\\[\\]]+)(\\s*)(\\()" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Punctuation")]) (GoTo parameters')+ , anyOf directives'+ , anyOf labels'+ , anyOf commands'+ , anyOf expressions'+ , anyOf numbers'+ , anyOf literals'+ , anyOf keynames'+ , anyOf keywords'+ ]++block' :: TokenMatcher+block' =+ [ anyOf root'+ , tokNext "{" (Arbitrary "Punctuation") Push+ , tokNext "}" (Arbitrary "Punctuation") Pop+ ]++whitespace' :: TokenMatcher+whitespace' =+ [ tok "[ \\t]+" (Arbitrary "Text" :. Arbitrary "Whitespace")+ ]+
+ src/Text/Highlighter/Lexers/BBCode.hs view
@@ -0,0 +1,30 @@+module Text.Highlighter.Lexers.BBCode (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "BBCode"+ , lAliases = ["bbcode"]+ , lExtensions = []+ , lMimetypes = ["text/x-bbcode"]+ , lStart = root'+ , lFlags = [multiline]+ }++tag' :: TokenMatcher+tag' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "(\\w+)(=)(\"?[^\\s\"\\]]+\"?)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Attribute"), (Arbitrary "Operator"), (Arbitrary "Literal" :. Arbitrary "String")])+ , tok "(=)(\"?[^\\s\"\\]]+\"?)" (ByGroups [(Arbitrary "Operator"), (Arbitrary "Literal" :. Arbitrary "String")])+ , tokNext "\\]" (Arbitrary "Keyword") Pop+ ]++root' :: TokenMatcher+root' =+ [ tok "[^[]+" (Arbitrary "Text")+ , tokNext "\\[/?\\w+" (Arbitrary "Keyword") (GoTo tag')+ , tok "\\[" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Bash.hs view
@@ -0,0 +1,79 @@+module Text.Highlighter.Lexers.Bash (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Bash"+ , lAliases = ["bash", "sh", "ksh"]+ , lExtensions = [".sh", ".ksh", ".bash", ".ebuild", ".eclass"]+ , lMimetypes = ["application/x-sh", "application/x-shellscript"]+ , lStart = root'+ , lFlags = [multiline]+ }++curly' :: TokenMatcher+curly' =+ [ tokNext "}" (Arbitrary "Keyword") Pop+ , tok ":-" (Arbitrary "Keyword")+ , tok "[a-zA-Z0-9_]+" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "[^}:\"\\'`$]+" (Arbitrary "Punctuation")+ , tok ":" (Arbitrary "Punctuation")+ , anyOf root'+ ]++backticks' :: TokenMatcher+backticks' =+ [ tokNext "`" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Backtick") Pop+ , anyOf root'+ ]++root' :: TokenMatcher+root' =+ [ anyOf basic'+ , tokNext "\\$\\(\\(" (Arbitrary "Keyword") (GoTo math')+ , tokNext "\\$\\(" (Arbitrary "Keyword") (GoTo paren')+ , tokNext "\\${#?" (Arbitrary "Keyword") (GoTo curly')+ , tokNext "`" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Backtick") (GoTo backticks')+ , anyOf data'+ ]++basic' :: TokenMatcher+basic' =+ [ tok "\\b(if|fi|else|while|do|done|for|then|return|function|case|select|continue|until|esac|elif)\\s*\\b" (Arbitrary "Keyword")+ , tok "\\b(alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|declare|dirs|disown|echo|enable|eval|exec|exit|export|false|fc|fg|getopts|hash|help|history|jobs|kill|let|local|logout|popd|printf|pushd|pwd|read|readonly|set|shift|shopt|source|suspend|test|time|times|trap|true|type|typeset|ulimit|umask|unalias|unset|wait)\\s*\\b(?!\\.)" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "#.*\\n" (Arbitrary "Comment")+ , tok "\\\\[\\w\\W]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "(\\b\\w+)(\\s*)(=)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Text"), (Arbitrary "Operator")])+ , tok "[\\[\\]{}()=]" (Arbitrary "Operator")+ , tok "<<-?\\s*(\\'?)\\\\?(\\w+)[\\w\\W]+?\\2" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "&&|\\|\\|" (Arbitrary "Operator")+ ]++paren' :: TokenMatcher+paren' =+ [ tokNext "\\)" (Arbitrary "Keyword") Pop+ , anyOf root'+ ]++data' :: TokenMatcher+data' =+ [ tok "(?s)\\$?\"(\\\\\\\\|\\\\[0-7]+|\\\\.|[^\"\\\\])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "(?s)\\$?'(\\\\\\\\|\\\\[0-7]+|\\\\.|[^'\\\\])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok ";" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ , tok "[^=\\s\\n\\[\\]{}()$\"\\'`\\\\<]+" (Arbitrary "Text")+ , tok "\\d+(?= |\\Z)" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "\\$#?(\\w+|.)" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "<" (Arbitrary "Text")+ ]++math' :: TokenMatcher+math' =+ [ tokNext "\\)\\)" (Arbitrary "Keyword") Pop+ , tok "[-+*/%^|&]|\\*\\*|\\|\\|" (Arbitrary "Operator")+ , tok "\\d+" (Arbitrary "Literal" :. Arbitrary "Number")+ , anyOf root'+ ]+
+ src/Text/Highlighter/Lexers/Batch.hs view
@@ -0,0 +1,54 @@+module Text.Highlighter.Lexers.Batch (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Batchfile"+ , lAliases = ["bat"]+ , lExtensions = [".bat", ".cmd"]+ , lMimetypes = ["application/x-dos-batch"]+ , lStart = root'+ , lFlags = [caseless, multiline]+ }++basic' :: TokenMatcher+basic' =+ [ tok "\".*?\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "'.*?'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "`.*?`" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Backtick")+ , tok "-?\\d+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "," (Arbitrary "Punctuation")+ , tok "=" (Arbitrary "Operator")+ , tok "/\\S+" (Arbitrary "Name")+ , tok ":\\w+" (Arbitrary "Name" :. Arbitrary "Label")+ , tok "\\w:\\w+" (Arbitrary "Text")+ , tok "([<>|])(\\s*)(\\w+)" (ByGroups [(Arbitrary "Punctuation"), (Arbitrary "Text"), (Arbitrary "Name")])+ ]++root' :: TokenMatcher+root' =+ [ tok "^\\s*@" (Arbitrary "Punctuation")+ , tok "^(\\s*)(rem\\s.*)$" (ByGroups [(Arbitrary "Text"), (Arbitrary "Comment")])+ , tok "\".*?\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "'.*?'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "%%?[\126$:\\w]+%?" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "::.*" (Arbitrary "Comment")+ , tok "(set)(\\s+)(\\w+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Variable")])+ , tok "(call)(\\s+)(:\\w+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Label")])+ , tok "(goto)(\\s+)(\\w+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Label")])+ , tok "\\b(set|call|echo|on|off|endlocal|for|do|goto|if|pause|setlocal|shift|errorlevel|exist|defined|cmdextversion|errorlevel|else|cd|md|del|deltree|cls|choice)\\b" (Arbitrary "Keyword")+ , tok "\\b(equ|neq|lss|leq|gtr|geq)\\b" (Arbitrary "Operator")+ , anyOf basic'+ , tok "." (Arbitrary "Text")+ ]++echo' :: TokenMatcher+echo' =+ [ tok "\\^\\^|\\^<|\\^>|\\^\\|" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tokNext "\\n" (Arbitrary "Text") Pop+ , anyOf basic'+ , tok "[^\\'\"^]+" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Befunge.hs view
@@ -0,0 +1,31 @@+module Text.Highlighter.Lexers.Befunge (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Befunge"+ , lAliases = ["befunge"]+ , lExtensions = [".befunge"]+ , lMimetypes = ["application/x-befunge"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "[0-9a-f]" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "[\\+\\*/%!`-]" (Arbitrary "Operator")+ , tok "[<>^v?\\[\\]rxjk]" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "[:\\\\$.,n]" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "[|_mw]" (Arbitrary "Keyword")+ , tok "[{}]" (Arbitrary "Name" :. Arbitrary "Tag")+ , tok "\".*?\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "\\'." (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "[#;]" (Arbitrary "Comment")+ , tok "[pg&\126=@iotsy]" (Arbitrary "Keyword")+ , tok "[()A-Z]" (Arbitrary "Comment")+ , tok "\\s+" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/BlitzMax.hs view
@@ -0,0 +1,51 @@+module Text.Highlighter.Lexers.BlitzMax (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "BlitzMax"+ , lAliases = ["blitzmax", "bmax"]+ , lExtensions = [".bmx"]+ , lMimetypes = ["text/x-bmx"]+ , lStart = root'+ , lFlags = [caseless, multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "[ \\t]+" (Arbitrary "Text")+ , tok "\\.\\.\\n" (Arbitrary "Text")+ , tok "'.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "([ \\t]*)\\bRem\\n(\\n|.)*?\\s*\\bEnd([ \\t]*)Rem" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") (GoTo string')+ , tok "[0-9]+\\.[0-9]*(?!\\.)" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "\\.[0-9]*(?!\\.)" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\\$[0-9a-f]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "\\%[10]+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "(?:(?:(:)?([ \\t]*)(:?\\b(Shl|Shr|Sar|Mod)\\b|([+\\-*/&|\126]))|Or|And|Not|[=<>^]))" (Arbitrary "Operator")+ , tok "[(),.:\\[\\]]" (Arbitrary "Punctuation")+ , tok "(?:#[\\w \\t]*)" (Arbitrary "Name" :. Arbitrary "Label")+ , tok "(?:\\?[\\w \\t]*)" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "\\b(New)\\b([ \\t]?)([(]?)([a-z_][a-z0-9_]*)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Reserved"), (Arbitrary "Text"), (Arbitrary "Punctuation"), (Arbitrary "Name" :. Arbitrary "Class")])+ , tok "\\b(Import|Framework|Module)([ \\t]+)([a-z_][a-z0-9_]*\\.[a-z_][a-z0-9_]*)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Reserved"), (Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Namespace")])+ , tok "([a-z_][a-z0-9_]*)(?:(?:([ \\t]*)(@{1,2}|[!#$%])|([ \\t]*:[ \\t]*\\b(?:Shl|Shr|Sar|Mod)\\b)|([ \\t]*)([:])([ \\t]*)(?:\\b(Int|Byte|Short|Float|Double|Long)\\b|([a-z_][a-z0-9_]*)))(?:([ \\t]*)(Ptr))?)?((?:[ \\t]|\\.\\.\\n)*)([(])" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Type"), (Arbitrary "Operator"), (Arbitrary "Text"), (Arbitrary "Punctuation"), (Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Type"), (Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Type"), (Arbitrary "Text"), (Arbitrary "Punctuation")])+ , tok "([a-z_][a-z0-9_]*)(?:(?:([ \\t]*)(@{1,2}|[!#$%])|([ \\t]*:[ \\t]*\\b(?:Shl|Shr|Sar|Mod)\\b)|([ \\t]*)([:])([ \\t]*)(?:\\b(Int|Byte|Short|Float|Double|Long)\\b|([a-z_][a-z0-9_]*)))(?:([ \\t]*)(Ptr))?)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Type"), (Arbitrary "Operator"), (Arbitrary "Text"), (Arbitrary "Punctuation"), (Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Type"), (Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Type")])+ , tok "\\b(Type|Extends)([ \\t]+)([a-z_][a-z0-9_]*)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Reserved"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Class")])+ , tok "\\b(Ptr)\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "\\b(Pi|True|False|Null|Self|Super)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tok "\\b(Local|Global|Const|Field)\\b" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , tok "\\b(TNullMethodException|TNullFunctionException|TNullObjectException|TArrayBoundsException|TRuntimeException)\\b" (Arbitrary "Name" :. Arbitrary "Exception")+ , tok "\\b(Strict|SuperStrict|Module|ModuleInfo|End|Return|Continue|Exit|Public|Private|Var|VarPtr|Chr|Len|Asc|SizeOf|Sgn|Abs|Min|Max|New|Release|Delete|Incbin|IncbinPtr|IncbinLen|Framework|Include|Import|Extern|EndExtern|Function|EndFunction|Type|EndType|Extends|Method|EndMethod|Abstract|Final|If|Then|Else|ElseIf|EndIf|For|To|Next|Step|EachIn|While|Wend|EndWhile|Repeat|Until|Forever|Select|Case|Default|EndSelect|Try|Catch|EndTry|Throw|Assert|Goto|DefData|ReadData|RestoreData)\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "([a-z_][a-z0-9_]*)" (Arbitrary "Name" :. Arbitrary "Variable")+ ]++string' :: TokenMatcher+string' =+ [ tok "\"\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tokNext "\"C?" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") Pop+ , tok "[^\"]+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ ]+
+ src/Text/Highlighter/Lexers/Boo.hs view
@@ -0,0 +1,68 @@+module Text.Highlighter.Lexers.Boo (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Boo"+ , lAliases = ["boo"]+ , lExtensions = [".boo"]+ , lMimetypes = ["text/x-boo"]+ , lStart = root'+ , lFlags = [multiline]+ }++comment' :: TokenMatcher+comment' =+ [ tokNext "/[*]" (Arbitrary "Comment" :. Arbitrary "Multiline") Push+ , tokNext "[*]/" (Arbitrary "Comment" :. Arbitrary "Multiline") Pop+ , tok "[^/*]" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "[*/]" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]++classname' :: TokenMatcher+classname' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Class") Pop+ ]++namespace' :: TokenMatcher+namespace' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_.]*" (Arbitrary "Name" :. Arbitrary "Namespace") Pop+ ]++root' :: TokenMatcher+root' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "(#|//).*$" (Arbitrary "Comment" :. Arbitrary "Single")+ , tokNext "/[*]" (Arbitrary "Comment" :. Arbitrary "Multiline") (GoTo comment')+ , tok "[]{}:(),.;[]" (Arbitrary "Punctuation")+ , tok "\\\\\\n" (Arbitrary "Text")+ , tok "\\\\" (Arbitrary "Text")+ , tok "(in|is|and|or|not)\\b" (Arbitrary "Operator" :. Arbitrary "Word")+ , tok "/(\\\\\\\\|\\\\/|[^/\\s])/" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ , tok "@/(\\\\\\\\|\\\\/|[^/])*/" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ , tok "=\126|!=|==|<<|>>|[-+/*%=<>&^|]" (Arbitrary "Operator")+ , tok "(as|abstract|callable|constructor|destructor|do|import|enum|event|final|get|interface|internal|of|override|partial|private|protected|public|return|set|static|struct|transient|virtual|yield|super|and|break|cast|continue|elif|else|ensure|except|for|given|goto|if|in|is|isa|not|or|otherwise|pass|raise|ref|try|unless|when|while|from|as)\\b" (Arbitrary "Keyword")+ , tok "def(?=\\s+\\(.*?\\))" (Arbitrary "Keyword")+ , tokNext "(def)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo funcname')+ , tokNext "(class)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo classname')+ , tokNext "(namespace)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo namespace')+ , tok "(?<!\\.)(true|false|null|self|__eval__|__switch__|array|assert|checked|enumerate|filter|getter|len|lock|map|matrix|max|min|normalArrayIndexing|print|property|range|rawArrayIndexing|required|typeof|unchecked|using|yieldAll|zip)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "\"\"\"(\\\\|\\\"|.*?)\"\"\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "\"(\\\\|\\\"|[^\"]*?)\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "'(\\\\|\\'|[^']*?)'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name")+ , tok "(\\d+\\.\\d*|\\d*\\.\\d+)([fF][+-]?[0-9]+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "[0-9][0-9\\.]*(m|ms|d|h|s)" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "0\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "0x[a-fA-F0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "\\d+L" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer" :. Arbitrary "Long")+ , tok "\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ ]++funcname' :: TokenMatcher+funcname' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Function") Pop+ ]+
+ src/Text/Highlighter/Lexers/Brainfuck.hs view
@@ -0,0 +1,37 @@+module Text.Highlighter.Lexers.Brainfuck (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Brainfuck"+ , lAliases = ["brainfuck", "bf"]+ , lExtensions = [".bf", ".b"]+ , lMimetypes = ["application/x-brainfuck"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tokNext "\\[" (Arbitrary "Keyword") (GoTo loop')+ , tok "\\]" (Arbitrary "Error")+ , anyOf common'+ ]++common' :: TokenMatcher+common' =+ [ tok "[.,]+" (Arbitrary "Name" :. Arbitrary "Tag")+ , tok "[+-]+" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "[<>]+" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "[^.,+\\-<>\\[\\]]+" (Arbitrary "Comment")+ ]++loop' :: TokenMatcher+loop' =+ [ tokNext "\\[" (Arbitrary "Keyword") Push+ , tokNext "\\]" (Arbitrary "Keyword") Pop+ , anyOf common'+ ]+
+ src/Text/Highlighter/Lexers/C.hs view
@@ -0,0 +1,102 @@+module Text.Highlighter.Lexers.C (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "C"+ , lAliases = ["c"]+ , lExtensions = [".c", ".h"]+ , lMimetypes = ["text/x-chdr", "text/x-csrc"]+ , lStart = root'+ , lFlags = [multiline]+ }++function' :: TokenMatcher+function' =+ [ anyOf whitespace'+ , anyOf statements'+ , tok ";" (Arbitrary "Punctuation")+ , tokNext "{" (Arbitrary "Punctuation") Push+ , tokNext "}" (Arbitrary "Punctuation") Pop+ ]++statements' :: TokenMatcher+statements' =+ [ tokNext "L?\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo string')+ , tok "L?'(\\\\.|\\\\[0-7]{1,3}|\\\\x[a-fA-F0-9]{1,2}|[^\\\\\\'\\n])'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+)[eE][+-]?\\d+[LlUu]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+[fF])[fF]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0x[0-9a-fA-F]+[LlUu]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "0[0-7]+[LlUu]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "\\d+[LlUu]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\\*/" (Arbitrary "Error")+ , tok "[\126!%^&*+=|?:<>/-]" (Arbitrary "Operator")+ , tok "[()\\[\\],.]" (Arbitrary "Punctuation")+ , tok "\\b(case)(.+?)(:)" (ByGroups [(Arbitrary "Keyword"), (Using lexer), (Arbitrary "Text")])+ , tok "(auto|break|case|const|continue|default|do|else|enum|extern|for|goto|if|register|restricted|return|sizeof|static|struct|switch|typedef|union|volatile|virtual|while)\\b" (Arbitrary "Keyword")+ , tok "(int|long|float|short|double|char|unsigned|signed|void)\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "(_{0,2}inline|naked|restrict|thread|typename)\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "__(asm|int8|based|except|int16|stdcall|cdecl|fastcall|int32|declspec|finally|int64|try|leave)\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "(true|false|NULL)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name")+ ]++whitespace' :: TokenMatcher+whitespace' =+ [ tokNext "^#if\\s+0" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo if0')+ , tokNext "^#" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo macro')+ , tokNext "^(?:\\s|//.*?\\n|/[*].*?[*]/)+#if\\s+0" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo if0')+ , tokNext "^(?:\\s|//.*?\\n|/[*].*?[*]/)+#" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo macro')+ , tok "^(\\s*)([a-zA-Z_][a-zA-Z0-9_]*:(?!:))" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Label")])+ , tok "\\n" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ , tok "\\\\\\n" (Arbitrary "Text")+ , tok "//(\\n|(.|\\n)*?[^\\\\]\\n)" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/(\\\\\\n)?[*](.|\\n)*?[*](\\\\\\n)?/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]++statement' :: TokenMatcher+statement' =+ [ anyOf whitespace'+ , anyOf statements'+ , tok "[{}]" (Arbitrary "Punctuation")+ , tokNext ";" (Arbitrary "Punctuation") Pop+ ]++if0' :: TokenMatcher+if0' =+ [ tokNext "^\\s*#if.*?(?<!\\\\)\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Push+ , tokNext "^\\s*#el(?:se|if).*\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ , tokNext "^\\s*#endif.*?(?<!\\\\)\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ , tok ".*?\\n" (Arbitrary "Comment")+ ]++macro' :: TokenMatcher+macro' =+ [ tok "[^/\\n]+" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "/[*](.|\\n)*?[*]/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "//.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single") Pop+ , tok "/" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "(?<=\\\\)\\n" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tokNext "\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ ]++root' :: TokenMatcher+root' =+ [ anyOf whitespace'+ , tokNext "((?:[a-zA-Z0-9_*\\s])+?(?:\\s|[*]))([a-zA-Z_][a-zA-Z0-9_]*)(\\s*\\([^;]*?\\))((?:\\s|//.*?\\n|/[*].*?[*]/)+)({)" (ByGroups [(Using lexer), (Arbitrary "Name" :. Arbitrary "Function"), (Using lexer), (Using lexer), (Arbitrary "Punctuation")]) (GoTo function')+ , tok "((?:[a-zA-Z0-9_*\\s])+?(?:\\s|[*]))([a-zA-Z_][a-zA-Z0-9_]*)(\\s*\\([^;]*?\\))((?:\\s|//.*?\\n|/[*].*?[*]/)+)(;)" (ByGroups [(Using lexer), (Arbitrary "Name" :. Arbitrary "Function"), (Using lexer), (Using lexer), (Arbitrary "Punctuation")])+ , tokNext "" (Arbitrary "Text") (GoTo statement')+ ]++string' :: TokenMatcher+string' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\([\\\\abfnrtv\"\\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "[^\\\\\"\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\" (Arbitrary "Literal" :. Arbitrary "String")+ ]+
+ src/Text/Highlighter/Lexers/CMake.hs view
@@ -0,0 +1,51 @@+module Text.Highlighter.Lexers.CMake (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "CMake"+ , lAliases = ["cmake"]+ , lExtensions = [".cmake", "CMakeLists.txt"]+ , lMimetypes = ["text/x-cmake"]+ , lStart = root'+ , lFlags = [multiline]+ }++keywords' :: TokenMatcher+keywords' =+ [ tok "\\b(WIN32|UNIX|APPLE|CYGWIN|BORLAND|MINGW|MSVC|MSVC_IDE|MSVC60|MSVC70|MSVC71|MSVC80|MSVC90)\\b" (Arbitrary "Keyword")+ ]++ws' :: TokenMatcher+ws' =+ [ tok "[ \\t]+" (Arbitrary "Text")+ , tok "#.+\\n" (Arbitrary "Comment")+ ]++args' :: TokenMatcher+args' =+ [ tokNext "\\(" (Arbitrary "Punctuation") Push+ , tokNext "\\)" (Arbitrary "Punctuation") Pop+ , tok "(\\${)(.+?)(})" (ByGroups [(Arbitrary "Operator"), (Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Operator")])+ , tok "(?s)\".*?\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "\\\\\\S+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "[^\\)$\"# \\t\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\n" (Arbitrary "Text")+ , anyOf keywords'+ , anyOf ws'+ ]++root' :: TokenMatcher+root' =+ [ tokNext "\\b([A-Za-z_]+)([ \\t]*)(\\()" (ByGroups [(Arbitrary "Name" :. Arbitrary "Builtin"), (Arbitrary "Text"), (Arbitrary "Punctuation")]) (GoTo args')+ , anyOf keywords'+ , anyOf ws'+ ]++string' :: TokenMatcher+string' =+ [ + ]+
+ src/Text/Highlighter/Lexers/Clojure.hs view
@@ -0,0 +1,37 @@+module Text.Highlighter.Lexers.Clojure (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Clojure"+ , lAliases = ["clojure", "clj"]+ , lExtensions = [".clj"]+ , lMimetypes = ["text/x-clojure", "application/x-clojure"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok ";.*$" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "\\s+" (Arbitrary "Text")+ , tok "-?\\d+\\.\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "-?\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "'[a-zA-Z0-9!$%&*+,/:<=>?@^_\126-]+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol")+ , tok "\\\\([()/'\\\".'_!\195\130\194\167$%& ?;=#+-]{1}|[a-zA-Z0-9]+)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "(#t|#f)" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "('|#|`|,@|,|\\.)" (Arbitrary "Operator")+ , tok "(fn |def |defn |defmacro |defmethod |defmulti |defn\\- |defstruct |if |cond |let |for )" (Arbitrary "Keyword")+ , tok "(?<='\\()[a-zA-Z0-9!$%&*+,/:<=>?@^_\126-]+" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "(?<=#\\()[a-zA-Z0-9!$%&*+,/:<=>?@^_\126-]+" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "(?<=\\()(\\. |\\.\\. |\\* |\\+ |\\- |\\-\\> |\\.\\. |\\/ |\\< |\\<\\= |\\= |\\=\\= |\\> |\\>\\= |accessor |agent |agent\\-errors |aget |alength |all\\-ns |alter |and |append\\-child |apply |array\\-map |aset |aset\\-boolean |aset\\-byte |aset\\-char |aset\\-double |aset\\-float |aset\\-int |aset\\-long |aset\\-short |assert |assoc |await |await\\-for |bean |binding |bit\\-and |bit\\-not |bit\\-or |bit\\-shift\\-left |bit\\-shift\\-right |bit\\-xor |boolean |branch\\? |butlast |byte |cast |char |children |class |clear\\-agent\\-errors |comment |commute |comp |comparator |complement |concat |conj |cons |constantly |construct\\-proxy |contains\\? |count |create\\-ns |create\\-struct |cycle |dec |deref |difference |disj |dissoc |distinct |doall |doc |dorun |doseq |dosync |dotimes |doto |double |down |drop |drop\\-while |edit |end\\? |ensure |eval |every\\? |false\\? |ffirst |file\\-seq |filter |find |find\\-doc |find\\-ns |find\\-var |first |float |flush |fnseq |frest |gensym |get |get\\-proxy\\-class |hash\\-map |hash\\-set |identical\\? |identity |if\\-let |import |in\\-ns |inc |index |insert\\-child |insert\\-left |insert\\-right |inspect\\-table |inspect\\-tree |instance\\? |int |interleave |intersection |into |into\\-array |iterate |join |key |keys |keyword |keyword\\? |last |lazy\\-cat |lazy\\-cons |left |lefts |line\\-seq |list |list\\* |load |load\\-file |locking |long |loop |macroexpand |macroexpand\\-1 |make\\-array |make\\-node |map |map\\-invert |map\\? |mapcat |max |max\\-key |memfn |merge |merge\\-with |meta |min |min\\-key |name |namespace |neg\\? |new |newline |next |nil\\? |node |not |not\\-any\\? |not\\-every\\? |not\\= |ns\\-imports |ns\\-interns |ns\\-map |ns\\-name |ns\\-publics |ns\\-refers |ns\\-resolve |ns\\-unmap |nth |nthrest |or |parse |partial |path |peek |pop |pos\\? |pr |pr\\-str |print |print\\-str |println |println\\-str |prn |prn\\-str |project |proxy |proxy\\-mappings |quot |rand |rand\\-int |range |re\\-find |re\\-groups |re\\-matcher |re\\-matches |re\\-pattern |re\\-seq |read |read\\-line |reduce |ref |ref\\-set |refer |rem |remove |remove\\-method |remove\\-ns |rename |rename\\-keys |repeat |replace |replicate |resolve |rest |resultset\\-seq |reverse |rfirst |right |rights |root |rrest |rseq |second |select |select\\-keys |send |send\\-off |seq |seq\\-zip |seq\\? |set |short |slurp |some |sort |sort\\-by |sorted\\-map |sorted\\-map\\-by |sorted\\-set |special\\-symbol\\? |split\\-at |split\\-with |str |string\\? |struct |struct\\-map |subs |subvec |symbol |symbol\\? |sync |take |take\\-nth |take\\-while |test |time |to\\-array |to\\-array\\-2d |tree\\-seq |true\\? |union |up |update\\-proxy |val |vals |var\\-get |var\\-set |var\\? |vector |vector\\-zip |vector\\? |when |when\\-first |when\\-let |when\\-not |with\\-local\\-vars |with\\-meta |with\\-open |with\\-out\\-str |xml\\-seq |xml\\-zip |zero\\? |zipmap |zipper )" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(?<=\\()[a-zA-Z0-9!$%&*+,/:<=>?@^_\126-]+" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "[a-zA-Z0-9!$%&*+,/:<=>?@^_\126-]+" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "(\\[|\\])" (Arbitrary "Punctuation")+ , tok "(\\{|\\})" (Arbitrary "Punctuation")+ , tok "(\\(|\\))" (Arbitrary "Punctuation")+ ]+
+ src/Text/Highlighter/Lexers/CoffeeScript.hs view
@@ -0,0 +1,55 @@+module Text.Highlighter.Lexers.CoffeeScript (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "CoffeeScript"+ , lAliases = ["coffee-script", "coffeescript"]+ , lExtensions = [".coffee"]+ , lMimetypes = ["text/coffeescript"]+ , lStart = root'+ , lFlags = [dotall]+ }++commentsandwhitespace' :: TokenMatcher+commentsandwhitespace' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "#.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ ]++root' :: TokenMatcher+root' =+ [ tokNext "^(?=\\s|/|<!--)" (Arbitrary "Text") (GoTo slashstartsregex')+ , anyOf commentsandwhitespace'+ , tokNext "\\+\\+|--|\126|&&|\\band\\b|\\bor\\b|\\bis\\b|\\bisnt\\b|\\bnot\\b|\\?|:|=|\\|\\||\\\\(?=\\n)|(<<|>>>?|==?|!=?|[-<>+*`%&\\|\\^/])=?" (Arbitrary "Operator") (GoTo slashstartsregex')+ , tok "\\([^()]*\\)\\s*->" (Arbitrary "Name" :. Arbitrary "Function")+ , tokNext "[{(\\[;,]" (Arbitrary "Punctuation") (GoTo slashstartsregex')+ , tok "[})\\].]" (Arbitrary "Punctuation")+ , tokNext "(for|in|of|while|break|return|continue|switch|when|then|if|else|throw|try|catch|finally|new|delete|typeof|instanceof|super|extends|this|class|by)\\b" (Arbitrary "Keyword") (GoTo slashstartsregex')+ , tok "(true|false|yes|no|on|off|null|NaN|Infinity|undefined)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tok "(Array|Boolean|Date|Error|Function|Math|netscape|Number|Object|Packages|RegExp|String|sun|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|document|window)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tokNext "[$a-zA-Z_][a-zA-Z0-9_\\.:]*\\s*[:=]\\s" (Arbitrary "Name" :. Arbitrary "Variable") (GoTo slashstartsregex')+ , tokNext "@[$a-zA-Z_][a-zA-Z0-9_\\.:]*\\s*[:=]\\s" (Arbitrary "Name" :. Arbitrary "Variable" :. Arbitrary "Instance") (GoTo slashstartsregex')+ , tokNext "@?[$a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Other") (GoTo slashstartsregex')+ , tok "[0-9][0-9]*\\.[0-9]+([eE][0-9]+)?[fd]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0x[0-9a-fA-F]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "'(\\\\\\\\|\\\\'|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ ]++slashstartsregex' :: TokenMatcher+slashstartsregex' =+ [ anyOf commentsandwhitespace'+ , tokNext "/(\\\\.|[^[/\\\\\\n]|\\[(\\\\.|[^\\]\\\\\\n])*])+/([gim]+\\b|\\B)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") Pop+ , tokNext "(?=/)" (Arbitrary "Text") (DoAll [Pop, (GoTo badregex')])+ , tokNext "" (Arbitrary "Text") Pop+ ]++badregex' :: TokenMatcher+badregex' =+ [ tokNext "\10" (Arbitrary "Text") Pop+ ]+
+ src/Text/Highlighter/Lexers/Coldfusion.hs view
@@ -0,0 +1,43 @@+module Text.Highlighter.Lexers.Coldfusion (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "cfstatement"+ , lAliases = ["cfs"]+ , lExtensions = []+ , lMimetypes = []+ , lStart = root'+ , lFlags = [caseless, multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "//.*" (Arbitrary "Comment")+ , tok "\\+\\+|--" (Arbitrary "Operator")+ , tok "[-+*/^&=!]" (Arbitrary "Operator")+ , tok "<=|>=|<|>" (Arbitrary "Operator")+ , tok "mod\\b" (Arbitrary "Operator")+ , tok "(eq|lt|gt|lte|gte|not|is|and|or)\\b" (Arbitrary "Operator")+ , tok "\\|\\||&&" (Arbitrary "Operator")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") (GoTo string')+ , tok "'.*?'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "\\d+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "(if|else|len|var|case|default|break|switch)\\b" (Arbitrary "Keyword")+ , tok "([A-Za-z_$][A-Za-z0-9_.]*)\\s*(\\()" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Punctuation")])+ , tok "[A-Za-z_$][A-Za-z0-9_.]*" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "[()\\[\\]{};:,.\\\\]" (Arbitrary "Punctuation")+ , tok "\\s+" (Arbitrary "Text")+ ]++string' :: TokenMatcher+string' =+ [ tok "\"\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "#.+?#" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interp")+ , tok "[^\"#]+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "#" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") Pop+ ]+
+ src/Text/Highlighter/Lexers/CommonLisp.hs view
@@ -0,0 +1,76 @@+module Text.Highlighter.Lexers.CommonLisp (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Common Lisp"+ , lAliases = ["common-lisp", "cl"]+ , lExtensions = [".cl", ".lisp", ".el"]+ , lMimetypes = ["text/x-common-lisp"]+ , lStart = root'+ , lFlags = [caseless, multiline]+ }++multilineComment' :: TokenMatcher+multilineComment' =+ [ tokNext "#\\|" (Arbitrary "Comment" :. Arbitrary "Multiline") Push+ , tokNext "\\|#" (Arbitrary "Comment" :. Arbitrary "Multiline") Pop+ , tok "[^|#]+" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "[|#]" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]++body' :: TokenMatcher+body' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok ";.*$" (Arbitrary "Comment" :. Arbitrary "Single")+ , tokNext "#\\|" (Arbitrary "Comment" :. Arbitrary "Multiline") (GoTo multilineComment')+ , tok "#\\d*Y.*$" (Arbitrary "Comment" :. Arbitrary "Special")+ , tok "\"(\\\\.|[^\"\\\\])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok ":(\\|[^|]+\\||(?:\\\\.|[a-zA-Z0-9!$%&*+-/<=>?@\\[\\]^_{}\126])(?:\\\\.|[a-zA-Z0-9!$%&*+-/<=>?@\\[\\]^_{}\126]|[#.:])*)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol")+ , tok "'(\\|[^|]+\\||(?:\\\\.|[a-zA-Z0-9!$%&*+-/<=>?@\\[\\]^_{}\126])(?:\\\\.|[a-zA-Z0-9!$%&*+-/<=>?@\\[\\]^_{}\126]|[#.:])*)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol")+ , tok "'" (Arbitrary "Operator")+ , tok "`" (Arbitrary "Operator")+ , tok "[-+]?\\d+\\.?(?=[ \"()\\'\\n,;`])" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "[-+]?\\d+/\\d+(?=[ \"()\\'\\n,;`])" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "[-+]?(\\d*\\.\\d+([defls][-+]?\\d+)?|\\d+(\\.\\d*)?[defls][-+]?\\d+)(?=[ \"()\\'\\n,;`])" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "#\\\\.(?=[ \"()\\'\\n,;`])" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "#\\\\(\\|[^|]+\\||(?:\\\\.|[a-zA-Z0-9!$%&*+-/<=>?@\\[\\]^_{}\126])(?:\\\\.|[a-zA-Z0-9!$%&*+-/<=>?@\\[\\]^_{}\126]|[#.:])*)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tokNext "#\\(" (Arbitrary "Operator") (GoTo body')+ , tok "#\\d*\\*[01]*" (Arbitrary "Literal" :. Arbitrary "Other")+ , tok "#:(\\|[^|]+\\||(?:\\\\.|[a-zA-Z0-9!$%&*+-/<=>?@\\[\\]^_{}\126])(?:\\\\.|[a-zA-Z0-9!$%&*+-/<=>?@\\[\\]^_{}\126]|[#.:])*)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol")+ , tok "#[.,]" (Arbitrary "Operator")+ , tok "#\\'" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "#[bB][+-]?[01]+(/[01]+)?" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "#[oO][+-]?[0-7]+(/[0-7]+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "#[xX][+-]?[0-9a-fA-F]+(/[0-9a-fA-F]+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "#\\d+[rR][+-]?[0-9a-zA-Z]+(/[0-9a-zA-Z]+)?" (Arbitrary "Literal" :. Arbitrary "Number")+ , tokNext "(#[cC])(\\()" (ByGroups [(Arbitrary "Literal" :. Arbitrary "Number"), (Arbitrary "Punctuation")]) (GoTo body')+ , tokNext "(#\\d+[aA])(\\()" (ByGroups [(Arbitrary "Literal" :. Arbitrary "Other"), (Arbitrary "Punctuation")]) (GoTo body')+ , tokNext "(#[sS])(\\()" (ByGroups [(Arbitrary "Literal" :. Arbitrary "Other"), (Arbitrary "Punctuation")]) (GoTo body')+ , tok "#[pP]?\"(\\\\.|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "Other")+ , tok "#\\d+=" (Arbitrary "Operator")+ , tok "#\\d+#" (Arbitrary "Operator")+ , tokNext "#+nil(?=[ \"()\\'\\n,;`])\\s*\\(" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo commentedForm')+ , tok "#[+-]" (Arbitrary "Operator")+ , tok "(,@|,|\\.)" (Arbitrary "Operator")+ , tok "(t|nil)(?=[ \"()\\'\\n,;`])" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "\\*(\\|[^|]+\\||(?:\\\\.|[a-zA-Z0-9!$%&*+-/<=>?@\\[\\]^_{}\126])(?:\\\\.|[a-zA-Z0-9!$%&*+-/<=>?@\\[\\]^_{}\126]|[#.:])*)\\*" (Arbitrary "Name" :. Arbitrary "Variable" :. Arbitrary "Global")+ , tok "(\\|[^|]+\\||(?:\\\\.|[a-zA-Z0-9!$%&*+-/<=>?@\\[\\]^_{}\126])(?:\\\\.|[a-zA-Z0-9!$%&*+-/<=>?@\\[\\]^_{}\126]|[#.:])*)" (Arbitrary "Name" :. Arbitrary "Variable")+ , tokNext "\\(" (Arbitrary "Punctuation") (GoTo body')+ , tokNext "\\)" (Arbitrary "Punctuation") Pop+ ]++root' :: TokenMatcher+root' =+ [ tokNext "" (Arbitrary "Text") (GoTo body')+ ]++commentedForm' :: TokenMatcher+commentedForm' =+ [ tokNext "\\(" (Arbitrary "Comment" :. Arbitrary "Preproc") Push+ , tokNext "\\)" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ , tok "[^()]+" (Arbitrary "Comment" :. Arbitrary "Preproc")+ ]+
+ src/Text/Highlighter/Lexers/Cpp.hs view
@@ -0,0 +1,81 @@+module Text.Highlighter.Lexers.Cpp (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "C++"+ , lAliases = ["cpp", "c++"]+ , lExtensions = [".cpp", ".hpp", ".c++", ".h++", ".cc", ".hh", ".cxx", ".hxx"]+ , lMimetypes = ["text/x-c++hdr", "text/x-c++src"]+ , lStart = root'+ , lFlags = [multiline]+ }++classname' :: TokenMatcher+classname' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Class") Pop+ , tokNext "\\s*(?=>)" (Arbitrary "Text") Pop+ ]++macro' :: TokenMatcher+macro' =+ [ tok "[^/\\n]+" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "/[*](.|\\n)*?[*]/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "//.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single") Pop+ , tok "/" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "(?<=\\\\)\\n" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tokNext "\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ ]++root' :: TokenMatcher+root' =+ [ tokNext "^#if\\s+0" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo if0')+ , tokNext "^#" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo macro')+ , tokNext "^(?:\\s|//.*?\\n|/[*].*?[*]/)+#if\\s+0" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo if0')+ , tokNext "^(?:\\s|//.*?\\n|/[*].*?[*]/)+#" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo macro')+ , tok "\\n" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ , tok "\\\\\\n" (Arbitrary "Text")+ , tok "/(\\\\\\n)?/(\\n|(.|\\n)*?[^\\\\]\\n)" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/(\\\\\\n)?[*](.|\\n)*?[*](\\\\\\n)?/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "[{}]" (Arbitrary "Punctuation")+ , tokNext "L?\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo string')+ , tok "L?'(\\\\.|\\\\[0-7]{1,3}|\\\\x[a-fA-F0-9]{1,2}|[^\\\\\\'\\n])'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+)[eE][+-]?\\d+[LlUu]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+[fF])[fF]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0x[0-9a-fA-F]+[LlUu]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "0[0-7]+[LlUu]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "\\d+[LlUu]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\\*/" (Arbitrary "Error")+ , tok "[\126!%^&*+=|?:<>/-]" (Arbitrary "Operator")+ , tok "[()\\[\\],.;]" (Arbitrary "Punctuation")+ , tok "(asm|auto|break|case|catch|const|const_cast|continue|default|delete|do|dynamic_cast|else|enum|explicit|export|extern|for|friend|goto|if|mutable|namespace|new|operator|private|protected|public|register|reinterpret_cast|return|restrict|sizeof|static|static_cast|struct|switch|template|this|throw|throws|try|typedef|typeid|typename|union|using|volatile|virtual|while)\\b" (Arbitrary "Keyword")+ , tokNext "(class)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo classname')+ , tok "(bool|int|long|float|short|double|char|unsigned|signed|void|wchar_t)\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "(_{0,2}inline|naked|thread)\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "__(asm|int8|based|except|int16|stdcall|cdecl|fastcall|int32|declspec|finally|int64|try|leave|wchar_t|w64|virtual_inheritance|uuidof|unaligned|super|single_inheritance|raise|noop|multiple_inheritance|m128i|m128d|m128|m64|interface|identifier|forceinline|event|assume)\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "(__offload|__blockingoffload|__outer)\\b" (Arbitrary "Keyword" :. Arbitrary "Psuedo")+ , tok "(true|false)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tok "NULL\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "[a-zA-Z_][a-zA-Z0-9_]*:(?!:)" (Arbitrary "Name" :. Arbitrary "Label")+ , tok "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name")+ ]++string' :: TokenMatcher+string' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\([\\\\abfnrtv\"\\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "[^\\\\\"\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\" (Arbitrary "Literal" :. Arbitrary "String")+ ]++if0' :: TokenMatcher+if0' =+ [ tokNext "^\\s*#if.*?(?<!\\\\)\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Push+ , tokNext "^\\s*#endif.*?(?<!\\\\)\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ , tok ".*?\\n" (Arbitrary "Comment")+ ]+
+ src/Text/Highlighter/Lexers/Css.hs view
@@ -0,0 +1,68 @@+module Text.Highlighter.Lexers.Css (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "CSS"+ , lAliases = ["css"]+ , lExtensions = [".css"]+ , lMimetypes = ["text/css"]+ , lStart = root'+ , lFlags = [multiline]+ }++content' :: TokenMatcher+content' =+ [ tok "\\s+" (Arbitrary "Text")+ , tokNext "}" (Arbitrary "Punctuation") Pop+ , tok "url\\(.*?\\)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ , tok "^@.*?$" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "(azimuth|background-attachment|background-color|background-image|background-position|background-repeat|background|border-bottom-color|border-bottom-style|border-bottom-width|border-left-color|border-left-style|border-left-width|border-right|border-right-color|border-right-style|border-right-width|border-top-color|border-top-style|border-top-width|border-bottom|border-collapse|border-left|border-width|border-color|border-spacing|border-style|border-top|border|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|height|letter-spacing|line-height|list-style-type|list-style-image|list-style-position|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|marker-offset|marks|max-height|max-width|min-height|min-width|opacity|orphans|outline|outline-color|outline-style|outline-width|overflow(?:-x|-y|)|padding-bottom|padding-left|padding-right|padding-top|padding|page|page-break-after|page-break-before|page-break-inside|pause-after|pause-before|pause|pitch|pitch-range|play-during|position|quotes|richness|right|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|z-index|bottom|left|above|absolute|always|armenian|aural|auto|avoid|baseline|behind|below|bidi-override|blink|block|bold|bolder|both|capitalize|center-left|center-right|center|circle|cjk-ideographic|close-quote|collapse|condensed|continuous|crop|crosshair|cross|cursive|dashed|decimal-leading-zero|decimal|default|digits|disc|dotted|double|e-resize|embed|extra-condensed|extra-expanded|expanded|fantasy|far-left|far-right|faster|fast|fixed|georgian|groove|hebrew|help|hidden|hide|higher|high|hiragana-iroha|hiragana|icon|inherit|inline-table|inline|inset|inside|invert|italic|justify|katakana-iroha|katakana|landscape|larger|large|left-side|leftwards|level|lighter|line-through|list-item|loud|lower-alpha|lower-greek|lower-roman|lowercase|ltr|lower|low|medium|message-box|middle|mix|monospace|n-resize|narrower|ne-resize|no-close-quote|no-open-quote|no-repeat|none|normal|nowrap|nw-resize|oblique|once|open-quote|outset|outside|overline|pointer|portrait|px|relative|repeat-x|repeat-y|repeat|rgb|ridge|right-side|rightwards|s-resize|sans-serif|scroll|se-resize|semi-condensed|semi-expanded|separate|serif|show|silent|slow|slower|small-caps|small-caption|smaller|soft|solid|spell-out|square|static|status-bar|super|sw-resize|table-caption|table-cell|table-column|table-column-group|table-footer-group|table-header-group|table-row|table-row-group|text|text-bottom|text-top|thick|thin|transparent|ultra-condensed|ultra-expanded|underline|upper-alpha|upper-latin|upper-roman|uppercase|url|visible|w-resize|wait|wider|x-fast|x-high|x-large|x-loud|x-low|x-small|x-soft|xx-large|xx-small|yes)\\b" (Arbitrary "Keyword")+ , tok "(indigo|gold|firebrick|indianred|yellow|darkolivegreen|darkseagreen|mediumvioletred|mediumorchid|chartreuse|mediumslateblue|black|springgreen|crimson|lightsalmon|brown|turquoise|olivedrab|cyan|silver|skyblue|gray|darkturquoise|goldenrod|darkgreen|darkviolet|darkgray|lightpink|teal|darkmagenta|lightgoldenrodyellow|lavender|yellowgreen|thistle|violet|navy|orchid|blue|ghostwhite|honeydew|cornflowerblue|darkblue|darkkhaki|mediumpurple|cornsilk|red|bisque|slategray|darkcyan|khaki|wheat|deepskyblue|darkred|steelblue|aliceblue|gainsboro|mediumturquoise|floralwhite|coral|purple|lightgrey|lightcyan|darksalmon|beige|azure|lightsteelblue|oldlace|greenyellow|royalblue|lightseagreen|mistyrose|sienna|lightcoral|orangered|navajowhite|lime|palegreen|burlywood|seashell|mediumspringgreen|fuchsia|papayawhip|blanchedalmond|peru|aquamarine|white|darkslategray|ivory|dodgerblue|lemonchiffon|chocolate|orange|forestgreen|slateblue|olive|mintcream|antiquewhite|darkorange|cadetblue|moccasin|limegreen|saddlebrown|darkslateblue|lightskyblue|deeppink|plum|aqua|darkgoldenrod|maroon|sandybrown|magenta|tan|rosybrown|pink|lightblue|palevioletred|mediumseagreen|dimgray|powderblue|seagreen|snow|mediumblue|midnightblue|paleturquoise|palegoldenrod|whitesmoke|darkorchid|salmon|lightslategray|lawngreen|lightgreen|tomato|hotpink|lightyellow|lavenderblush|linen|mediumaquamarine|green|blueviolet|peachpuff)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "\\!important" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "/\\*(?:.|\\n)*?\\*/" (Arbitrary "Comment")+ , tok "\\#[a-zA-Z0-9]{1,6}" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "[\\.-]?[0-9]*[\\.]?[0-9]+(em|px|\\%|pt|pc|in|mm|cm|ex|s)\\b" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "-?[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "[\126\\^\\*!%&<>\\|+=@:,./?-]+" (Arbitrary "Operator")+ , tok "[\\[\\]();]+" (Arbitrary "Punctuation")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "'(\\\\\\\\|\\\\'|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "[a-zA-Z][a-zA-Z0-9]+" (Arbitrary "Name")+ ]++basics' :: TokenMatcher+basics' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "/\\*(?:.|\\n)*?\\*/" (Arbitrary "Comment")+ , tokNext "{" (Arbitrary "Punctuation") (GoTo content')+ , tok "\\:[a-zA-Z0-9_-]+" (Arbitrary "Name" :. Arbitrary "Decorator")+ , tok "\\.[a-zA-Z0-9_-]+" (Arbitrary "Name" :. Arbitrary "Class")+ , tok "\\#[a-zA-Z0-9_-]+" (Arbitrary "Name" :. Arbitrary "Function")+ , tokNext "@[a-zA-Z0-9_-]+" (Arbitrary "Keyword") (GoTo atrule')+ , tok "[a-zA-Z0-9_-]+" (Arbitrary "Name" :. Arbitrary "Tag")+ , tok "[\126\\^\\*!%&\\[\\]\\(\\)<>\\|+=@:;,./?-]" (Arbitrary "Operator")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "'(\\\\\\\\|\\\\'|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ ]++root' :: TokenMatcher+root' =+ [ anyOf basics'+ ]++atcontent' :: TokenMatcher+atcontent' =+ [ anyOf basics'+ , tokNext "}" (Arbitrary "Punctuation") (PopNum 2)+ ]++atrule' :: TokenMatcher+atrule' =+ [ tokNext "{" (Arbitrary "Punctuation") (GoTo atcontent')+ , tokNext ";" (Arbitrary "Punctuation") Pop+ , anyOf basics'+ ]+
+ src/Text/Highlighter/Lexers/Cython.hs view
@@ -0,0 +1,167 @@+module Text.Highlighter.Lexers.Cython (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Cython"+ , lAliases = ["cython", "pyx"]+ , lExtensions = [".pyx", ".pxd", ".pxi"]+ , lMimetypes = ["text/x-cython", "application/x-cython"]+ , lStart = root'+ , lFlags = [multiline]+ }++tsqs' :: TokenMatcher+tsqs' =+ [ tokNext "'''" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , anyOf strings'+ , anyOf nl'+ ]++builtins' :: TokenMatcher+builtins' =+ [ tok "(?<!\\.)(__import__|abs|all|any|apply|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|exit|file|filter|float|frozenset|getattr|globals|hasattr|hash|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(?<!\\.)(self|None|Ellipsis|NotImplemented|False|True|NULL)\\b" (Arbitrary "Name" :. Arbitrary "Builtin" :. Arbitrary "Pseudo")+ , tok "(?<!\\.)(ArithmeticError|AssertionError|AttributeError|BaseException|DeprecationWarning|EOFError|EnvironmentError|Exception|FloatingPointError|FutureWarning|GeneratorExit|IOError|ImportError|ImportWarning|IndentationError|IndexError|KeyError|KeyboardInterrupt|LookupError|MemoryError|NameError|NotImplemented|NotImplementedError|OSError|OverflowError|OverflowWarning|PendingDeprecationWarning|ReferenceError|RuntimeError|RuntimeWarning|StandardError|StopIteration|SyntaxError|SyntaxWarning|SystemError|SystemExit|TabError|TypeError|UnboundLocalError|UnicodeDecodeError|UnicodeEncodeError|UnicodeError|UnicodeTranslateError|UnicodeWarning|UserWarning|ValueError|Warning|ZeroDivisionError)\\b" (Arbitrary "Name" :. Arbitrary "Exception")+ ]++name' :: TokenMatcher+name' =+ [ tok "@[a-zA-Z0-9_]+" (Arbitrary "Name" :. Arbitrary "Decorator")+ , tok "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name")+ ]++dqs' :: TokenMatcher+dqs' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\\\\\|\\\\\"|\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , anyOf strings'+ ]++sqs' :: TokenMatcher+sqs' =+ [ tokNext "'" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\\\\\|\\\\'|\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , anyOf strings'+ ]++tdqs' :: TokenMatcher+tdqs' =+ [ tokNext "\"\"\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , anyOf strings'+ , anyOf nl'+ ]++backtick' :: TokenMatcher+backtick' =+ [ tok "`.*?`" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Backtick")+ ]++funcname' :: TokenMatcher+funcname' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Function") Pop+ ]++classname' :: TokenMatcher+classname' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Class") Pop+ ]++stringescape' :: TokenMatcher+stringescape' =+ [ tok "\\\\([\\\\abfnrtv\"\\']|\\n|N{.*?}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ ]++numbers' :: TokenMatcher+numbers' =+ [ tok "(\\d+\\.?\\d*|\\d*\\.\\d+)([eE][+-]?[0-9]+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "0[xX][a-fA-F0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "\\d+L" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer" :. Arbitrary "Long")+ , tok "\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ ]++import' :: TokenMatcher+import' =+ [ tok "(\\s+)(as)(\\s+)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text")])+ , tok "[a-zA-Z_][a-zA-Z0-9_.]*" (Arbitrary "Name" :. Arbitrary "Namespace")+ , tok "(\\s*)(,)(\\s*)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Operator"), (Arbitrary "Text")])+ , tokNext "" (Arbitrary "Text") Pop+ ]++keywords' :: TokenMatcher+keywords' =+ [ tok "(assert|break|by|continue|ctypedef|del|elif|else|except\\??|exec|finally|for|gil|global|if|include|lambda|nogil|pass|print|raise|return|try|while|yield|as|with)\\b" (Arbitrary "Keyword")+ , tok "(DEF|IF|ELIF|ELSE)\\b" (Arbitrary "Comment" :. Arbitrary "Preproc")+ ]++cdef' :: TokenMatcher+cdef' =+ [ tok "(public|readonly|extern|api|inline)\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "(struct|enum|union|class)\\b" (Arbitrary "Keyword")+ , tokNext "([a-zA-Z_][a-zA-Z0-9_]*)(\\s*)(?=[(:#=]|$)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text")]) Pop+ , tok "([a-zA-Z_][a-zA-Z0-9_]*)(\\s*)(,)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Punctuation")])+ , tokNext "from\\b" (Arbitrary "Keyword") Pop+ , tok "as\\b" (Arbitrary "Keyword")+ , tokNext ":" (Arbitrary "Punctuation") Pop+ , tokNext "(?=[\"\\'])" (Arbitrary "Text") Pop+ , tok "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "." (Arbitrary "Text")+ ]++nl' :: TokenMatcher+nl' =+ [ tok "\\n" (Arbitrary "Literal" :. Arbitrary "String")+ ]++root' :: TokenMatcher+root' =+ [ tok "\\n" (Arbitrary "Text")+ , tok "^(\\s*)(\"\"\"(?:.|\\n)*?\"\"\")" (ByGroups [(Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Doc")])+ , tok "^(\\s*)('''(?:.|\\n)*?''')" (ByGroups [(Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Doc")])+ , tok "[^\\S\\n]+" (Arbitrary "Text")+ , tok "#.*$" (Arbitrary "Comment")+ , tok "[]{}:(),;[]" (Arbitrary "Punctuation")+ , tok "\\\\\\n" (Arbitrary "Text")+ , tok "\\\\" (Arbitrary "Text")+ , tok "(in|is|and|or|not)\\b" (Arbitrary "Operator" :. Arbitrary "Word")+ , tok "(<)([a-zA-Z0-9.?]+)(>)" (ByGroups [(Arbitrary "Punctuation"), (Arbitrary "Keyword" :. Arbitrary "Type"), (Arbitrary "Punctuation")])+ , tok "!=|==|<<|>>|[-\126+/*%=<>&^|.?]" (Arbitrary "Operator")+ , tok "(from)(\\d+)(<=)(\\s+)(<)(\\d+)(:)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer"), (Arbitrary "Operator"), (Arbitrary "Name"), (Arbitrary "Operator"), (Arbitrary "Name"), (Arbitrary "Punctuation")])+ , anyOf keywords'+ , tokNext "(def|property)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo funcname')+ , tokNext "(cp?def)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo cdef')+ , tokNext "(class|struct)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo classname')+ , tokNext "(from)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo fromimport')+ , tokNext "(c?import)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo import')+ , anyOf builtins'+ , anyOf backtick'+ , tokNext "(?:[rR]|[uU][rR]|[rR][uU])\"\"\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo tdqs')+ , tokNext "(?:[rR]|[uU][rR]|[rR][uU])'''" (Arbitrary "Literal" :. Arbitrary "String") (GoTo tsqs')+ , tokNext "(?:[rR]|[uU][rR]|[rR][uU])\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo dqs')+ , tokNext "(?:[rR]|[uU][rR]|[rR][uU])'" (Arbitrary "Literal" :. Arbitrary "String") (GoTo sqs')+ , tokNext "[uU]?\"\"\"" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', tdqs'])+ , tokNext "[uU]?'''" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', tsqs'])+ , tokNext "[uU]?\"" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', dqs'])+ , tokNext "[uU]?'" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', sqs'])+ , anyOf name'+ , anyOf numbers'+ ]++strings' :: TokenMatcher+strings' =+ [ tok "%(\\([a-zA-Z0-9]+\\))?[-#0 +]*([0-9]+|[*])?(\\.([0-9]+|[*]))?[hlL]?[diouxXeEfFgGcrs%]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol")+ , tok "[^\\\\\\'\"%\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "[\\'\"\\\\]" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "%" (Arbitrary "Literal" :. Arbitrary "String")+ ]++fromimport' :: TokenMatcher+fromimport' =+ [ tokNext "(\\s+)(c?import)\\b" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword")]) Pop+ , tok "[a-zA-Z_.][a-zA-Z0-9_.]*" (Arbitrary "Name" :. Arbitrary "Namespace")+ , tokNext "" (Arbitrary "Text") Pop+ ]+
+ src/Text/Highlighter/Lexers/D.hs view
@@ -0,0 +1,129 @@+module Text.Highlighter.Lexers.D (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "D"+ , lAliases = ["d"]+ , lExtensions = [".d", ".di"]+ , lMimetypes = ["text/x-dsrc"]+ , lStart = root'+ , lFlags = [multiline]+ }++delimited_parenthesis' :: TokenMatcher+delimited_parenthesis' =+ [ tok "[^\\(\\)]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "\\(" (Arbitrary "Literal" :. Arbitrary "String") (GoTo delimited_inside_parenthesis')+ , tokNext "\\)\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]++delimited_curly' :: TokenMatcher+delimited_curly' =+ [ tok "[^{}]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "{" (Arbitrary "Literal" :. Arbitrary "String") (GoTo delimited_inside_curly')+ , tokNext "}\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]++delimited_angle' :: TokenMatcher+delimited_angle' =+ [ tok "[^<>]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "<" (Arbitrary "Literal" :. Arbitrary "String") (GoTo delimited_inside_angle')+ , tokNext ">\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]++delimited_inside_parenthesis' :: TokenMatcher+delimited_inside_parenthesis' =+ [ tok "[^\\(\\)]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "\\(" (Arbitrary "Literal" :. Arbitrary "String") Push+ , tokNext "\\)" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]++delimited_inside_curly' :: TokenMatcher+delimited_inside_curly' =+ [ tok "[^{}]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "{" (Arbitrary "Literal" :. Arbitrary "String") Push+ , tokNext "}" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]++delimited_inside_bracket' :: TokenMatcher+delimited_inside_bracket' =+ [ tok "[^\\[\\]]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "\\[" (Arbitrary "Literal" :. Arbitrary "String") Push+ , tokNext "\\]" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]++token_string_nest' :: TokenMatcher+token_string_nest' =+ [ tokNext "{" (Arbitrary "Punctuation") Push+ , tokNext "}" (Arbitrary "Punctuation") Pop+ , anyOf root'+ ]++delimited_bracket' :: TokenMatcher+delimited_bracket' =+ [ tok "[^\\[\\]]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "\\[" (Arbitrary "Literal" :. Arbitrary "String") (GoTo delimited_inside_bracket')+ , tokNext "\\]\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]++token_string' :: TokenMatcher+token_string' =+ [ tokNext "{" (Arbitrary "Punctuation") (GoTo token_string_nest')+ , tokNext "}" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , anyOf root'+ ]++delimited_inside_angle' :: TokenMatcher+delimited_inside_angle' =+ [ tok "[^<>]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "<" (Arbitrary "Literal" :. Arbitrary "String") Push+ , tokNext ">" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]++root' :: TokenMatcher+root' =+ [ tok "\\n" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ , tok "//(.*?)\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/(\\\\\\n)?[*](.|\\n)*?[*](\\\\\\n)?/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "/\\+" (Arbitrary "Comment" :. Arbitrary "Multiline") (GoTo nested_comment')+ , tok "(abstract|alias|align|asm|assert|auto|body|break|case|cast|catch|class|const|continue|debug|default|delegate|delete|deprecated|do|else|enum|export|extern|finally|final|foreach_reverse|foreach|for|function|goto|if|import|inout|interface|invariant|in|is|lazy|mixin|module|new|nothrow|out|override|package|pragma|private|protected|public|pure|ref|return|scope|static|struct|super|switch|synchronized|template|this|throw|try|typedef|typeid|typeof|union|unittest|version|volatile|while|with|__traits)\\b" (Arbitrary "Keyword")+ , tok "(bool|byte|cdouble|cent|cfloat|char|creal|dchar|double|float|idouble|ifloat|int|ireal|long|real|short|ubyte|ucent|uint|ulong|ushort|void|wchar)\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "(false|true|null)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tok "macro\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "(string|wstring|dstring)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "0[xX]([0-9a-fA-F_]*\\.[0-9a-fA-F_]+|[0-9a-fA-F_]+)[pP][+\\-]?[0-9_]+[fFL]?[i]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "[0-9_]+(\\.[0-9_]+[eE][+\\-]?[0-9_]+|\\.[0-9_]*|[eE][+\\-]?[0-9_]+)[fFL]?[i]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "\\.(0|[1-9][0-9_]*)([eE][+\\-]?[0-9_]+)?[fFL]?[i]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0[Bb][01_]+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "0[0-7_]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "0[xX][0-9a-fA-F_]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "(0|[1-9][0-9_]*)([LUu]|Lu|LU|uL|UL)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "'(\\\\['\"?\\\\abfnrtv]|\\\\x[0-9a-fA-F]{2}|\\\\[0-7]{1,3}|\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}|\\\\&\\w+;|.)'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "r\"[^\"]*\"[cwd]?" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "`[^`]*`[cwd]?" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"[cwd]?" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\(['\\\"?\\\\abfnrtv]|x[0-9a-fA-F]{2}|[0-7]{1,3}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|&\\w+;)" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "x\"[0-9a-fA-F_\\s]*\"[cwd]?" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "q\"\\[" (Arbitrary "Literal" :. Arbitrary "String") (GoTo delimited_bracket')+ , tokNext "q\"\\(" (Arbitrary "Literal" :. Arbitrary "String") (GoTo delimited_parenthesis')+ , tokNext "q\"<" (Arbitrary "Literal" :. Arbitrary "String") (GoTo delimited_angle')+ , tokNext "q\"{" (Arbitrary "Literal" :. Arbitrary "String") (GoTo delimited_curly')+ , tok "q\"([a-zA-Z_]\\w*)\\n.*?\\n\\1\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "q\"(.).*?\\1\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "q{" (Arbitrary "Literal" :. Arbitrary "String") (GoTo token_string')+ , tok "(\126=|\\^=|%=|\\*=|==|!>=|!<=|!<>=|!<>|!<|!>|!=|>>>=|>>>|>>=|>>|>=|<>=|<>|<<=|<<|<=|\\+\\+|\\+=|--|-=|\\|\\||\\|=|&&|&=|\\.\\.\\.|\\.\\.|/=)|[/.&|\\-+<>!()\\[\\]{}?,;:$=*%^\126]" (Arbitrary "Punctuation")+ , tok "[a-zA-Z_]\\w*" (Arbitrary "Name")+ ]++nested_comment' :: TokenMatcher+nested_comment' =+ [ tok "[^+/]+" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "/\\+" (Arbitrary "Comment" :. Arbitrary "Multiline") Push+ , tokNext "\\+/" (Arbitrary "Comment" :. Arbitrary "Multiline") Pop+ , tok "[+/]" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]+
+ src/Text/Highlighter/Lexers/DarcsPatch.hs view
@@ -0,0 +1,58 @@+module Text.Highlighter.Lexers.DarcsPatch (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Darcs Patch"+ , lAliases = ["dpatch"]+ , lExtensions = [".dpatch", ".darcspatch"]+ , lMimetypes = []+ , lStart = root'+ , lFlags = [multiline]+ }++comment' :: TokenMatcher+comment' =+ [ tok "[^\\]].*\\n" (Arbitrary "Comment")+ , tokNext "\\]" (Arbitrary "Operator") Pop+ ]++insert' :: TokenMatcher+insert' =+ [ anyOf specialText'+ , tok "\\[" (Arbitrary "Generic" :. Arbitrary "Inserted")+ , tok "[^\\n\\[]*" (Arbitrary "Generic" :. Arbitrary "Inserted")+ ]++delete' :: TokenMatcher+delete' =+ [ anyOf specialText'+ , tok "\\[" (Arbitrary "Generic" :. Arbitrary "Deleted")+ , tok "[^\\n\\[]*" (Arbitrary "Generic" :. Arbitrary "Deleted")+ ]++root' :: TokenMatcher+root' =+ [ tok "<" (Arbitrary "Operator")+ , tok ">" (Arbitrary "Operator")+ , tok "{" (Arbitrary "Operator")+ , tok "}" (Arbitrary "Operator")+ , tok "(\\[)((?:TAG )?)(.*)(\\n)(.*)(\\*\\*)(\\d+)(\\s?)(\\])" (ByGroups [(Arbitrary "Operator"), (Arbitrary "Keyword"), (Arbitrary "Name"), (Arbitrary "Text"), (Arbitrary "Name"), (Arbitrary "Operator"), (Arbitrary "Literal" :. Arbitrary "Date"), (Arbitrary "Text"), (Arbitrary "Operator")])+ , tokNext "(\\[)((?:TAG )?)(.*)(\\n)(.*)(\\*\\*)(\\d+)(\\s?)" (ByGroups [(Arbitrary "Operator"), (Arbitrary "Keyword"), (Arbitrary "Name"), (Arbitrary "Text"), (Arbitrary "Name"), (Arbitrary "Operator"), (Arbitrary "Literal" :. Arbitrary "Date"), (Arbitrary "Text")]) (GoTo comment')+ , tok "New patches:" (Arbitrary "Generic" :. Arbitrary "Heading")+ , tok "Context:" (Arbitrary "Generic" :. Arbitrary "Heading")+ , tok "Patch bundle hash:" (Arbitrary "Generic" :. Arbitrary "Heading")+ , tok "(\\s*)(hunk|addfile|adddir|rmfile|rmdir|move|replace)(.*\\n)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text")])+ , tokNext "\\+" (Arbitrary "Generic" :. Arbitrary "Inserted") (GoTo insert')+ , tokNext "-" (Arbitrary "Generic" :. Arbitrary "Deleted") (GoTo delete')+ , tok ".*\\n" (Arbitrary "Text")+ ]++specialText' :: TokenMatcher+specialText' =+ [ tokNext "\\n" (Arbitrary "Text") Pop+ , tok "\\[_[^_]*_]" (Arbitrary "Operator")+ ]+
+ src/Text/Highlighter/Lexers/DebianControl.hs view
@@ -0,0 +1,64 @@+module Text.Highlighter.Lexers.DebianControl (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Debian Control file"+ , lAliases = ["control"]+ , lExtensions = ["control"]+ , lMimetypes = []+ , lStart = root'+ , lFlags = [multiline]+ }++maintainer' :: TokenMatcher+maintainer' =+ [ tok "<[^>]+>" (Arbitrary "Generic" :. Arbitrary "Strong")+ , tokNext "<[^>]+>$" (Arbitrary "Generic" :. Arbitrary "Strong") Pop+ , tok ",\\n?" (Arbitrary "Text")+ , tok "." (Arbitrary "Text")+ ]++depends' :: TokenMatcher+depends' =+ [ tok ":\\s*" (Arbitrary "Text")+ , tok "(\\$)(\\{)(\\w+\\s*:\\s*\\w+)" (ByGroups [(Arbitrary "Operator"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Entity")])+ , tokNext "\\(" (Arbitrary "Text") (GoTo depend_vers')+ , tok "," (Arbitrary "Text")+ , tok "\\|" (Arbitrary "Operator")+ , tok "[\\s]+" (Arbitrary "Text")+ , tokNext "[}\\)]\\s*$" (Arbitrary "Text") Pop+ , tok "[}]" (Arbitrary "Text")+ , tokNext "[^,]$" (Arbitrary "Name" :. Arbitrary "Function") Pop+ , tok "([\\+\\.a-zA-Z0-9-][\\s\\n]*)" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "\\[.*?\\]" (Arbitrary "Name" :. Arbitrary "Entity")+ ]++root' :: TokenMatcher+root' =+ [ tokNext "^(Description)" (Arbitrary "Keyword") (GoTo description')+ , tokNext "^(Maintainer)(:\\s*)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo maintainer')+ , tokNext "^((Build-)?Depends)" (Arbitrary "Keyword") (GoTo depends')+ , tok "^((?:Python-)?Version)(:\\s*)([^\\s]+)$" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "Number")])+ , tok "^((?:Installed-)?Size)(:\\s*)([^\\s]+)$" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "Number")])+ , tok "^(MD5Sum|SHA1|SHA256)(:\\s*)([^\\s]+)$" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "Number")])+ , tok "^([a-zA-Z\\-0-9\\.]*?)(:\\s*)(.*?)$" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Literal" :. Arbitrary "String")])+ ]++description' :: TokenMatcher+description' =+ [ tok "(.*)(Homepage)(: )([^\\s]+)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String"), (Arbitrary "Name"), (Arbitrary "Name" :. Arbitrary "Class")])+ , tok ":.*\\n" (Arbitrary "Generic" :. Arbitrary "Strong")+ , tok " .*\\n" (Arbitrary "Text")+ , tokNext "" (Arbitrary "Text") Pop+ ]++depend_vers' :: TokenMatcher+depend_vers' =+ [ tokNext "\\)," (Arbitrary "Text") Pop+ , tokNext "\\)[^,]" (Arbitrary "Text") (PopNum 2)+ , tok "([><=]+)(\\s*)([^\\)]+)" (ByGroups [(Arbitrary "Operator"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "Number")])+ ]+
+ src/Text/Highlighter/Lexers/Diff.hs view
@@ -0,0 +1,27 @@+module Text.Highlighter.Lexers.Diff (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Diff"+ , lAliases = ["diff", "udiff"]+ , lExtensions = [".diff", ".patch"]+ , lMimetypes = ["text/x-diff", "text/x-patch"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok " .*\\n" (Arbitrary "Text")+ , tok "\\+.*\\n" (Arbitrary "Generic" :. Arbitrary "Inserted")+ , tok "-.*\\n" (Arbitrary "Generic" :. Arbitrary "Deleted")+ , tok "!.*\\n" (Arbitrary "Generic" :. Arbitrary "Strong")+ , tok "@.*\\n" (Arbitrary "Generic" :. Arbitrary "Subheading")+ , tok "([Ii]ndex|diff).*\\n" (Arbitrary "Generic" :. Arbitrary "Heading")+ , tok "=.*\\n" (Arbitrary "Generic" :. Arbitrary "Heading")+ , tok ".*\\n" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Django.hs view
@@ -0,0 +1,57 @@+module Text.Highlighter.Lexers.Django (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Django/Jinja"+ , lAliases = ["django", "jinja"]+ , lExtensions = []+ , lMimetypes = ["application/x-django-templating", "application/x-jinja"]+ , lStart = root'+ , lFlags = [multiline, dotall]+ }++var' :: TokenMatcher+var' =+ [ tok "\\s+" (Arbitrary "Text")+ , tokNext "(-?)(\\}\\})" (ByGroups [(Arbitrary "Text"), (Arbitrary "Comment" :. Arbitrary "Preproc")]) Pop+ , anyOf varnames'+ ]++varnames' :: TokenMatcher+varnames' =+ [ tok "(\\|)(\\s*)([a-zA-Z_][a-zA-Z0-9_]*)" (ByGroups [(Arbitrary "Operator"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function")])+ , tok "(is)(\\s+)(not)?(\\s+)?([a-zA-Z_][a-zA-Z0-9_]*)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function")])+ , tok "(_|true|false|none|True|False|None)\\b" (Arbitrary "Keyword" :. Arbitrary "Pseudo")+ , tok "(in|as|reversed|recursive|not|and|or|is|if|else|import|with(?:(?:out)?\\s*context)?|scoped|ignore\\s+missing)\\b" (Arbitrary "Keyword")+ , tok "(loop|block|super|forloop)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "[a-zA-Z][a-zA-Z0-9_-]*" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "\\.[a-zA-Z0-9_]+" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok ":?\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok ":?'(\\\\\\\\|\\\\'|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "([{}()\\[\\]+\\-*/,:\126]|[><=]=?)" (Arbitrary "Operator")+ , tok "[0-9](\\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?" (Arbitrary "Literal" :. Arbitrary "Number")+ ]++root' :: TokenMatcher+root' =+ [ tok "[^{]+" (Arbitrary "Other")+ , tokNext "\\{\\{" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo var')+ , tok "\\{[*#].*?[*#]\\}" (Arbitrary "Comment")+ , tok "(\\{%)(-?\\s*)(comment)(\\s*-?)(%\\})(.*?)(\\{%)(-?\\s*)(endcomment)(\\s*-?)(%\\})" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Comment"), (Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Comment" :. Arbitrary "Preproc")])+ , tok "(\\{%)(-?\\s*)(raw)(\\s*-?)(%\\})(.*?)(\\{%)(-?\\s*)(endraw)(\\s*-?)(%\\})" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Text"), (Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Comment" :. Arbitrary "Preproc")])+ , tokNext "(\\{%)(-?\\s*)(filter)(\\s+)([a-zA-Z_][a-zA-Z0-9_]*)" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function")]) (GoTo block')+ , tokNext "(\\{%)(-?\\s*)([a-zA-Z_][a-zA-Z0-9_]*)" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Text"), (Arbitrary "Keyword")]) (GoTo block')+ , tok "\\{" (Arbitrary "Other")+ ]++block' :: TokenMatcher+block' =+ [ tok "\\s+" (Arbitrary "Text")+ , tokNext "(-?)(%\\})" (ByGroups [(Arbitrary "Text"), (Arbitrary "Comment" :. Arbitrary "Preproc")]) Pop+ , anyOf varnames'+ , tok "." (Arbitrary "Punctuation")+ ]+
+ src/Text/Highlighter/Lexers/Duel.hs view
@@ -0,0 +1,30 @@+module Text.Highlighter.Lexers.Duel (lexer) where+import qualified Text.Highlighter.Lexers.Javascript as Javascript+import qualified Text.Highlighter.Lexers.Html as Html+import qualified Text.Highlighter.Lexers.Javascript as Javascript+import qualified Text.Highlighter.Lexers.Html as Html+import qualified Text.Highlighter.Lexers.Html as Html+import qualified Text.Highlighter.Lexers.Html as Html+import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Duel"+ , lAliases = ["duel", "Duel Engine", "Duel View", "JBST", "jbst", "JsonML+BST"]+ , lExtensions = [".duel", ".jbst"]+ , lMimetypes = ["text/x-duel", "text/x-jbst"]+ , lStart = root'+ , lFlags = [dotall]+ }++root' :: TokenMatcher+root' =+ [ tok "(<%[@=#!:]?)(.*?)(%>)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Tag"), (Using Javascript.lexer), (Arbitrary "Name" :. Arbitrary "Tag")])+ , tok "(<%\\$)(.*?)(:)(.*?)(%>)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Tag"), (Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Punctuation"), (Arbitrary "Literal" :. Arbitrary "String"), (Arbitrary "Name" :. Arbitrary "Tag")])+ , tok "(<%--)(.*?)(--%>)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Tag"), (Arbitrary "Comment" :. Arbitrary "Multiline"), (Arbitrary "Name" :. Arbitrary "Tag")])+ , tok "(<script.*?>)(.*?)(</script>)" (ByGroups [(Using Html.lexer), (Using Javascript.lexer), (Using Html.lexer)])+ , tok "(.+?)(?=<)" (Using Html.lexer)+ , tok ".+" (Using Html.lexer)+ ]+
+ src/Text/Highlighter/Lexers/Dylan.hs view
@@ -0,0 +1,44 @@+module Text.Highlighter.Lexers.Dylan (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Dylan"+ , lAliases = ["dylan"]+ , lExtensions = [".dylan", ".dyl"]+ , lMimetypes = ["text/x-dylan"]+ , lStart = root'+ , lFlags = [dotall]+ }++root' :: TokenMatcher+root' =+ [ tok "\\b(subclass|abstract|block|c(on(crete|stant)|lass)|domain|ex(c(eption|lude)|port)|f(unction(|al))|generic|handler|i(n(herited|line|stance|terface)|mport)|library|m(acro|ethod)|open|primary|sealed|si(deways|ngleton)|slot|v(ariable|irtual))\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "<\\w+>" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "//.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/\\*[\\w\\W]*?\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo string')+ , tok "'(\\\\.|\\\\[0-7]{1,3}|\\\\x[a-fA-F0-9]{1,2}|[^\\\\\\'\\n])'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "=>|\\b(a(bove|fterwards)|b(e(gin|low)|y)|c(ase|leanup|reate)|define|else(|if)|end|f(inally|or|rom)|i[fn]|l(et|ocal)|otherwise|rename|s(elect|ignal)|t(hen|o)|u(n(less|til)|se)|wh(en|ile))\\b" (Arbitrary "Keyword")+ , tok "([ \\t])([!\\$%&\\*\\/:<=>\\?\126_^a-zA-Z0-9.+\\-]*:)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Variable")])+ , tok "([ \\t]*)(\\S+[^:])([ \\t]*)(\\()([ \\t]*)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Punctuation"), (Arbitrary "Text")])+ , tok "-?[0-9.]+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "[(),;]" (Arbitrary "Punctuation")+ , tok "\\$[a-zA-Z0-9-]+" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "[!$%&*/:<>=?\126^.+\\[\\]{}-]+" (Arbitrary "Operator")+ , tok "\\s+" (Arbitrary "Text")+ , tok "#[a-zA-Z0-9-]+" (Arbitrary "Keyword")+ , tok "[a-zA-Z0-9-]+" (Arbitrary "Name" :. Arbitrary "Variable")+ ]++string' :: TokenMatcher+string' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\([\\\\abfnrtv\"\\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "[^\\\\\"\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\" (Arbitrary "Literal" :. Arbitrary "String")+ ]+
+ src/Text/Highlighter/Lexers/Erlang.hs view
@@ -0,0 +1,56 @@+module Text.Highlighter.Lexers.Erlang (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Erlang"+ , lAliases = ["erlang"]+ , lExtensions = [".erl", ".hrl"]+ , lMimetypes = ["text/x-erlang"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "%.*\\n" (Arbitrary "Comment")+ , tok "(after|begin|case|catch|cond|end|fun|if|let|of|query|receive|try|when)\\b" (Arbitrary "Keyword")+ , tok "(abs|append_element|apply|atom_to_list|binary_to_list|bitstring_to_list|binary_to_term|bit_size|bump_reductions|byte_size|cancel_timer|check_process_code|delete_module|demonitor|disconnect_node|display|element|erase|exit|float|float_to_list|fun_info|fun_to_list|function_exported|garbage_collect|get|get_keys|group_leader|hash|hd|integer_to_list|iolist_to_binary|iolist_size|is_atom|is_binary|is_bitstring|is_boolean|is_builtin|is_float|is_function|is_integer|is_list|is_number|is_pid|is_port|is_process_alive|is_record|is_reference|is_tuple|length|link|list_to_atom|list_to_binary|list_to_bitstring|list_to_existing_atom|list_to_float|list_to_integer|list_to_pid|list_to_tuple|load_module|localtime_to_universaltime|make_tuple|md5|md5_final|md5_update|memory|module_loaded|monitor|monitor_node|node|nodes|open_port|phash|phash2|pid_to_list|port_close|port_command|port_connect|port_control|port_call|port_info|port_to_list|process_display|process_flag|process_info|purge_module|put|read_timer|ref_to_list|register|resume_process|round|send|send_after|send_nosuspend|set_cookie|setelement|size|spawn|spawn_link|spawn_monitor|spawn_opt|split_binary|start_timer|statistics|suspend_process|system_flag|system_info|system_monitor|system_profile|term_to_binary|tl|trace|trace_delivered|trace_info|trace_pattern|trunc|tuple_size|tuple_to_list|universaltime_to_localtime|unlink|unregister|whereis)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(and|andalso|band|bnot|bor|bsl|bsr|bxor|div|not|or|orelse|rem|xor)\\b" (Arbitrary "Operator" :. Arbitrary "Word")+ , tokNext "^-" (Arbitrary "Punctuation") (GoTo directive')+ , tok "(\\+|-|\\*|/|<|>|=|==|/=|=:=|=/=|=<|>=|\\+\\+|--|<-|!)" (Arbitrary "Operator")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo string')+ , tok "<<" (Arbitrary "Name" :. Arbitrary "Label")+ , tok ">>" (Arbitrary "Name" :. Arbitrary "Label")+ , tok "((?:[a-z][a-zA-Z0-9_]*|'[^\\n']*[^\\\\]'))(:)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Namespace"), (Arbitrary "Punctuation")])+ , tok "^((?:[a-z][a-zA-Z0-9_]*|'[^\\n']*[^\\\\]'))(\\s*)(\\()" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Punctuation")])+ , tok "[+-]?(?:[2-9]|[12][0-9]|3[0-6])#[0-9a-zA-Z]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "[+-]?\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "[+-]?\\d+.\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "[]\\[:_@\\\".{}()|;,]" (Arbitrary "Punctuation")+ , tok "(?:[A-Z_][a-zA-Z0-9_]*)" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "(?:[a-z][a-zA-Z0-9_]*|'[^\\n']*[^\\\\]')" (Arbitrary "Name")+ , tok "\\?(?:(?:[A-Z_][a-zA-Z0-9_]*)|(?:[a-z][a-zA-Z0-9_]*|'[^\\n']*[^\\\\]'))" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "\\$(?:(?:\\\\(?:[bdefnrstv\\'\"\\\\/]|[0-7][0-7]?[0-7]?|\\^[a-zA-Z]))|\\\\[ %]|[^\\\\])" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "#(?:[a-z][a-zA-Z0-9_]*|'[^\\n']*[^\\\\]')(:?\\.(?:[a-z][a-zA-Z0-9_]*|'[^\\n']*[^\\\\]'))?" (Arbitrary "Name" :. Arbitrary "Label")+ ]++string' :: TokenMatcher+string' =+ [ tok "(?:\\\\(?:[bdefnrstv\\'\"\\\\/]|[0-7][0-7]?[0-7]?|\\^[a-zA-Z]))" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\126[0-9.*]*[\126#+bBcdefginpPswWxX]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol")+ , tok "[^\"\\\\\126]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\126" (Arbitrary "Literal" :. Arbitrary "String")+ ]++directive' :: TokenMatcher+directive' =+ [ tokNext "(define)(\\s*)(\\()((?:(?:[A-Z_][a-zA-Z0-9_]*)|(?:[a-z][a-zA-Z0-9_]*|'[^\\n']*[^\\\\]')))" (ByGroups [(Arbitrary "Name" :. Arbitrary "Entity"), (Arbitrary "Text"), (Arbitrary "Punctuation"), (Arbitrary "Name" :. Arbitrary "Constant")]) Pop+ , tokNext "(record)(\\s*)(\\()((?:(?:[A-Z_][a-zA-Z0-9_]*)|(?:[a-z][a-zA-Z0-9_]*|'[^\\n']*[^\\\\]')))" (ByGroups [(Arbitrary "Name" :. Arbitrary "Entity"), (Arbitrary "Text"), (Arbitrary "Punctuation"), (Arbitrary "Name" :. Arbitrary "Label")]) Pop+ , tokNext "(?:[a-z][a-zA-Z0-9_]*|'[^\\n']*[^\\\\]')" (Arbitrary "Name" :. Arbitrary "Entity") Pop+ ]+
+ src/Text/Highlighter/Lexers/Factor.hs view
@@ -0,0 +1,100 @@+module Text.Highlighter.Lexers.Factor (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Factor"+ , lAliases = ["factor"]+ , lExtensions = [".factor"]+ , lMimetypes = ["text/x-factor"]+ , lStart = root'+ , lFlags = [multiline, utf8]+ }++stackeffect' :: TokenMatcher+stackeffect' =+ [ tokNext "\\s*\\(" (Arbitrary "Name" :. Arbitrary "Function") (GoTo stackeffect')+ , tokNext "\\)" (Arbitrary "Name" :. Arbitrary "Function") Pop+ , tok "\\-\\-" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "\\s+" (Arbitrary "Text")+ , tok "\\S+" (Arbitrary "Name" :. Arbitrary "Variable")+ ]++import' :: TokenMatcher+import' =+ [ tokNext ";" (Arbitrary "Keyword") Pop+ , tok "\\S+" (Arbitrary "Name" :. Arbitrary "Namespace")+ , tok "\\s+" (Arbitrary "Text")+ ]++slots' :: TokenMatcher+slots' =+ [ tok "\\s+" (Arbitrary "Text")+ , tokNext ";\\s" (Arbitrary "Keyword") Pop+ , tok "\\S+" (Arbitrary "Name" :. Arbitrary "Variable")+ ]++root' :: TokenMatcher+root' =+ [ tok "(\\s*)(:|::|MACRO:|MEMO:)(\\s+)(\\S+)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function")])+ , tok "(\\s*)(M:)(\\s+)(\\S+)(\\s+)(\\S+)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function")])+ , tok "(\\s*)(GENERIC:)(\\s+)(\\S+)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function")])+ , tok "(\\s*)(HOOK:|GENERIC#)(\\s+)(\\S+)(\\s+)(\\S+)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function")])+ , tokNext "(\\()(\\s+)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text")]) (GoTo stackeffect')+ , tok "\\;\\s" (Arbitrary "Keyword")+ , tokNext "(USING:)((?:\\s|\\\\\\s)+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text")]) (GoTo import')+ , tok "(USE:)(\\s+)(\\S+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Namespace")])+ , tok "(UNUSE:)(\\s+)(\\S+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Namespace")])+ , tok "(QUALIFIED:)(\\s+)(\\S+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Namespace")])+ , tok "(QUALIFIED-WITH:)(\\s+)(\\S+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Namespace")])+ , tok "(FROM:|EXCLUDE:)(\\s+)(\\S+)(\\s+)(=>)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Namespace"), (Arbitrary "Text"), (Arbitrary "Text")])+ , tok "(IN:)(\\s+)(\\S+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Namespace")])+ , tok "(?:ALIAS|DEFER|FORGET|POSTPONE):" (Arbitrary "Keyword" :. Arbitrary "Namespace")+ , tokNext "(TUPLE:)(\\s+)(\\S+)(\\s+<\\s+)(\\S+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Class")]) (GoTo slots')+ , tokNext "(TUPLE:)(\\s+)(\\S+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Class")]) (GoTo slots')+ , tok "(UNION:)(\\s+)(\\S+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Class")])+ , tok "(INTERSECTION:)(\\s+)(\\S+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Class")])+ , tok "(PREDICATE:)(\\s+)(\\S+)(\\s+<\\s+)(\\S+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Class")])+ , tok "(C:)(\\s+)(\\S+)(\\s+)(\\S+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Class")])+ , tok "INSTANCE:" (Arbitrary "Keyword")+ , tok "SLOT:" (Arbitrary "Keyword")+ , tok "MIXIN:" (Arbitrary "Keyword")+ , tok "(?:SINGLETON|SINGLETONS):" (Arbitrary "Keyword")+ , tok "CONSTANT:" (Arbitrary "Keyword")+ , tok "(?:SYMBOL|SYMBOLS):" (Arbitrary "Keyword")+ , tok "ERROR:" (Arbitrary "Keyword")+ , tok "SYNTAX:" (Arbitrary "Keyword")+ , tok "(HELP:)(\\s+)(\\S+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function")])+ , tok "(MAIN:)(\\s+)(\\S+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function")])+ , tok "(?:ALIEN|TYPEDEF|FUNCTION|STRUCT):" (Arbitrary "Keyword")+ , tok "(?:<PRIVATE|PRIVATE>)" (Arbitrary "Keyword" :. Arbitrary "Namespace")+ , tok "\"\"\"\\s+(?:.|\\n)*?\\s+\"\"\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\"(?:\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "CHAR:\\s+(\\\\[\\\\abfnrstv]*|\\S)\\s" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "\\!\\s+.*$" (Arbitrary "Comment")+ , tok "#\\!\\s+.*$" (Arbitrary "Comment")+ , tok "(t|f)\\s" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "-?\\d+\\.\\d+\\s" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "-?\\d+\\s" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "HEX:\\s+[a-fA-F\\d]+\\s" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "BIN:\\s+[01]+\\s" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "OCT:\\s+[0-7]+\\s" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "[-+/*=<>^]\\s" (Arbitrary "Operator")+ , tok "(?:deprecated|final|foldable|flushable|inline|recursive)\\s" (Arbitrary "Keyword")+ , tok "(?:or|2bi|2tri|while|wrapper|nip|4dip|wrapper\\\\?|bi\\\\*|callstack>array|both\\\\?|hashcode|die|dupd|callstack|callstack\\\\?|3dup|tri@|pick|curry|build|\\\\?execute|3bi|prepose|>boolean|\\\\?if|clone|eq\\\\?|tri\\\\*|\\\\?|=|swapd|2over|2keep|3keep|clear|2dup|when|not|tuple\\\\?|dup|2bi\\\\*|2tri\\\\*|call|tri-curry|object|bi@|do|unless\\\\*|if\\\\*|loop|bi-curry\\\\*|drop|when\\\\*|assert=|retainstack|assert\\\\?|-rot|execute|2bi@|2tri@|boa|with|either\\\\?|3drop|bi|curry\\\\?|datastack|until|3dip|over|3curry|tri-curry\\\\*|tri-curry@|swap|and|2nip|throw|bi-curry|\\\\(clone\\\\)|hashcode\\\\*|compose|2dip|if|3tri|unless|compose\\\\?|tuple|keep|2curry|equal\\\\?|assert|tri|2drop|most|<wrapper>|boolean\\\\?|identity-hashcode|identity-tuple\\\\?|null|new|dip|bi-curry@|rot|xor|identity-tuple|boolean)\\s" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(?:\\\\?at|assoc\\\\?|assoc-clone-like|assoc=|delete-at\\\\*|assoc-partition|extract-keys|new-assoc|value\\\\?|assoc-size|map>assoc|push-at|assoc-like|key\\\\?|assoc-intersect|assoc-refine|update|assoc-union|assoc-combine|at\\\\*|assoc-empty\\\\?|at\\\\+|set-at|assoc-all\\\\?|assoc-subset\\\\?|assoc-hashcode|change-at|assoc-each|assoc-diff|zip|values|value-at|rename-at|inc-at|enum\\\\?|at|cache|assoc>map|<enum>|assoc|assoc-map|enum|value-at\\\\*|assoc-map-as|>alist|assoc-filter-as|clear-assoc|assoc-stack|maybe-set-at|substitute|assoc-filter|2cache|delete-at|assoc-find|keys|assoc-any\\\\?|unzip)\\s" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(?:case|execute-effect|no-cond|no-case\\\\?|3cleave>quot|2cleave|cond>quot|wrong-values\\\\?|no-cond\\\\?|cleave>quot|no-case|case>quot|3cleave|wrong-values|to-fixed-point|alist>quot|case-find|cond|cleave|call-effect|2cleave>quot|recursive-hashcode|linear-case-quot|spread|spread>quot)\\s" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(?:number=|if-zero|next-power-of-2|each-integer|\\\\?1\\\\+|fp-special\\\\?|imaginary-part|unless-zero|float>bits|number\\\\?|fp-infinity\\\\?|bignum\\\\?|fp-snan\\\\?|denominator|fp-bitwise=|\\\\*|\\\\+|power-of-2\\\\?|-|u>=|/|>=|bitand|log2-expects-positive|<|log2|>|integer\\\\?|number|bits>double|2/|zero\\\\?|(find-integer)|bits>float|float\\\\?|shift|ratio\\\\?|even\\\\?|ratio|fp-sign|bitnot|>fixnum|complex\\\\?|/i|/f|byte-array>bignum|when-zero|sgn|>bignum|next-float|u<|u>|mod|recip|rational|find-last-integer|>float|(all-integers\\\\?)|2^|times|integer|fixnum\\\\?|neg|fixnum|sq|bignum|(each-integer)|bit\\\\?|fp-qnan\\\\?|find-integer|complex|<fp-nan>|real|double>bits|bitor|rem|fp-nan-payload|all-integers\\\\?|real-part|log2-expects-positive\\\\?|prev-float|align|unordered\\\\?|float|fp-nan\\\\?|abs|bitxor|u<=|odd\\\\?|<=|/mod|rational\\\\?|>integer|real\\\\?|numerator)\\s" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(?:member-eq\\\\?|append|assert-sequence=|find-last-from|trim-head-slice|clone-like|3sequence|assert-sequence\\\\?|map-as|last-index-from|reversed|index-from|cut\\\\*|pad-tail|remove-eq!|concat-as|but-last|snip|trim-tail|nths|nth|2selector|sequence|slice\\\\?|<slice>|partition|remove-nth|tail-slice|empty\\\\?|tail\\\\*|if-empty|find-from|virtual-sequence\\\\?|member\\\\?|set-length|drop-prefix|unclip|unclip-last-slice|iota|map-sum|bounds-error\\\\?|sequence-hashcode-step|selector-for|accumulate-as|map|start|midpoint@|\\\\(accumulate\\\\)|rest-slice|prepend|fourth|sift|accumulate!|new-sequence|follow|map!|like|first4|1sequence|reverse|slice|unless-empty|padding|virtual@|repetition\\\\?|set-last|index|4sequence|max-length|set-second|immutable-sequence|first2|first3|replicate-as|reduce-index|unclip-slice|supremum|suffix!|insert-nth|trim-tail-slice|tail|3append|short|count|suffix|concat|flip|filter|sum|immutable\\\\?|reverse!|2sequence|map-integers|delete-all|start\\\\*|indices|snip-slice|check-slice|sequence\\\\?|head|map-find|filter!|append-as|reduce|sequence=|halves|collapse-slice|interleave|2map|filter-as|binary-reduce|slice-error\\\\?|product|bounds-check\\\\?|bounds-check|harvest|immutable|virtual-exemplar|find|produce|remove|pad-head|last|replicate|set-fourth|remove-eq|shorten|reversed\\\\?|map-find-last|3map-as|2unclip-slice|shorter\\\\?|3map|find-last|head-slice|pop\\\\*|2map-as|tail-slice\\\\*|but-last-slice|2map-reduce|iota\\\\?|collector-for|accumulate|each|selector|append!|new-resizable|cut-slice|each-index|head-slice\\\\*|2reverse-each|sequence-hashcode|pop|set-nth|\\\\?nth|<flat-slice>|second|join|when-empty|collector|immutable-sequence\\\\?|<reversed>|all\\\\?|3append-as|virtual-sequence|subseq\\\\?|remove-nth!|push-either|new-like|length|last-index|push-if|2all\\\\?|lengthen|assert-sequence|copy|map-reduce|move|third|first|3each|tail\\\\?|set-first|prefix|bounds-error|any\\\\?|<repetition>|trim-slice|exchange|surround|2reduce|cut|change-nth|min-length|set-third|produce-as|push-all|head\\\\?|delete-slice|rest|sum-lengths|2each|head\\\\*|infimum|remove!|glue|slice-error|subseq|trim|replace-slice|push|repetition|map-index|trim-head|unclip-last|mismatch)\\s" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(?:global|\\\\+@|change|set-namestack|change-global|init-namespaces|on|off|set-global|namespace|set|with-scope|bind|with-variable|inc|dec|counter|initialize|namestack|get|get-global|make-assoc)\\s" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(?:<array>|2array|3array|pair|>array|1array|4array|pair\\\\?|array|resize-array|array\\\\?)\\s" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(?:\\\\+character\\\\+|bad-seek-type\\\\?|readln|each-morsel|stream-seek|read|print|with-output-stream|contents|write1|stream-write1|stream-copy|stream-element-type|with-input-stream|stream-print|stream-read|stream-contents|stream-tell|tell-output|bl|seek-output|bad-seek-type|nl|stream-nl|write|flush|stream-lines|\\\\+byte\\\\+|stream-flush|read1|seek-absolute\\\\?|stream-read1|lines|stream-readln|stream-read-until|each-line|seek-end|with-output-stream\\\\*|seek-absolute|with-streams|seek-input|seek-relative\\\\?|input-stream|stream-write|read-partial|seek-end\\\\?|seek-relative|error-stream|read-until|with-input-stream\\\\*|with-streams\\\\*|tell-input|each-block|output-stream|stream-read-partial|each-stream-block|each-stream-line)\\s" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(?:resize-string|>string|<string>|1string|string|string\\\\?)\\s" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(?:vector\\\\?|<vector>|\\\\?push|vector|>vector|1vector)\\s" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(?:with-return|restarts|return-continuation|with-datastack|recover|rethrow-restarts|<restart>|ifcc|set-catchstack|>continuation<|cleanup|ignore-errors|restart\\\\?|compute-restarts|attempt-all-error|error-thread|continue|<continuation>|attempt-all-error\\\\?|condition\\\\?|<condition>|throw-restarts|error|catchstack|continue-with|thread-error-hook|continuation|rethrow|callcc1|error-continuation|callcc0|attempt-all|condition|continuation\\\\?|restart|return)\\s" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "\\s+" (Arbitrary "Text")+ , tok "\\S+" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Felix.hs view
@@ -0,0 +1,181 @@+module Text.Highlighter.Lexers.Felix (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Felix"+ , lAliases = ["felix", "flx"]+ , lExtensions = [".flx", ".flxh"]+ , lMimetypes = ["text/x-felix"]+ , lStart = root'+ , lFlags = [multiline]+ }++comment' :: TokenMatcher+comment' =+ [ tok "//(.*?)\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tokNext "/[*]" (Arbitrary "Comment" :. Arbitrary "Multiline") (GoTo comment2')+ ]++modulename2' :: TokenMatcher+modulename2' =+ [ anyOf whitespace'+ , tokNext "([a-zA-Z_]\\w*)" (Arbitrary "Name" :. Arbitrary "Namespace") (PopNum 2)+ ]++modulename' :: TokenMatcher+modulename' =+ [ anyOf whitespace'+ , tokNext "\\[" (Arbitrary "Punctuation") (DoAll [(GoTo modulename2'), (GoTo tvarlist')])+ , tokNext "" (Arbitrary "Error") (GoTo modulename2')+ ]++if0' :: TokenMatcher+if0' =+ [ tokNext "^\\s*#if.*?(?<!\\\\)\\n" (Arbitrary "Comment") Push+ , tokNext "^\\s*#endif.*?(?<!\\\\)\\n" (Arbitrary "Comment") Pop+ , tok ".*?\\n" (Arbitrary "Comment")+ ]++whitespace' :: TokenMatcher+whitespace' =+ [ tok "\\n" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ , anyOf comment'+ , tokNext "#\\s*if\\s+0" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo if0')+ , tokNext "#" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo macro')+ ]++dqs' :: TokenMatcher+dqs' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\\\\\|\\\\\"|\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , anyOf strings'+ ]++sqs' :: TokenMatcher+sqs' =+ [ tokNext "'" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\\\\\|\\\\'|\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , anyOf strings'+ ]++macro' :: TokenMatcher+macro' =+ [ anyOf comment'+ , tokNext "(import|include)(\\s+)(<[^>]*?>)" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String")]) Pop+ , tokNext "(import|include)(\\s+)(\"[^\"]*?\")" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String")]) Pop+ , tokNext "(import|include)(\\s+)('[^']*?')" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String")]) Pop+ , tok "[^/\\n]+" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "/" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "(?<=\\\\)\\n" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tokNext "\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ ]++operators' :: TokenMatcher+operators' =+ [ tok "(and|not|in|is|isin|or|xor)\\b" (Arbitrary "Operator" :. Arbitrary "Word")+ , tok "!=|==|<<|>>|\\|\\||&&|[-\126+/*%=<>&^|.$]" (Arbitrary "Operator")+ ]++tsqs' :: TokenMatcher+tsqs' =+ [ tokNext "'''" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , anyOf strings'+ , anyOf nl'+ ]++comment2' :: TokenMatcher+comment2' =+ [ tok "[^\\/*]" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "/[*]" (Arbitrary "Comment" :. Arbitrary "Multiline") Push+ , tokNext "[*]/" (Arbitrary "Comment" :. Arbitrary "Multiline") Pop+ , tok "[\\/*]" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]++classname' :: TokenMatcher+classname' =+ [ anyOf whitespace'+ , tokNext "[a-zA-Z_]\\w*" (Arbitrary "Name" :. Arbitrary "Class") Pop+ , tokNext "(?=\\{)" (Arbitrary "Text") Pop+ ]++stringescape' :: TokenMatcher+stringescape' =+ [ tok "\\\\([\\\\abfnrtv\"\\']|\\n|N{.*?}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ ]++tdqs' :: TokenMatcher+tdqs' =+ [ tokNext "\"\"\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , anyOf strings'+ , anyOf nl'+ ]++nl' :: TokenMatcher+nl' =+ [ tok "\\n" (Arbitrary "Literal" :. Arbitrary "String")+ ]++funcname' :: TokenMatcher+funcname' =+ [ anyOf whitespace'+ , tokNext "[a-zA-Z_]\\w*" (Arbitrary "Name" :. Arbitrary "Function") Pop+ , tokNext "(?=\\()" (Arbitrary "Text") Pop+ ]++root' :: TokenMatcher+root' =+ [ anyOf whitespace'+ , tokNext "(axiom|ctor|fun|gen|proc|reduce|union)\\b" (Arbitrary "Keyword") (GoTo funcname')+ , tokNext "(class|cclass|cstruct|obj|struct)\\b" (Arbitrary "Keyword") (GoTo classname')+ , tokNext "(instance|module|typeclass)\\b" (Arbitrary "Keyword") (GoTo modulename')+ , tok "(_|_deref|all|as|assert|attempt|call|callback|case|caseno|cclass|code|compound|ctypes|do|done|downto|elif|else|endattempt|endcase|endif|endmatch|enum|except|exceptions|expect|finally|for|forall|forget|fork|functor|goto|ident|if|incomplete|inherit|instance|interface|jump|lambda|loop|match|module|namespace|new|noexpand|nonterm|obj|of|open|parse|raise|regexp|reglex|regmatch|rename|return|the|then|to|type|typecase|typedef|typematch|typeof|upto|when|whilst|with|yield)\\b" (Arbitrary "Keyword")+ , tok "(_gc_pointer|_gc_type|body|comment|const|export|header|inline|lval|macro|noinline|noreturn|package|private|pod|property|public|publish|requires|todo|virtual|use)\\b" (Arbitrary "Name" :. Arbitrary "Decorator")+ , tok "(def|let|ref|val|var)\\b" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , tok "(unit|void|any|bool|byte|offset|address|caddress|cvaddress|vaddress|tiny|short|int|long|vlong|utiny|ushort|vshort|uint|ulong|uvlong|int8|int16|int32|int64|uint8|uint16|uint32|uint64|float|double|ldouble|complex|dcomplex|lcomplex|imaginary|dimaginary|limaginary|char|wchar|uchar|charp|charcp|ucharp|ucharcp|string|wstring|ustring|cont|array|varray|list|lvalue|opt|slice)\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "(false|true)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , anyOf operators'+ , tok "0[xX]([0-9a-fA-F_]*\\.[0-9a-fA-F_]+|[0-9a-fA-F_]+)[pP][+\\-]?[0-9_]+[lLfFdD]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "[0-9_]+(\\.[0-9_]+[eE][+\\-]?[0-9_]+|\\.[0-9_]*|[eE][+\\-]?[0-9_]+)[lLfFdD]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "\\.(0|[1-9][0-9_]*)([eE][+\\-]?[0-9_]+)?[lLfFdD]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0[Bb][01_]+([tTsSiIlLvV]|ll|LL|([iIuU])(8|16|32|64))?" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "0[0-7_]+([tTsSiIlLvV]|ll|LL|([iIuU])(8|16|32|64))?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "0[xX][0-9a-fA-F_]+([tTsSiIlLvV]|ll|LL|([iIuU])(8|16|32|64))?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "(0|[1-9][0-9_]*)([tTsSiIlLvV]|ll|LL|([iIuU])(8|16|32|64))?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tokNext "([rR][cC]?|[cC][rR])\"\"\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo tdqs')+ , tokNext "([rR][cC]?|[cC][rR])'''" (Arbitrary "Literal" :. Arbitrary "String") (GoTo tsqs')+ , tokNext "([rR][cC]?|[cC][rR])\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo dqs')+ , tokNext "([rR][cC]?|[cC][rR])'" (Arbitrary "Literal" :. Arbitrary "String") (GoTo sqs')+ , tokNext "[cCfFqQwWuU]?\"\"\"" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', tdqs'])+ , tokNext "[cCfFqQwWuU]?'''" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', tsqs'])+ , tokNext "[cCfFqQwWuU]?\"" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', dqs'])+ , tokNext "[cCfFqQwWuU]?'" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', sqs'])+ , tok "[\\[\\]{}:(),;?]" (Arbitrary "Punctuation")+ , tok "[a-zA-Z_]\\w*:>" (Arbitrary "Name" :. Arbitrary "Label")+ , tok "(_svc|while)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(root|self|this)\\b" (Arbitrary "Name" :. Arbitrary "Builtin" :. Arbitrary "Pseudo")+ , tok "[a-zA-Z_]\\w*" (Arbitrary "Name")+ ]++strings' :: TokenMatcher+strings' =+ [ tok "%(\\([a-zA-Z0-9]+\\))?[-#0 +]*([0-9]+|[*])?(\\.([0-9]+|[*]))?[hlL]?[diouxXeEfFgGcrs%]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol")+ , tok "[^\\\\\\'\"%\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "[\\'\"\\\\]" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "%" (Arbitrary "Literal" :. Arbitrary "String")+ ]++tvarlist' :: TokenMatcher+tvarlist' =+ [ anyOf whitespace'+ , anyOf operators'+ , tokNext "\\[" (Arbitrary "Punctuation") Push+ , tokNext "\\]" (Arbitrary "Punctuation") Pop+ , tok "," (Arbitrary "Punctuation")+ , tok "(with|where)\\b" (Arbitrary "Keyword")+ , tok "[a-zA-Z_]\\w*" (Arbitrary "Name")+ ]+
+ src/Text/Highlighter/Lexers/Fortran.hs view
@@ -0,0 +1,50 @@+module Text.Highlighter.Lexers.Fortran (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Fortran"+ , lAliases = ["fortran"]+ , lExtensions = [".f", ".f90"]+ , lMimetypes = ["text/x-fortran"]+ , lStart = root'+ , lFlags = [caseless]+ }++core' :: TokenMatcher+core' =+ [ tok "\\b(ACCEPT|ALLOCATABLE|ALLOCATE|ARRAY|ASSIGN|BACKSPACE|BLOCK DATA|BYTE|CALL|CASE|CLOSE|COMMON|CONTAINS|CONTINUE|CYCLE|DATA|DEALLOCATE|DECODE|DIMENSION|DO|ENCODE|END FILE|ENDIF|END|ENTRY|EQUIVALENCE|EXIT|EXTERNAL|EXTRINSIC|FORALL|FORMAT|FUNCTION|GOTO|IF|IMPLICIT|INCLUDE|INQUIRE|INTENT|INTERFACE|INTRINSIC|MODULE|NAMELIST|NULLIFY|NONE|OPEN|OPTIONAL|OPTIONS|PARAMETER|PAUSE|POINTER|PRINT|PRIVATE|PROGRAM|PUBLIC|PURE|READ|RECURSIVE|RETURN|REWIND|SAVE|SELECT|SEQUENCE|STOP|SUBROUTINE|TARGET|TYPE|USE|VOLATILE|WHERE|WRITE|WHILE|THEN|ELSE|ENDIF)\\s*\\b" (Arbitrary "Keyword")+ , tok "\\b(CHARACTER|COMPLEX|DOUBLE PRECISION|DOUBLE COMPLEX|INTEGER|LOGICAL|REAL)\\s*\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "(\\*\\*|\\*|\\+|-|\\/|<|>|<=|>=|==|\\/=|=)" (Arbitrary "Operator")+ , tok "(::)" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , tok "[(),:&%;]" (Arbitrary "Punctuation")+ , tok "\\b(Abort|Abs|Access|AChar|ACos|AdjustL|AdjustR|AImag|AInt|Alarm|All|Allocated|ALog|AMax|AMin|AMod|And|ANInt|Any|ASin|Associated|ATan|BesJ|BesJN|BesY|BesYN|Bit_Size|BTest|CAbs|CCos|Ceiling|CExp|Char|ChDir|ChMod|CLog|Cmplx|Complex|Conjg|Cos|CosH|Count|CPU_Time|CShift|CSin|CSqRt|CTime|DAbs|DACos|DASin|DATan|Date_and_Time|DbesJ|DbesJ|DbesJN|DbesY|DbesY|DbesYN|Dble|DCos|DCosH|DDiM|DErF|DErFC|DExp|Digits|DiM|DInt|DLog|DLog|DMax|DMin|DMod|DNInt|Dot_Product|DProd|DSign|DSinH|DSin|DSqRt|DTanH|DTan|DTime|EOShift|Epsilon|ErF|ErFC|ETime|Exit|Exp|Exponent|FDate|FGet|FGetC|Float|Floor|Flush|FNum|FPutC|FPut|Fraction|FSeek|FStat|FTell|GError|GetArg|GetCWD|GetEnv|GetGId|GetLog|GetPId|GetUId|GMTime|HostNm|Huge|IAbs|IAChar|IAnd|IArgC|IBClr|IBits|IBSet|IChar|IDate|IDiM|IDInt|IDNInt|IEOr|IErrNo|IFix|Imag|ImagPart|Index|Int|IOr|IRand|IsaTty|IShft|IShftC|ISign|ITime|Kill|Kind|LBound|Len|Len_Trim|LGe|LGt|Link|LLe|LLt|LnBlnk|Loc|Log|Log|Logical|Long|LShift|LStat|LTime|MatMul|Max|MaxExponent|MaxLoc|MaxVal|MClock|Merge|Min|MinExponent|MinLoc|MinVal|Mod|Modulo|MvBits|Nearest|NInt|Not|Or|Pack|PError|Precision|Present|Product|Radix|Rand|Random_Number|Random_Seed|Range|Real|RealPart|Rename|Repeat|Reshape|RRSpacing|RShift|Scale|Scan|Second|Selected_Int_Kind|Selected_Real_Kind|Set_Exponent|Shape|Short|Sign|Signal|SinH|Sin|Sleep|Sngl|Spacing|Spread|SqRt|SRand|Stat|Sum|SymLnk|System|System_Clock|Tan|TanH|Time|Tiny|Transfer|Transpose|Trim|TtyNam|UBound|UMask|Unlink|Unpack|Verify|XOr|ZAbs|ZCos|ZExp|ZLog|ZSin|ZSqRt)\\s*\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "\\.(true|false)\\." (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "\\.(eq|ne|lt|le|gt|ge|not|and|or|eqv|neqv)\\." (Arbitrary "Operator" :. Arbitrary "Word")+ ]++root' :: TokenMatcher+root' =+ [ tok "!.*\\n" (Arbitrary "Comment")+ , anyOf strings'+ , anyOf core'+ , tok "[a-z][a-z0-9_]*" (Arbitrary "Name" :. Arbitrary "Variable")+ , anyOf nums'+ , tok "[\\s]+" (Arbitrary "Text")+ ]++strings' :: TokenMatcher+strings' =+ [ tok "(?s)\"(\\\\\\\\|\\\\[0-7]+|\\\\.|[^\"\\\\])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "(?s)'(\\\\\\\\|\\\\[0-7]+|\\\\.|[^'\\\\])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ ]++nums' :: TokenMatcher+nums' =+ [ tok "\\d+(?![.Ee])" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "[+-]?\\d*\\.\\d+([eE][-+]?\\d+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "[+-]?\\d+\\.\\d*([eE][-+]?\\d+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ ]+
+ src/Text/Highlighter/Lexers/GLShader.hs view
@@ -0,0 +1,36 @@+module Text.Highlighter.Lexers.GLShader (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "GLSL"+ , lAliases = ["glsl"]+ , lExtensions = [".vert", ".frag", ".geo"]+ , lMimetypes = ["text/x-glslsrc"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "^#.*" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "//.*" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/(\\\\\\n)?[*](.|\\n)*?[*](\\\\\\n)?/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "\\+|-|\126|!=?|\\*|/|%|<<|>>|<=?|>=?|==?|&&?|\\^|\\|\\|?" (Arbitrary "Operator")+ , tok "[?:]" (Arbitrary "Operator")+ , tok "\\bdefined\\b" (Arbitrary "Operator")+ , tok "[;{}(),\\[\\]]" (Arbitrary "Punctuation")+ , tok "[+-]?\\d*\\.\\d+([eE][-+]?\\d+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "[+-]?\\d+\\.\\d*([eE][-+]?\\d+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0[xX][0-9a-fA-F]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "0[0-7]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "[1-9][0-9]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\\b(attribute|const|uniform|varying|centroid|break|continue|do|for|while|if|else|in|out|inout|float|int|void|bool|true|false|invariant|discard|return|mat[234]|mat[234]x[234]|vec[234]|[ib]vec[234]|sampler[123]D|samplerCube|sampler[12]DShadow|struct)\\b" (Arbitrary "Keyword")+ , tok "\\b(asm|class|union|enum|typedef|template|this|packed|goto|switch|default|inline|noinline|volatile|public|static|extern|external|interface|long|short|double|half|fixed|unsigned|lowp|mediump|highp|precision|input|output|hvec[234]|[df]vec[234]|sampler[23]DRect|sampler2DRectShadow|sizeof|cast|namespace|using)\\b" (Arbitrary "Keyword")+ , tok "[a-zA-Z_][a-zA-Z_0-9]*" (Arbitrary "Name")+ , tok "\\." (Arbitrary "Punctuation")+ , tok "\\s+" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Gas.hs view
@@ -0,0 +1,63 @@+module Text.Highlighter.Lexers.Gas (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "GAS"+ , lAliases = ["gas"]+ , lExtensions = [".s", ".S"]+ , lMimetypes = ["text/x-gas"]+ , lStart = root'+ , lFlags = [multiline]+ }++directiveArgs' :: TokenMatcher+directiveArgs' =+ [ tok "(?:[a-zA-Z$_][a-zA-Z$._0-9@]*|\\.[a-zA-Z$._0-9@]+)" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "\"(\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "@(?:[a-zA-Z$_][a-zA-Z$._0-9@]*|\\.[a-zA-Z$._0-9@]+)" (Arbitrary "Name" :. Arbitrary "Attribute")+ , tok "(?:0[xX][a-zA-Z0-9]+|\\d+)" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tokNext "[\\r\\n]+" (Arbitrary "Text") Pop+ , tokNext "#.*?$" (Arbitrary "Comment") Pop+ , anyOf punctuation'+ , anyOf whitespace'+ ]++punctuation' :: TokenMatcher+punctuation' =+ [ tok "[-*,.():]+" (Arbitrary "Punctuation")+ ]++root' :: TokenMatcher+root' =+ [ anyOf whitespace'+ , tok "(?:[a-zA-Z$_][a-zA-Z$._0-9@]*|\\.[a-zA-Z$._0-9@]+):" (Arbitrary "Name" :. Arbitrary "Label")+ , tokNext "\\.(?:[a-zA-Z$_][a-zA-Z$._0-9@]*|\\.[a-zA-Z$._0-9@]+)" (Arbitrary "Name" :. Arbitrary "Attribute") (GoTo directiveArgs')+ , tok "lock|rep(n?z)?|data\\d+" (Arbitrary "Name" :. Arbitrary "Attribute")+ , tokNext "(?:[a-zA-Z$_][a-zA-Z$._0-9@]*|\\.[a-zA-Z$._0-9@]+)" (Arbitrary "Name" :. Arbitrary "Function") (GoTo instructionArgs')+ , tok "[\\r\\n]+" (Arbitrary "Text")+ ]++whitespace' :: TokenMatcher+whitespace' =+ [ tok "\\n" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ , tok "#.*?\\n" (Arbitrary "Comment")+ ]++instructionArgs' :: TokenMatcher+instructionArgs' =+ [ tok "([a-z0-9]+)( )(<)((?:[a-zA-Z$_][a-zA-Z$._0-9@]*|\\.[a-zA-Z$._0-9@]+))(>)" (ByGroups [(Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex"), (Arbitrary "Text"), (Arbitrary "Punctuation"), (Arbitrary "Name" :. Arbitrary "Constant"), (Arbitrary "Punctuation")])+ , tok "([a-z0-9]+)( )(<)((?:[a-zA-Z$_][a-zA-Z$._0-9@]*|\\.[a-zA-Z$._0-9@]+))([-+])((?:0[xX][a-zA-Z0-9]+|\\d+))(>)" (ByGroups [(Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex"), (Arbitrary "Text"), (Arbitrary "Punctuation"), (Arbitrary "Name" :. Arbitrary "Constant"), (Arbitrary "Punctuation"), (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer"), (Arbitrary "Punctuation")])+ , tok "(?:[a-zA-Z$_][a-zA-Z$._0-9@]*|\\.[a-zA-Z$._0-9@]+)" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "(?:0[xX][a-zA-Z0-9]+|\\d+)" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "%(?:[a-zA-Z$_][a-zA-Z$._0-9@]*|\\.[a-zA-Z$._0-9@]+)" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "$(?:0[xX][a-zA-Z0-9]+|\\d+)" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tokNext "[\\r\\n]+" (Arbitrary "Text") Pop+ , tokNext "#.*?$" (Arbitrary "Comment") Pop+ , anyOf punctuation'+ , anyOf whitespace'+ ]+
+ src/Text/Highlighter/Lexers/GenshiText.hs view
@@ -0,0 +1,41 @@+module Text.Highlighter.Lexers.GenshiText (lexer) where+import qualified Text.Highlighter.Lexers.Python as Python+import qualified Text.Highlighter.Lexers.Python as Python+import qualified Text.Highlighter.Lexers.Python as Python+import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Genshi Text"+ , lAliases = ["genshitext"]+ , lExtensions = []+ , lMimetypes = ["application/x-genshi-text", "text/x-genshi"]+ , lStart = root'+ , lFlags = [multiline]+ }++variable' :: TokenMatcher+variable' =+ [ tok "(?<!\\$)(\\$\\{)(.+?)(\\})" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Using Python.lexer), (Arbitrary "Comment" :. Arbitrary "Preproc")])+ , tok "(?<!\\$)(\\$)([a-zA-Z_][a-zA-Z0-9_\\.]*)" (Arbitrary "Name" :. Arbitrary "Variable")+ ]++root' :: TokenMatcher+root' =+ [ tok "[^#\\$\\s]+" (Arbitrary "Other")+ , tok "^(\\s*)(##.*)$" (ByGroups [(Arbitrary "Text"), (Arbitrary "Comment")])+ , tokNext "^(\\s*)(#)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Comment" :. Arbitrary "Preproc")]) (GoTo directive')+ , anyOf variable'+ , tok "[#\\$\\s]" (Arbitrary "Other")+ ]++directive' :: TokenMatcher+directive' =+ [ tokNext "\\n" (Arbitrary "Text") Pop+ , tokNext "(?:def|for|if)\\s+.*" (Using Python.lexer) Pop+ , tokNext "(choose|when|with)([^\\S\\n]+)(.*)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Using Python.lexer)]) Pop+ , tokNext "(choose|otherwise)\\b" (Arbitrary "Keyword") Pop+ , tokNext "(end\\w*)([^\\S\\n]*)(.*)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Comment")]) Pop+ ]+
+ src/Text/Highlighter/Lexers/Gettext.hs view
@@ -0,0 +1,26 @@+module Text.Highlighter.Lexers.Gettext (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Gettext Catalog"+ , lAliases = ["pot", "po"]+ , lExtensions = [".pot", ".po"]+ , lMimetypes = ["application/x-gettext", "text/x-gettext", "text/gettext"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "^#,\\s.*?$" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "^#:\\s.*?$" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , tok "^(#|#\\.\\s|#\\|\\s|#\126\\s|#\\s).*$" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "^(\")([A-Za-z-]+:)(.*\")$" (ByGroups [(Arbitrary "Literal" :. Arbitrary "String"), (Arbitrary "Name" :. Arbitrary "Property"), (Arbitrary "Literal" :. Arbitrary "String")])+ , tok "^\".*\"$" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "^(msgid|msgid_plural|msgstr)(\\s+)(\".*\")$" (ByGroups [(Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String")])+ , tok "^(msgstr\\[)(\\d)(\\])(\\s+)(\".*\")$" (ByGroups [(Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer"), (Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String")])+ ]+
+ src/Text/Highlighter/Lexers/Gherkin.hs view
@@ -0,0 +1,134 @@+module Text.Highlighter.Lexers.Gherkin (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Gherkin"+ , lAliases = ["Cucumber", "cucumber", "Gherkin", "gherkin"]+ , lExtensions = [".feature"]+ , lMimetypes = ["text/x-gherkin"]+ , lStart = root'+ , lFlags = [multiline]+ }++double_string' :: TokenMatcher+double_string' =+ [ tokNext "\"" (Arbitrary "Name" :. Arbitrary "Function") Pop+ , anyOf string'+ ]++examples_table_header' :: TokenMatcher+examples_table_header' =+ [ tokNext "\\s+\\|\\s*$" (Arbitrary "Keyword") (PopNum 2)+ , anyOf comments'+ , tok "\\s*\\|" (Arbitrary "Keyword")+ , tok "[^\\|]" (Arbitrary "Name" :. Arbitrary "Variable")+ ]++table_vars' :: TokenMatcher+table_vars' =+ [ tok "(<[^>]+>)" (Arbitrary "Name" :. Arbitrary "Variable")+ ]++string' :: TokenMatcher+string' =+ [ anyOf table_vars'+ , tok "(\\s|.)" (Arbitrary "Literal" :. Arbitrary "String")+ ]++py_string' :: TokenMatcher+py_string' =+ [ tokNext "\"\"\"" (Arbitrary "Keyword") Pop+ , anyOf string'+ ]++root' :: TokenMatcher+root' =+ [ tok "\\n" (Arbitrary "Name" :. Arbitrary "Function")+ , anyOf comments'+ , tokNext "\"\"\"" (Arbitrary "Keyword") (GoTo py_string')+ , tokNext "\\s+\\|" (Arbitrary "Keyword") (GoTo table_content')+ , tokNext "\"" (Arbitrary "Name" :. Arbitrary "Function") (GoTo double_string')+ , anyOf table_vars'+ , anyOf numbers'+ , tok "(\\s*)(@[^@\\r\\n\\t ]+)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Name" :. Arbitrary "Tag")])+ , tokNext "^(\\s*)(\54616\51648\47564|\51312\44148|\47676\51200|\47564\51068|\47564\50557|\45800|\44536\47532\44256|\44536\47084\47732|\37027\40636|\37027\20040|\32780\19988|\30070|\24403|\21069\25552|\20551\35373|\20551\22914|\20294\26159|\20294\12375|\20006\19988|\12418\12375|\12394\12425\12400|\12383\12384\12375|\12375\12363\12375|\12363\12388|\1608 |\1605\1578\1609 |\1604\1603\1606 |\1593\1606\1583\1605\1575 |\1579\1605 |\1576\1601\1585\1590 |\1575\1584\1575\1611 |\1499\1488\1513\1512 |\1493\1490\1501 |\1489\1492\1497\1504\1514\1503 |\1488\1494\1497 |\1488\1494 |\1488\1489\1500 |\1071\1082\1097\1086 |\1059\1085\1076\1072 |\1058\1086 |\1055\1088\1080\1087\1091\1089\1090\1080\1084\1086, \1097\1086 |\1055\1088\1080\1087\1091\1089\1090\1080\1084\1086 |\1054\1085\1076\1072 |\1053\1086 |\1053\1077\1093\1072\1081 |\1051\1077\1082\1080\1085 |\1050\1086\1075\1072\1090\1086 |\1050\1072\1076\1072 |\1050\1072\1076 |\1050 \1090\1086\1084\1091 \1078\1077 |\1048 |\1047\1072\1076\1072\1090\1086 |\1047\1072\1076\1072\1090\1080 |\1047\1072\1076\1072\1090\1077 |\1045\1089\1083\1080 |\1044\1086\1087\1091\1089\1090\1080\1084 |\1044\1072\1076\1077\1085\1086 |\1042\1072 |\1041\1080\1088\1086\1082 |\1040\1084\1084\1086 |\1040\1083\1080 |\1040\1083\1077 |\1040\1075\1072\1088 |\1040 |\1030 |\536i |\201s |Zatati |Zak\322adaj\261c |Zadato |Zadate |Zadano |Zadani |Zadan |Youse know when youse got |Youse know like when |Yna |Ya know how |Ya gotta |Y |Wun |Wtedy |When y\\'all |When |Wenn |WEN |V\224 |Ve |Und |Un |Th\236 |Then y\\'all |Then |Tapi |Tak |Tada |Tad |S\229 |Stel |Soit |Siis |Si |Sed |Se |Quando |Quand |Quan |Pryd |Pokud |Pokia\318 |Per\242 |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |N\229r |N\228r |Niin |Nh\432ng |N |Mutta |Men |Mas |Maka |Majd |Mais |Maar |Ma |Lorsque |Lorsqu\\'|Kun |Kuid |Kui |Khi |Ke\271 |Ketika |Kdy\382 |Kaj |Kai |Kada |Kad |Je\380eli |Ja |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y\\'all |Given |Gitt |Gegeven |Gegeben sei |Fakat |E\287er ki |Etant donn\233 |Et |Ent\227o |Entonces |Entao |En |Eeldades |E |Duota |Dun |Donita\309o |Donat |Donada |Do |Diyelim ki |Dengan |Den youse gotta |De |Dato |Dar |Dann |Dan |Dado |Dac\259 |Daca |DEN |C\226nd |Cuando |Cho |Cept |Cand |Cal |But y\\'all |But |Buh |Bi\7871t |Bet |BUT |At\232s |Atunci |Atesa |Anrhegedig a |Angenommen |And y\\'all |And |An |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Aber |AN |A tak\233 |A |\\* )" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Keyword")]) (GoTo step_content_root')+ , tokNext "^(\44592\45733|\27231\33021|\21151\33021|\12501\12451\12540\12481\12515|\1582\1575\1589\1610\1577|\1514\1499\1493\1504\1492|\1060\1091\1085\1082\1094\1110\1086\1085\1072\1083|\1060\1091\1085\1082\1094\1080\1086\1085\1072\1083\1085\1086\1089\1090|\1060\1091\1085\1082\1094\1080\1086\1085\1072\1083|\1060\1080\1095\1072|\1054\1089\1086\1073\1080\1085\1072|\1052\1086\1075\1091\1115\1085\1086\1089\1090|\214zellik|W\322a\347ciwo\347\263|T\237nh n\259ng|Trajto|Savyb\279|Po\382iadavka|Po\382adavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogu\263nost|Mogucnost|Jellemz\337|F\299\269a|Funzionalit\224|Funktionalit\228t|Funkcionalnost|Funkcionalit\257te|Func\539ionalitate|Functionaliteit|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalit\233|Fitur|Feature|Egenskap|Egenskab|Crikey|Caracter\237stica|Arwedd)(:)(.*)$" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Keyword"), (Arbitrary "Name" :. Arbitrary "Function")]) (GoTo narrative')+ , tokNext "^(\\s*)(\49884\45208\47532\50724 \44060\50836|\49884\45208\47532\50724|\48176\44221|\32972\26223|\22580\26223\22823\32177|\22580\26223|\22330\26223\22823\32434|\22330\26223|\21127\26412\22823\32177|\21127\26412|\12486\12531\12503\12524|\12471\12490\12522\12458\12486\12531\12503\12524\12540\12488|\12471\12490\12522\12458\12486\12531\12503\12524|\12471\12490\12522\12458\12450\12454\12488\12521\12452\12531|\12471\12490\12522\12458|\1587\1610\1606\1575\1585\1610\1608 \1605\1582\1591\1591|\1587\1610\1606\1575\1585\1610\1608|\1575\1604\1582\1604\1601\1610\1577|\1514\1512\1495\1497\1513|\1514\1489\1504\1497\1514 \1514\1512\1495\1497\1513|\1512\1511\1506|\1058\1072\1088\1080\1093|\1057\1094\1077\1085\1072\1088\1110\1081|\1057\1094\1077\1085\1072\1088\1080\1086|\1057\1094\1077\1085\1072\1088\1080\1081 \1089\1090\1088\1091\1082\1090\1091\1088\1072\1089\1080|\1057\1094\1077\1085\1072\1088\1080\1081|\1057\1090\1088\1091\1082\1090\1091\1088\1072 \1089\1094\1077\1085\1072\1088\1110\1102|\1057\1090\1088\1091\1082\1090\1091\1088\1072 \1089\1094\1077\1085\1072\1088\1080\1112\1072|\1057\1090\1088\1091\1082\1090\1091\1088\1072 \1089\1094\1077\1085\1072\1088\1080\1103|\1057\1082\1080\1094\1072|\1056\1072\1084\1082\1072 \1085\1072 \1089\1094\1077\1085\1072\1088\1080\1081|\1055\1088\1080\1084\1077\1088|\1055\1088\1077\1076\1099\1089\1090\1086\1088\1080\1103|\1055\1088\1077\1076\1080\1089\1090\1086\1088\1080\1103|\1055\1086\1079\1072\1076\1080\1085\1072|\1055\1077\1088\1077\1076\1091\1084\1086\1074\1072|\1054\1089\1085\1086\1074\1072|\1050\1086\1085\1094\1077\1087\1090|\1050\1086\1085\1090\1077\1082\1089\1090|Za\322o\380enia|Wharrimean is|T\236nh hu\7889ng|The thing of it is|Tausta|Taust|Tapausaihio|Tapaus|Szenariogrundriss|Szenario|Szablon scenariusza|Stsenaarium|Struktura scenarija|Skica|Skenario konsep|Skenario|Situ\257cija|Senaryo tasla\287\305|Senaryo|Sc\233n\225\345|Sc\233nario|Schema dello scenario|Scen\257rijs p\275c parauga|Scen\257rijs|Scen\225r|Scenaro|Scenariusz|Scenariul de \351ablon|Scenariul de sablon|Scenariu|Scenario Outline|Scenario Amlinellol|Scenario|Scenarijus|Scenarijaus \353ablonas|Scenarij|Scenarie|Rerefons|Raamstsenaarium|Primer|Pozad\237|Pozadina|Pozadie|Plan du sc\233nario|Plan du Sc\233nario|Osnova sc\233n\225\345e|Osnova|N\225\269rt Sc\233n\225\345e|N\225\269rt Scen\225ru|Mate|MISHUN SRSLY|MISHUN|K\7883ch b\7843n|Konturo de la scenaro|Kontext|Konteksts|Kontekstas|Kontekst|Koncept|Khung t\236nh hu\7889ng|Khung k\7883ch b\7843n|H\225tt\233r|Grundlage|Ge\231mi\351|Forgat\243k\246nyv v\225zlat|Forgat\243k\246nyv|Fono|Esquema do Cen\225rio|Esquema do Cenario|Esquema del escenario|Esquema de l\\'escenari|Escenario|Escenari|Dis is what went down|Dasar|Contexto|Contexte|Contesto|Condi\355ii|Conditii|Cen\225rio|Cenario|Cefndir|B\7889i c\7843nh|Blokes|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|All y\\'all|Achtergrond|Abstrakt Scenario|Abstract Scenario)(:)(.*)$" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Keyword"), (Arbitrary "Keyword"), (Arbitrary "Name" :. Arbitrary "Function")]) (GoTo feature_elements')+ , tokNext "^(\\s*)(\50696|\20363\23376|\20363|\12469\12531\12503\12523|\1575\1605\1579\1604\1577|\1491\1493\1490\1502\1488\1493\1514|\1057\1094\1077\1085\1072\1088\1080\1112\1080|\1055\1088\1080\1084\1077\1088\1080|\1055\1088\1080\1082\1083\1072\1076\1080|\1052\1080\1089\1086\1083\1083\1072\1088|\1047\1085\1072\1095\1077\1085\1080\1103|\214rnekler|Voorbeelden|Variantai|Tapaukset|Scenarios|Scenariji|Scenarijai|P\345\237klady|P\233ld\225k|Pr\237klady|Przyk\322ady|Primjeri|Primeri|Piem\275ri|Pavyzd\382iai|Paraugs|Juhtumid|Exemplos|Exemples|Exemplele|Exempel|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|EXAMPLZ|D\7919 li\7879u|Contoh|Cobber|Beispiele)(:)(.*)$" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Keyword"), (Arbitrary "Keyword"), (Arbitrary "Name" :. Arbitrary "Function")]) (GoTo examples_table')+ , tok "(\\s|.)" (Arbitrary "Name" :. Arbitrary "Function")+ ]++examples_table' :: TokenMatcher+examples_table' =+ [ tokNext "\\s+\\|" (Arbitrary "Keyword") (GoTo examples_table_header')+ , anyOf comments'+ , tok "(\\s|.)" (Arbitrary "Name" :. Arbitrary "Function")+ ]++comments' :: TokenMatcher+comments' =+ [ tok "#.*$" (Arbitrary "Comment")+ ]++scenario_sections_on_stack' :: TokenMatcher+scenario_sections_on_stack' =+ [ tokNext "^(\\s*)(\49884\45208\47532\50724 \44060\50836|\49884\45208\47532\50724|\48176\44221|\32972\26223|\22580\26223\22823\32177|\22580\26223|\22330\26223\22823\32434|\22330\26223|\21127\26412\22823\32177|\21127\26412|\12486\12531\12503\12524|\12471\12490\12522\12458\12486\12531\12503\12524\12540\12488|\12471\12490\12522\12458\12486\12531\12503\12524|\12471\12490\12522\12458\12450\12454\12488\12521\12452\12531|\12471\12490\12522\12458|\1587\1610\1606\1575\1585\1610\1608 \1605\1582\1591\1591|\1587\1610\1606\1575\1585\1610\1608|\1575\1604\1582\1604\1601\1610\1577|\1514\1512\1495\1497\1513|\1514\1489\1504\1497\1514 \1514\1512\1495\1497\1513|\1512\1511\1506|\1058\1072\1088\1080\1093|\1057\1094\1077\1085\1072\1088\1110\1081|\1057\1094\1077\1085\1072\1088\1080\1086|\1057\1094\1077\1085\1072\1088\1080\1081 \1089\1090\1088\1091\1082\1090\1091\1088\1072\1089\1080|\1057\1094\1077\1085\1072\1088\1080\1081|\1057\1090\1088\1091\1082\1090\1091\1088\1072 \1089\1094\1077\1085\1072\1088\1110\1102|\1057\1090\1088\1091\1082\1090\1091\1088\1072 \1089\1094\1077\1085\1072\1088\1080\1112\1072|\1057\1090\1088\1091\1082\1090\1091\1088\1072 \1089\1094\1077\1085\1072\1088\1080\1103|\1057\1082\1080\1094\1072|\1056\1072\1084\1082\1072 \1085\1072 \1089\1094\1077\1085\1072\1088\1080\1081|\1055\1088\1080\1084\1077\1088|\1055\1088\1077\1076\1099\1089\1090\1086\1088\1080\1103|\1055\1088\1077\1076\1080\1089\1090\1086\1088\1080\1103|\1055\1086\1079\1072\1076\1080\1085\1072|\1055\1077\1088\1077\1076\1091\1084\1086\1074\1072|\1054\1089\1085\1086\1074\1072|\1050\1086\1085\1094\1077\1087\1090|\1050\1086\1085\1090\1077\1082\1089\1090|Za\322o\380enia|Wharrimean is|T\236nh hu\7889ng|The thing of it is|Tausta|Taust|Tapausaihio|Tapaus|Szenariogrundriss|Szenario|Szablon scenariusza|Stsenaarium|Struktura scenarija|Skica|Skenario konsep|Skenario|Situ\257cija|Senaryo tasla\287\305|Senaryo|Sc\233n\225\345|Sc\233nario|Schema dello scenario|Scen\257rijs p\275c parauga|Scen\257rijs|Scen\225r|Scenaro|Scenariusz|Scenariul de \351ablon|Scenariul de sablon|Scenariu|Scenario Outline|Scenario Amlinellol|Scenario|Scenarijus|Scenarijaus \353ablonas|Scenarij|Scenarie|Rerefons|Raamstsenaarium|Primer|Pozad\237|Pozadina|Pozadie|Plan du sc\233nario|Plan du Sc\233nario|Osnova sc\233n\225\345e|Osnova|N\225\269rt Sc\233n\225\345e|N\225\269rt Scen\225ru|Mate|MISHUN SRSLY|MISHUN|K\7883ch b\7843n|Konturo de la scenaro|Kontext|Konteksts|Kontekstas|Kontekst|Koncept|Khung t\236nh hu\7889ng|Khung k\7883ch b\7843n|H\225tt\233r|Grundlage|Ge\231mi\351|Forgat\243k\246nyv v\225zlat|Forgat\243k\246nyv|Fono|Esquema do Cen\225rio|Esquema do Cenario|Esquema del escenario|Esquema de l\\'escenari|Escenario|Escenari|Dis is what went down|Dasar|Contexto|Contexte|Contesto|Condi\355ii|Conditii|Cen\225rio|Cenario|Cefndir|B\7889i c\7843nh|Blokes|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|All y\\'all|Achtergrond|Abstrakt Scenario|Abstract Scenario)(:)(.*)$" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Keyword"), (Arbitrary "Keyword"), (Arbitrary "Name" :. Arbitrary "Function")]) (GoTo feature_elements_on_stack')+ ]++step_content_root' :: TokenMatcher+step_content_root' =+ [ tokNext "$" (Arbitrary "Keyword") Pop+ , anyOf step_content'+ ]++numbers' :: TokenMatcher+numbers' =+ [ tok "(\\d+\\.?\\d*|\\d*\\.\\d+)([eE][+-]?[0-9]+)?" (Arbitrary "Literal" :. Arbitrary "String")+ ]++feature_elements' :: TokenMatcher+feature_elements' =+ [ tokNext "^(\\s*)(\54616\51648\47564|\51312\44148|\47676\51200|\47564\51068|\47564\50557|\45800|\44536\47532\44256|\44536\47084\47732|\37027\40636|\37027\20040|\32780\19988|\30070|\24403|\21069\25552|\20551\35373|\20551\22914|\20294\26159|\20294\12375|\20006\19988|\12418\12375|\12394\12425\12400|\12383\12384\12375|\12375\12363\12375|\12363\12388|\1608 |\1605\1578\1609 |\1604\1603\1606 |\1593\1606\1583\1605\1575 |\1579\1605 |\1576\1601\1585\1590 |\1575\1584\1575\1611 |\1499\1488\1513\1512 |\1493\1490\1501 |\1489\1492\1497\1504\1514\1503 |\1488\1494\1497 |\1488\1494 |\1488\1489\1500 |\1071\1082\1097\1086 |\1059\1085\1076\1072 |\1058\1086 |\1055\1088\1080\1087\1091\1089\1090\1080\1084\1086, \1097\1086 |\1055\1088\1080\1087\1091\1089\1090\1080\1084\1086 |\1054\1085\1076\1072 |\1053\1086 |\1053\1077\1093\1072\1081 |\1051\1077\1082\1080\1085 |\1050\1086\1075\1072\1090\1086 |\1050\1072\1076\1072 |\1050\1072\1076 |\1050 \1090\1086\1084\1091 \1078\1077 |\1048 |\1047\1072\1076\1072\1090\1086 |\1047\1072\1076\1072\1090\1080 |\1047\1072\1076\1072\1090\1077 |\1045\1089\1083\1080 |\1044\1086\1087\1091\1089\1090\1080\1084 |\1044\1072\1076\1077\1085\1086 |\1042\1072 |\1041\1080\1088\1086\1082 |\1040\1084\1084\1086 |\1040\1083\1080 |\1040\1083\1077 |\1040\1075\1072\1088 |\1040 |\1030 |\536i |\201s |Zatati |Zak\322adaj\261c |Zadato |Zadate |Zadano |Zadani |Zadan |Youse know when youse got |Youse know like when |Yna |Ya know how |Ya gotta |Y |Wun |Wtedy |When y\\'all |When |Wenn |WEN |V\224 |Ve |Und |Un |Th\236 |Then y\\'all |Then |Tapi |Tak |Tada |Tad |S\229 |Stel |Soit |Siis |Si |Sed |Se |Quando |Quand |Quan |Pryd |Pokud |Pokia\318 |Per\242 |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |N\229r |N\228r |Niin |Nh\432ng |N |Mutta |Men |Mas |Maka |Majd |Mais |Maar |Ma |Lorsque |Lorsqu\\'|Kun |Kuid |Kui |Khi |Ke\271 |Ketika |Kdy\382 |Kaj |Kai |Kada |Kad |Je\380eli |Ja |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y\\'all |Given |Gitt |Gegeven |Gegeben sei |Fakat |E\287er ki |Etant donn\233 |Et |Ent\227o |Entonces |Entao |En |Eeldades |E |Duota |Dun |Donita\309o |Donat |Donada |Do |Diyelim ki |Dengan |Den youse gotta |De |Dato |Dar |Dann |Dan |Dado |Dac\259 |Daca |DEN |C\226nd |Cuando |Cho |Cept |Cand |Cal |But y\\'all |But |Buh |Bi\7871t |Bet |BUT |At\232s |Atunci |Atesa |Anrhegedig a |Angenommen |And y\\'all |And |An |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Aber |AN |A tak\233 |A |\\* )" (Arbitrary "Keyword") (GoTo step_content_stack')+ , anyOf comments'+ , tok "(\\s|.)" (Arbitrary "Name" :. Arbitrary "Function")+ ]++narrative' :: TokenMatcher+narrative' =+ [ anyOf scenario_sections_on_stack'+ , tok "(\\s|.)" (Arbitrary "Name" :. Arbitrary "Function")+ ]++feature_elements_on_stack' :: TokenMatcher+feature_elements_on_stack' =+ [ tokNext "^(\\s*)(\54616\51648\47564|\51312\44148|\47676\51200|\47564\51068|\47564\50557|\45800|\44536\47532\44256|\44536\47084\47732|\37027\40636|\37027\20040|\32780\19988|\30070|\24403|\21069\25552|\20551\35373|\20551\22914|\20294\26159|\20294\12375|\20006\19988|\12418\12375|\12394\12425\12400|\12383\12384\12375|\12375\12363\12375|\12363\12388|\1608 |\1605\1578\1609 |\1604\1603\1606 |\1593\1606\1583\1605\1575 |\1579\1605 |\1576\1601\1585\1590 |\1575\1584\1575\1611 |\1499\1488\1513\1512 |\1493\1490\1501 |\1489\1492\1497\1504\1514\1503 |\1488\1494\1497 |\1488\1494 |\1488\1489\1500 |\1071\1082\1097\1086 |\1059\1085\1076\1072 |\1058\1086 |\1055\1088\1080\1087\1091\1089\1090\1080\1084\1086, \1097\1086 |\1055\1088\1080\1087\1091\1089\1090\1080\1084\1086 |\1054\1085\1076\1072 |\1053\1086 |\1053\1077\1093\1072\1081 |\1051\1077\1082\1080\1085 |\1050\1086\1075\1072\1090\1086 |\1050\1072\1076\1072 |\1050\1072\1076 |\1050 \1090\1086\1084\1091 \1078\1077 |\1048 |\1047\1072\1076\1072\1090\1086 |\1047\1072\1076\1072\1090\1080 |\1047\1072\1076\1072\1090\1077 |\1045\1089\1083\1080 |\1044\1086\1087\1091\1089\1090\1080\1084 |\1044\1072\1076\1077\1085\1086 |\1042\1072 |\1041\1080\1088\1086\1082 |\1040\1084\1084\1086 |\1040\1083\1080 |\1040\1083\1077 |\1040\1075\1072\1088 |\1040 |\1030 |\536i |\201s |Zatati |Zak\322adaj\261c |Zadato |Zadate |Zadano |Zadani |Zadan |Youse know when youse got |Youse know like when |Yna |Ya know how |Ya gotta |Y |Wun |Wtedy |When y\\'all |When |Wenn |WEN |V\224 |Ve |Und |Un |Th\236 |Then y\\'all |Then |Tapi |Tak |Tada |Tad |S\229 |Stel |Soit |Siis |Si |Sed |Se |Quando |Quand |Quan |Pryd |Pokud |Pokia\318 |Per\242 |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |N\229r |N\228r |Niin |Nh\432ng |N |Mutta |Men |Mas |Maka |Majd |Mais |Maar |Ma |Lorsque |Lorsqu\\'|Kun |Kuid |Kui |Khi |Ke\271 |Ketika |Kdy\382 |Kaj |Kai |Kada |Kad |Je\380eli |Ja |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y\\'all |Given |Gitt |Gegeven |Gegeben sei |Fakat |E\287er ki |Etant donn\233 |Et |Ent\227o |Entonces |Entao |En |Eeldades |E |Duota |Dun |Donita\309o |Donat |Donada |Do |Diyelim ki |Dengan |Den youse gotta |De |Dato |Dar |Dann |Dan |Dado |Dac\259 |Daca |DEN |C\226nd |Cuando |Cho |Cept |Cand |Cal |But y\\'all |But |Buh |Bi\7871t |Bet |BUT |At\232s |Atunci |Atesa |Anrhegedig a |Angenommen |And y\\'all |And |An |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Aber |AN |A tak\233 |A |\\* )" (Arbitrary "Keyword") (PopNum 2)+ , anyOf comments'+ , tok "(\\s|.)" (Arbitrary "Name" :. Arbitrary "Function")+ ]++table_content' :: TokenMatcher+table_content' =+ [ tokNext "\\s+\\|\\s*$" (Arbitrary "Keyword") Pop+ , anyOf comments'+ , tok "\\s*\\|" (Arbitrary "Keyword")+ , anyOf string'+ ]++step_content' :: TokenMatcher+step_content' =+ [ tokNext "\"" (Arbitrary "Name" :. Arbitrary "Function") (GoTo double_string')+ , anyOf table_vars'+ , anyOf numbers'+ , anyOf comments'+ , tok "(\\s|.)" (Arbitrary "Name" :. Arbitrary "Function")+ ]++step_content_stack' :: TokenMatcher+step_content_stack' =+ [ tokNext "$" (Arbitrary "Keyword") (PopNum 2)+ , anyOf step_content'+ ]+
+ src/Text/Highlighter/Lexers/Gnuplot.hs view
@@ -0,0 +1,144 @@+module Text.Highlighter.Lexers.Gnuplot (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Gnuplot"+ , lAliases = ["gnuplot"]+ , lExtensions = [".plot", ".plt"]+ , lMimetypes = ["text/x-gnuplot"]+ , lStart = root'+ , lFlags = [multiline]+ }++comment' :: TokenMatcher+comment' =+ [ tok "[^\\\\\\n]" (Arbitrary "Comment")+ , tok "\\\\\\n" (Arbitrary "Comment")+ , tok "\\\\" (Arbitrary "Comment")+ , tokNext "" (Arbitrary "Comment") Pop+ ]++plot' :: TokenMatcher+plot' =+ [ tok "axes\\b|axe\\b|ax\\b|axis\\b|axi\\b|binary\\b|binar\\b|bina\\b|bin\\b|every\\b|ever\\b|eve\\b|ev\\b|index\\b|inde\\b|ind\\b|in\\b|i\\b|matrix\\b|matri\\b|matr\\b|mat\\b|smooth\\b|smoot\\b|smoo\\b|smo\\b|sm\\b|s\\b|thru\\b|title\\b|titl\\b|tit\\b|ti\\b|t\\b|notitle\\b|notitl\\b|notit\\b|noti\\b|not\\b|using\\b|usin\\b|usi\\b|us\\b|u\\b|with\\b|wit\\b|wi\\b|w\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , anyOf genericargs'+ ]++pause' :: TokenMatcher+pause' =+ [ tok "(mouse|any|button1|button2|button3)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "keypress\\b|keypres\\b|keypre\\b|keypr\\b|keyp\\b|key\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , anyOf genericargs'+ ]++dqstring' :: TokenMatcher+dqstring' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\([\\\\abfnrtv\"\\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "[^\\\\\"\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "\\n" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]++if' :: TokenMatcher+if' =+ [ tokNext "\\)" (Arbitrary "Punctuation") Pop+ , anyOf genericargs'+ ]++quit' :: TokenMatcher+quit' =+ [ tok "gnuplot\\b" (Arbitrary "Keyword")+ , anyOf noargs'+ ]++sqstring' :: TokenMatcher+sqstring' =+ [ tok "''" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "'" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "[^\\\\'\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "\\n" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]++whitespace' :: TokenMatcher+whitespace' =+ [ tokNext "#" (Arbitrary "Comment") (GoTo comment')+ , tok "[ \\t\\v\\f]+" (Arbitrary "Text")+ ]++fit' :: TokenMatcher+fit' =+ [ tok "via\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , anyOf plot'+ ]++bind' :: TokenMatcher+bind' =+ [ tokNext "!" (Arbitrary "Keyword") Pop+ , tok "allwindows\\b|allwindow\\b|allwindo\\b|allwind\\b|allwin\\b|allwi\\b|allw\\b|all\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , anyOf genericargs'+ ]++optionarg' :: TokenMatcher+optionarg' =+ [ anyOf whitespace'+ , tokNext "all\\b|al\\b|a\\b|angles\\b|angle\\b|angl\\b|ang\\b|an\\b|arrow\\b|arro\\b|arr\\b|ar\\b|autoscale\\b|autoscal\\b|autosca\\b|autosc\\b|autos\\b|auto\\b|aut\\b|au\\b|bars\\b|bar\\b|ba\\b|b\\b|border\\b|borde\\b|bord\\b|bor\\b|boxwidth\\b|boxwidt\\b|boxwid\\b|boxwi\\b|boxw\\b|box\\b|clabel\\b|clabe\\b|clab\\b|cla\\b|cl\\b|clip\\b|cli\\b|cl\\b|c\\b|cntrparam\\b|cntrpara\\b|cntrpar\\b|cntrpa\\b|cntrp\\b|cntr\\b|cnt\\b|cn\\b|contour\\b|contou\\b|conto\\b|cont\\b|con\\b|co\\b|data\\b|dat\\b|da\\b|datafile\\b|datafil\\b|datafi\\b|dataf\\b|data\\b|dgrid3d\\b|dgrid3\\b|dgrid\\b|dgri\\b|dgr\\b|dg\\b|dummy\\b|dumm\\b|dum\\b|du\\b|encoding\\b|encodin\\b|encodi\\b|encod\\b|enco\\b|enc\\b|decimalsign\\b|decimalsig\\b|decimalsi\\b|decimals\\b|decimal\\b|decima\\b|decim\\b|deci\\b|dec\\b|fit\\b|fontpath\\b|fontpat\\b|fontpa\\b|fontp\\b|font\\b|format\\b|forma\\b|form\\b|for\\b|fo\\b|function\\b|functio\\b|functi\\b|funct\\b|func\\b|fun\\b|fu\\b|functions\\b|function\\b|functio\\b|functi\\b|funct\\b|func\\b|fun\\b|fu\\b|grid\\b|gri\\b|gr\\b|g\\b|hidden3d\\b|hidden3\\b|hidden\\b|hidde\\b|hidd\\b|hid\\b|historysize\\b|historysiz\\b|historysi\\b|historys\\b|history\\b|histor\\b|histo\\b|hist\\b|his\\b|isosamples\\b|isosample\\b|isosampl\\b|isosamp\\b|isosam\\b|isosa\\b|isos\\b|iso\\b|is\\b|key\\b|ke\\b|k\\b|keytitle\\b|keytitl\\b|keytit\\b|keyti\\b|keyt\\b|label\\b|labe\\b|lab\\b|la\\b|linestyle\\b|linestyl\\b|linesty\\b|linest\\b|lines\\b|line\\b|lin\\b|li\\b|ls\\b|loadpath\\b|loadpat\\b|loadpa\\b|loadp\\b|load\\b|loa\\b|locale\\b|local\\b|loca\\b|loc\\b|logscale\\b|logscal\\b|logsca\\b|logsc\\b|logs\\b|log\\b|macros\\b|macro\\b|macr\\b|mac\\b|mapping\\b|mappin\\b|mappi\\b|mapp\\b|map\\b|mapping3d\\b|mapping3\\b|mapping\\b|mappin\\b|mappi\\b|mapp\\b|map\\b|margin\\b|margi\\b|marg\\b|mar\\b|lmargin\\b|lmargi\\b|lmarg\\b|lmar\\b|rmargin\\b|rmargi\\b|rmarg\\b|rmar\\b|tmargin\\b|tmargi\\b|tmarg\\b|tmar\\b|bmargin\\b|bmargi\\b|bmarg\\b|bmar\\b|mouse\\b|mous\\b|mou\\b|mo\\b|multiplot\\b|multiplo\\b|multipl\\b|multip\\b|multi\\b|mxtics\\b|mxtic\\b|mxti\\b|mxt\\b|nomxtics\\b|nomxtic\\b|nomxti\\b|nomxt\\b|mx2tics\\b|mx2tic\\b|mx2ti\\b|mx2t\\b|nomx2tics\\b|nomx2tic\\b|nomx2ti\\b|nomx2t\\b|mytics\\b|mytic\\b|myti\\b|myt\\b|nomytics\\b|nomytic\\b|nomyti\\b|nomyt\\b|my2tics\\b|my2tic\\b|my2ti\\b|my2t\\b|nomy2tics\\b|nomy2tic\\b|nomy2ti\\b|nomy2t\\b|mztics\\b|mztic\\b|mzti\\b|mzt\\b|nomztics\\b|nomztic\\b|nomzti\\b|nomzt\\b|mcbtics\\b|mcbtic\\b|mcbti\\b|mcbt\\b|nomcbtics\\b|nomcbtic\\b|nomcbti\\b|nomcbt\\b|offsets\\b|offset\\b|offse\\b|offs\\b|off\\b|of\\b|origin\\b|origi\\b|orig\\b|ori\\b|or\\b|output\\b|outpu\\b|outp\\b|out\\b|ou\\b|o\\b|parametric\\b|parametri\\b|parametr\\b|paramet\\b|parame\\b|param\\b|para\\b|par\\b|pa\\b|pm3d\\b|pm3\\b|pm\\b|palette\\b|palett\\b|palet\\b|pale\\b|pal\\b|colorbox\\b|colorbo\\b|colorb\\b|plot\\b|plo\\b|pl\\b|p\\b|pointsize\\b|pointsiz\\b|pointsi\\b|points\\b|point\\b|poin\\b|poi\\b|polar\\b|pola\\b|pol\\b|print\\b|prin\\b|pri\\b|pr\\b|object\\b|objec\\b|obje\\b|obj\\b|samples\\b|sample\\b|sampl\\b|samp\\b|sam\\b|sa\\b|size\\b|siz\\b|si\\b|style\\b|styl\\b|sty\\b|st\\b|surface\\b|surfac\\b|surfa\\b|surf\\b|sur\\b|su\\b|table\\b|terminal\\b|termina\\b|termin\\b|termi\\b|term\\b|ter\\b|te\\b|t\\b|termoptions\\b|termoption\\b|termoptio\\b|termopti\\b|termopt\\b|termop\\b|termo\\b|tics\\b|tic\\b|ti\\b|ticscale\\b|ticscal\\b|ticsca\\b|ticsc\\b|ticslevel\\b|ticsleve\\b|ticslev\\b|ticsle\\b|ticsl\\b|timefmt\\b|timefm\\b|timef\\b|timestamp\\b|timestam\\b|timesta\\b|timest\\b|times\\b|time\\b|tim\\b|title\\b|titl\\b|tit\\b|variables\\b|variable\\b|variabl\\b|variab\\b|varia\\b|vari\\b|var\\b|va\\b|v\\b|version\\b|versio\\b|versi\\b|vers\\b|ver\\b|ve\\b|view\\b|vie\\b|vi\\b|xyplane\\b|xyplan\\b|xypla\\b|xypl\\b|xyp\\b|xdata\\b|xdat\\b|xda\\b|x2data\\b|x2dat\\b|x2da\\b|ydata\\b|ydat\\b|yda\\b|y2data\\b|y2dat\\b|y2da\\b|zdata\\b|zdat\\b|zda\\b|cbdata\\b|cbdat\\b|cbda\\b|xlabel\\b|xlabe\\b|xlab\\b|xla\\b|xl\\b|x2label\\b|x2labe\\b|x2lab\\b|x2la\\b|x2l\\b|ylabel\\b|ylabe\\b|ylab\\b|yla\\b|yl\\b|y2label\\b|y2labe\\b|y2lab\\b|y2la\\b|y2l\\b|zlabel\\b|zlabe\\b|zlab\\b|zla\\b|zl\\b|cblabel\\b|cblabe\\b|cblab\\b|cbla\\b|cbl\\b|xtics\\b|xtic\\b|xti\\b|noxtics\\b|noxtic\\b|noxti\\b|x2tics\\b|x2tic\\b|x2ti\\b|nox2tics\\b|nox2tic\\b|nox2ti\\b|ytics\\b|ytic\\b|yti\\b|noytics\\b|noytic\\b|noyti\\b|y2tics\\b|y2tic\\b|y2ti\\b|noy2tics\\b|noy2tic\\b|noy2ti\\b|ztics\\b|ztic\\b|zti\\b|noztics\\b|noztic\\b|nozti\\b|cbtics\\b|cbtic\\b|cbti\\b|nocbtics\\b|nocbtic\\b|nocbti\\b|xdtics\\b|xdtic\\b|xdti\\b|noxdtics\\b|noxdtic\\b|noxdti\\b|x2dtics\\b|x2dtic\\b|x2dti\\b|nox2dtics\\b|nox2dtic\\b|nox2dti\\b|ydtics\\b|ydtic\\b|ydti\\b|noydtics\\b|noydtic\\b|noydti\\b|y2dtics\\b|y2dtic\\b|y2dti\\b|noy2dtics\\b|noy2dtic\\b|noy2dti\\b|zdtics\\b|zdtic\\b|zdti\\b|nozdtics\\b|nozdtic\\b|nozdti\\b|cbdtics\\b|cbdtic\\b|cbdti\\b|nocbdtics\\b|nocbdtic\\b|nocbdti\\b|xmtics\\b|xmtic\\b|xmti\\b|noxmtics\\b|noxmtic\\b|noxmti\\b|x2mtics\\b|x2mtic\\b|x2mti\\b|nox2mtics\\b|nox2mtic\\b|nox2mti\\b|ymtics\\b|ymtic\\b|ymti\\b|noymtics\\b|noymtic\\b|noymti\\b|y2mtics\\b|y2mtic\\b|y2mti\\b|noy2mtics\\b|noy2mtic\\b|noy2mti\\b|zmtics\\b|zmtic\\b|zmti\\b|nozmtics\\b|nozmtic\\b|nozmti\\b|cbmtics\\b|cbmtic\\b|cbmti\\b|nocbmtics\\b|nocbmtic\\b|nocbmti\\b|xrange\\b|xrang\\b|xran\\b|xra\\b|xr\\b|x2range\\b|x2rang\\b|x2ran\\b|x2ra\\b|x2r\\b|yrange\\b|yrang\\b|yran\\b|yra\\b|yr\\b|y2range\\b|y2rang\\b|y2ran\\b|y2ra\\b|y2r\\b|zrange\\b|zrang\\b|zran\\b|zra\\b|zr\\b|cbrange\\b|cbrang\\b|cbran\\b|cbra\\b|cbr\\b|rrange\\b|rrang\\b|rran\\b|rra\\b|rr\\b|trange\\b|trang\\b|tran\\b|tra\\b|tr\\b|urange\\b|urang\\b|uran\\b|ura\\b|ur\\b|vrange\\b|vrang\\b|vran\\b|vra\\b|vr\\b|xzeroaxis\\b|xzeroaxi\\b|xzeroax\\b|xzeroa\\b|x2zeroaxis\\b|x2zeroaxi\\b|x2zeroax\\b|x2zeroa\\b|yzeroaxis\\b|yzeroaxi\\b|yzeroax\\b|yzeroa\\b|y2zeroaxis\\b|y2zeroaxi\\b|y2zeroax\\b|y2zeroa\\b|zzeroaxis\\b|zzeroaxi\\b|zzeroax\\b|zzeroa\\b|zeroaxis\\b|zeroaxi\\b|zeroax\\b|zeroa\\b|zero\\b|zer\\b|ze\\b|z\\b" (Arbitrary "Name" :. Arbitrary "Builtin") Pop+ ]++genericargs' :: TokenMatcher+genericargs' =+ [ anyOf noargs'+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo dqstring')+ , tokNext "'" (Arbitrary "Literal" :. Arbitrary "String") (GoTo sqstring')+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+)[eE][+-]?\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "(\\d+\\.\\d*|\\.\\d+)" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "-?\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "[,.\126!%^&*+=|?:<>/-]" (Arbitrary "Operator")+ , tok "[{}()\\[\\]]" (Arbitrary "Punctuation")+ , tok "(eq|ne)\\b" (Arbitrary "Operator" :. Arbitrary "Word")+ , tok "([a-zA-Z_][a-zA-Z0-9_]*)(\\s*)(\\()" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Punctuation")])+ , tok "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name")+ , tok "@[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "\\\\\\n" (Arbitrary "Text")+ ]++noargs' :: TokenMatcher+noargs' =+ [ anyOf whitespace'+ , tokNext ";" (Arbitrary "Punctuation") Pop+ , tokNext "\\n" (Arbitrary "Text") Pop+ ]++save' :: TokenMatcher+save' =+ [ tok "functions\\b|function\\b|functio\\b|functi\\b|funct\\b|func\\b|fun\\b|fu\\b|f\\b|set\\b|se\\b|s\\b|terminal\\b|termina\\b|termin\\b|termi\\b|term\\b|ter\\b|te\\b|t\\b|variables\\b|variable\\b|variabl\\b|variab\\b|varia\\b|vari\\b|var\\b|va\\b|v\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , anyOf genericargs'+ ]++root' :: TokenMatcher+root' =+ [ anyOf whitespace'+ , tokNext "bind\\b|bin\\b|bi\\b" (Arbitrary "Keyword") (GoTo bind')+ , tokNext "exit\\b|exi\\b|ex\\b|quit\\b|qui\\b|qu\\b|q\\b" (Arbitrary "Keyword") (GoTo quit')+ , tokNext "fit\\b|fi\\b|f\\b" (Arbitrary "Keyword") (GoTo fit')+ , tokNext "(if)(\\s*)(\\()" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Punctuation")]) (GoTo if')+ , tok "else\\b" (Arbitrary "Keyword")+ , tokNext "pause\\b|paus\\b|pau\\b|pa\\b" (Arbitrary "Keyword") (GoTo pause')+ , tokNext "plot\\b|plo\\b|pl\\b|p\\b|replot\\b|replo\\b|repl\\b|rep\\b|splot\\b|splo\\b|spl\\b|sp\\b" (Arbitrary "Keyword") (GoTo plot')+ , tokNext "save\\b|sav\\b|sa\\b" (Arbitrary "Keyword") (GoTo save')+ , tokNext "set\\b|se\\b" (Arbitrary "Keyword") (DoAll [(GoTo genericargs'), (GoTo optionarg')])+ , tokNext "show\\b|sho\\b|sh\\b|unset\\b|unse\\b|uns\\b" (Arbitrary "Keyword") (DoAll [(GoTo noargs'), (GoTo optionarg')])+ , tokNext "lower\\b|lowe\\b|low\\b|raise\\b|rais\\b|rai\\b|ra\\b|call\\b|cal\\b|ca\\b|cd\\b|clear\\b|clea\\b|cle\\b|cl\\b|help\\b|hel\\b|he\\b|h\\b|\\?\\b|history\\b|histor\\b|histo\\b|hist\\b|his\\b|hi\\b|load\\b|loa\\b|lo\\b|l\\b|print\\b|prin\\b|pri\\b|pr\\b|pwd\\b|reread\\b|rerea\\b|rere\\b|rer\\b|re\\b|reset\\b|rese\\b|res\\b|screendump\\b|screendum\\b|screendu\\b|screend\\b|screen\\b|scree\\b|scre\\b|scr\\b|shell\\b|shel\\b|she\\b|system\\b|syste\\b|syst\\b|sys\\b|sy\\b|update\\b|updat\\b|upda\\b|upd\\b|up\\b" (Arbitrary "Keyword") (GoTo genericargs')+ , tokNext "pwd\\b|reread\\b|rerea\\b|rere\\b|rer\\b|re\\b|reset\\b|rese\\b|res\\b|screendump\\b|screendum\\b|screendu\\b|screend\\b|screen\\b|scree\\b|scre\\b|scr\\b|shell\\b|shel\\b|she\\b|test\\b" (Arbitrary "Keyword") (GoTo noargs')+ , tokNext "([a-zA-Z_][a-zA-Z0-9_]*)(\\s*)(=)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Text"), (Arbitrary "Operator")]) (GoTo genericargs')+ , tokNext "([a-zA-Z_][a-zA-Z0-9_]*)(\\s*\\(.*?\\)\\s*)(=)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Operator")]) (GoTo genericargs')+ , tok "@[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok ";" (Arbitrary "Keyword")+ ]+
+ src/Text/Highlighter/Lexers/Go.hs view
@@ -0,0 +1,36 @@+module Text.Highlighter.Lexers.Go (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Go"+ , lAliases = ["go"]+ , lExtensions = [".go"]+ , lMimetypes = ["text/x-gosrc"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "\\n" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ , tok "\\\\\\n" (Arbitrary "Text")+ , tok "//(.*?)\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/(\\\\\\n)?[*](.|\\n)*?[*](\\\\\\n)?/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "(break|default|func|interface|select|case|defer|go|map|struct|chan|else|goto|package|switch|const|fallthrough|if|range|type|continue|for|import|return|var)\\b" (Arbitrary "Keyword")+ , tok "(uint8|uint16|uint32|uint64|int8|int16|int32|int64|float32|float64|byte|uint|int|float|uintptr|string|close|closed|len|cap|new|make)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "\\d+(\\.\\d+[eE][+\\-]?\\d+|\\.\\d*|[eE][+\\-]?\\d+)" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "\\.\\d+([eE][+\\-]?\\d+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0[0-7]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "0[xX][0-9a-fA-F]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "(0|[1-9][0-9]*)" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "'(\\\\['\"\\\\abfnrtv]|\\\\x[0-9a-fA-F]{2}|\\\\[0-7]{1,3}|\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}|[^\\\\])'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "`[^`]*`" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "(<<=|>>=|<<|>>|<=|>=|&\\^=|&\\^|\\+=|-=|\\*=|/=|%=|&=|\\|=|&&|\\|\\||<-|\\+\\+|--|==|!=|:=|\\.\\.\\.)|[+\\-*/%&|^<>=!()\\[\\]{}.,;:]" (Arbitrary "Punctuation")+ , tok "[a-zA-Z_]\\w*" (Arbitrary "Name")+ ]+
+ src/Text/Highlighter/Lexers/GoodDataCL.hs view
@@ -0,0 +1,42 @@+module Text.Highlighter.Lexers.GoodDataCL (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "GoodData-CL"+ , lAliases = ["gooddata-cl"]+ , lExtensions = [".gdc"]+ , lMimetypes = ["text/x-gooddata-cl"]+ , lStart = root'+ , lFlags = [caseless]+ }++argsList' :: TokenMatcher+argsList' =+ [ tokNext "\\)" (Arbitrary "Punctuation") Pop+ , tok "," (Arbitrary "Punctuation")+ , tok "[a-zA-Z]\\w*" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "=" (Arbitrary "Operator")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo stringLiteral')+ , tok "[0-9]+(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]{1,3})?" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "\\s" (Arbitrary "Text")+ ]++root' :: TokenMatcher+root' =+ [ tok "#.*" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "[a-zA-Z]\\w*" (Arbitrary "Name" :. Arbitrary "Function")+ , tokNext "\\(" (Arbitrary "Punctuation") (GoTo argsList')+ , tok ";" (Arbitrary "Punctuation")+ , tok "\\s+" (Arbitrary "Text")+ ]++stringLiteral' :: TokenMatcher+stringLiteral' =+ [ tok "\\\\[tnrfbae\"\\\\]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "[^\\\\\"]+" (Arbitrary "Literal" :. Arbitrary "String")+ ]+
+ src/Text/Highlighter/Lexers/Groff.hs view
@@ -0,0 +1,49 @@+module Text.Highlighter.Lexers.Groff (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Groff"+ , lAliases = ["groff", "nroff", "man"]+ , lExtensions = [".[1234567]", ".man"]+ , lMimetypes = ["application/x-troff", "text/troff"]+ , lStart = root'+ , lFlags = [multiline]+ }++request' :: TokenMatcher+request' =+ [ tokNext "\\n" (Arbitrary "Text") Pop+ , anyOf escapes'+ , tok "\"[^\\n\"]+\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "\\d+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "\\S+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\s+" (Arbitrary "Text")+ ]++escapes' :: TokenMatcher+escapes' =+ [ tok "\\\\\"[^\\n]*" (Arbitrary "Comment")+ , tok "\\\\[fn]\\w" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "\\\\\\(.." (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "\\\\.\\[.*\\]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "\\\\." (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tokNext "\\\\\\n" (Arbitrary "Text") (GoTo request')+ ]++root' :: TokenMatcher+root' =+ [ tokNext "(?i)(\\.)(\\w+)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword")]) (GoTo request')+ , tokNext "\\." (Arbitrary "Punctuation") (GoTo request')+ , tokNext "[^\\\\\\n]*" (Arbitrary "Text") (GoTo textline')+ ]++textline' :: TokenMatcher+textline' =+ [ anyOf escapes'+ , tok "[^\\\\\\n]+" (Arbitrary "Text")+ , tokNext "\\n" (Arbitrary "Text") Pop+ ]+
+ src/Text/Highlighter/Lexers/Haskell.hs view
@@ -0,0 +1,108 @@+module Text.Highlighter.Lexers.Haskell (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Haskell"+ , lAliases = ["haskell", "hs"]+ , lExtensions = [".hs"]+ , lMimetypes = ["text/x-haskell"]+ , lStart = root'+ , lFlags = [multiline]+ }++comment' :: TokenMatcher+comment' =+ [ tok "[^-{}]+" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "{-" (Arbitrary "Comment" :. Arbitrary "Multiline") Push+ , tokNext "-}" (Arbitrary "Comment" :. Arbitrary "Multiline") Pop+ , tok "[-{}]" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]++funclist' :: TokenMatcher+funclist' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "[A-Z][a-zA-Z0-9_]*" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "[_a-z][\\w\\']*" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "--.*$" (Arbitrary "Comment" :. Arbitrary "Single")+ , tokNext "{-" (Arbitrary "Comment" :. Arbitrary "Multiline") (GoTo comment')+ , tok "," (Arbitrary "Punctuation")+ , tok "[:!#$%&*+.\\\\/<=>?@^|\126-]+" (Arbitrary "Operator")+ , tokNext "\\(" (Arbitrary "Punctuation") (DoAll [(GoTo funclist'), (GoTo funclist')])+ , tokNext "\\)" (Arbitrary "Punctuation") (PopNum 2)+ ]++string' :: TokenMatcher+string' =+ [ tok "[^\\\\\"]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "\\\\" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape") (GoTo escape')+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]++import' :: TokenMatcher+import' =+ [ tok "\\s+" (Arbitrary "Text")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo string')+ , tokNext "\\)" (Arbitrary "Punctuation") Pop+ , tok "qualified(?![\\w'])" (Arbitrary "Keyword")+ , tokNext "([A-Z][a-zA-Z0-9_.]*)(\\s+)(as)(\\s+)([A-Z][a-zA-Z0-9_.]*)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Namespace"), (Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name")]) Pop+ , tokNext "([A-Z][a-zA-Z0-9_.]*)(\\s+)(hiding)(\\s+)(\\()" (ByGroups [(Arbitrary "Name" :. Arbitrary "Namespace"), (Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Punctuation")]) (GoTo funclist')+ , tokNext "([A-Z][a-zA-Z0-9_.]*)(\\s+)(\\()" (ByGroups [(Arbitrary "Name" :. Arbitrary "Namespace"), (Arbitrary "Text"), (Arbitrary "Punctuation")]) (GoTo funclist')+ , tokNext "[a-zA-Z0-9_.]+" (Arbitrary "Name" :. Arbitrary "Namespace") Pop+ ]++escape' :: TokenMatcher+escape' =+ [ tokNext "[abfnrtv\"\\'&\\\\]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape") Pop+ , tokNext "\\^[][A-Z@\\^_]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape") Pop+ , tokNext "NUL|SOH|[SE]TX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|S[OI]|DLE|DC[1-4]|NAK|SYN|ETB|CAN|EM|SUB|ESC|[FGRU]S|SP|DEL" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape") Pop+ , tokNext "o[0-7]+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape") Pop+ , tokNext "x[\\da-fA-F]+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape") Pop+ , tokNext "\\d+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape") Pop+ , tokNext "\\s+\\\\" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape") Pop+ ]++root' :: TokenMatcher+root' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "--(?![!#$%&*+./<=>?@\\^|_\126]).*?$" (Arbitrary "Comment" :. Arbitrary "Single")+ , tokNext "{-" (Arbitrary "Comment" :. Arbitrary "Multiline") (GoTo comment')+ , tokNext "(?<![\\w'])import(?![\\w'])" (Arbitrary "Keyword" :. Arbitrary "Reserved") (GoTo import')+ , tokNext "(?<![\\w'])module(?![\\w'])" (Arbitrary "Keyword" :. Arbitrary "Reserved") (GoTo module')+ , tok "(?<![\\w'])error(?![\\w'])" (Arbitrary "Name" :. Arbitrary "Exception")+ , tok "(?<![\\w'])(case|class|data|default|deriving|do|else|if|in|infix[lr]?|instance|let|newtype|of|then|type|where|_)(?!\\')(?![\\w'])" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "^[_a-z][\\w\\']*" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "[_a-z][\\w\\']*" (Arbitrary "Name")+ , tok "[A-Z][\\w\\']*" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "\\\\(?![:!#$%&*+.\\\\/<=>?@^|\126-]+)" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "(<-|::|->|=>|=)(?![:!#$%&*+.\\\\/<=>?@^|\126-]+)" (Arbitrary "Operator" :. Arbitrary "Word")+ , tok ":[:!#$%&*+.\\\\/<=>?@^|\126-]*" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "[:!#$%&*+.\\\\/<=>?@^|\126-]+" (Arbitrary "Operator")+ , tok "\\d+[eE][+-]?\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "\\d+\\.\\d+([eE][+-]?\\d+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0[oO][0-7]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "0[xX][\\da-fA-F]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tokNext "'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char") (GoTo character')+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo string')+ , tok "\\[\\]" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "\\(\\)" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "[][(),;`{}]" (Arbitrary "Punctuation")+ ]++module' :: TokenMatcher+module' =+ [ tok "\\s+" (Arbitrary "Text")+ , tokNext "([A-Z][a-zA-Z0-9_.]*)(\\s+)(\\()" (ByGroups [(Arbitrary "Name" :. Arbitrary "Namespace"), (Arbitrary "Text"), (Arbitrary "Punctuation")]) (GoTo funclist')+ , tokNext "[A-Z][a-zA-Z0-9_.]*" (Arbitrary "Name" :. Arbitrary "Namespace") Pop+ ]++character' :: TokenMatcher+character' =+ [ tok "[^\\\\']" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tokNext "\\\\" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape") (GoTo escape')+ , tokNext "'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char") Pop+ ]+
+ src/Text/Highlighter/Lexers/Haxe.hs view
@@ -0,0 +1,255 @@+module Text.Highlighter.Lexers.Haxe (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "haXe"+ , lAliases = ["hx", "haXe"]+ , lExtensions = [".hx"]+ , lMimetypes = ["text/haxe"]+ , lStart = root'+ , lFlags = [multiline, dotall]+ }++anonfundef' :: TokenMatcher+anonfundef' =+ [ tokNext "\\bfunction\\b" (Arbitrary "Keyword" :. Arbitrary "Declaration") (GoTo fundecl')+ ]++instancefundef' :: TokenMatcher+instancefundef' =+ [ tok "(?:public|private|override|static|inline|extern|dynamic)" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , tokNext "\\b(function)(\\s+)((?:[a-zA-Z_][a-zA-Z0-9_]*))" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Declaration"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function")]) (GoTo fundecl')+ ]++typedecl' :: TokenMatcher+typedecl' =+ [ anyOf whitespace'+ , tok "(?:(?:[a-z0-9_\\.])*[A-Z_][A-Za-z0-9_]*)" (Arbitrary "Name" :. Arbitrary "Class")+ , tokNext "<" (Arbitrary "Punctuation") (GoTo generictypedecl')+ , tokNext "(?=[{}()=,a-z])" (Arbitrary "Text") Pop+ ]++typedefbody' :: TokenMatcher+typedefbody' =+ [ anyOf whitespace'+ , anyOf instancevardef'+ , anyOf instancefundef'+ , tokNext ">" (Arbitrary "Punctuation") (GoTo typedecl')+ , tok "," (Arbitrary "Punctuation")+ , tokNext "}" (Arbitrary "Punctuation") Pop+ ]++classdefbody' :: TokenMatcher+classdefbody' =+ [ anyOf whitespace'+ , anyOf instancevardef'+ , anyOf instancefundef'+ , tokNext "}" (Arbitrary "Punctuation") Pop+ , anyOf codeblock'+ ]++fundecl' :: TokenMatcher+fundecl' =+ [ anyOf whitespace'+ , anyOf typelabel'+ , anyOf generictypedecl'+ , tokNext "\\(" (Arbitrary "Punctuation") (GoTo funargdecl')+ , tokNext "(?=[a-zA-Z0-9_])" (Arbitrary "Text") Pop+ , tokNext "{" (Arbitrary "Punctuation") (DoAll [Pop, (GoTo codeblock')])+ , tokNext ";" (Arbitrary "Punctuation") Pop+ ]++interfacedef' :: TokenMatcher+interfacedef' =+ [ tokNext "interface" (Arbitrary "Keyword" :. Arbitrary "Declaration") (DoAll [(GoTo interfacedefprebody'), (GoTo typedecl')])+ ]++codekeywords' :: TokenMatcher+codekeywords' =+ [ tok "\\b(if|else|while|do|for|in|break|continue|return|switch|case|try|catch|throw|null|trace|new|this|super|untyped|cast|callback|here)\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ ]++enumdefbody' :: TokenMatcher+enumdefbody' =+ [ anyOf whitespace'+ , tok "(?:[a-zA-Z_][a-zA-Z0-9_]*)" (Arbitrary "Name" :. Arbitrary "Variable" :. Arbitrary "Instance")+ , tokNext "\\(" (Arbitrary "Punctuation") (GoTo funargdecl')+ , tok ";" (Arbitrary "Punctuation")+ , tokNext "}" (Arbitrary "Punctuation") Pop+ ]++typedefprebody' :: TokenMatcher+typedefprebody' =+ [ anyOf whitespace'+ , tokNext "(=)(\\s*)({)" (ByGroups [(Arbitrary "Punctuation"), (Arbitrary "Text"), (Arbitrary "Punctuation")]) (DoAll [Pop, (GoTo typedefbody')])+ ]++classdef' :: TokenMatcher+classdef' =+ [ tokNext "class" (Arbitrary "Keyword" :. Arbitrary "Declaration") (DoAll [(GoTo classdefprebody'), (GoTo typedecl')])+ ]++generictypedecl' :: TokenMatcher+generictypedecl' =+ [ anyOf whitespace'+ , tok "(?:(?:[a-z0-9_\\.])*[A-Z_][A-Za-z0-9_]*)" (Arbitrary "Name" :. Arbitrary "Class")+ , tokNext "<" (Arbitrary "Punctuation") Push+ , tokNext ">" (Arbitrary "Punctuation") Pop+ , tok "," (Arbitrary "Punctuation")+ ]++instancevardecl' :: TokenMatcher+instancevardecl' =+ [ anyOf vardecl'+ , anyOf propertydef'+ ]++classdefprebody' :: TokenMatcher+classdefprebody' =+ [ anyOf whitespace'+ , tokNext "(extends|implements)" (Arbitrary "Keyword" :. Arbitrary "Declaration") (GoTo typedecl')+ , tokNext "{" (Arbitrary "Punctuation") (DoAll [Pop, (GoTo classdefbody')])+ ]++vardef' :: TokenMatcher+vardef' =+ [ tokNext "\\b(var)(\\s+)((?:[a-zA-Z_][a-zA-Z0-9_]*))" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Declaration"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Variable")]) (GoTo vardecl')+ ]++propertydef' :: TokenMatcher+propertydef' =+ [ tok "(\\()((?:default|null|never))(,)((?:default|null|never))(\\))" (ByGroups [(Arbitrary "Punctuation"), (Arbitrary "Keyword" :. Arbitrary "Reserved"), (Arbitrary "Punctuation"), (Arbitrary "Keyword" :. Arbitrary "Reserved"), (Arbitrary "Punctuation")])+ ]++codeblock' :: TokenMatcher+codeblock' =+ [ anyOf whitespace'+ , anyOf new'+ , anyOf case'+ , anyOf anonfundef'+ , anyOf literals'+ , anyOf vardef'+ , anyOf codekeywords'+ , tok "[();,\\[\\]]" (Arbitrary "Punctuation")+ , tok "(?:=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>=|>>>=|\\|\\||&&|\\.\\.\\.|==|!=|>|<|>=|<=|\\||&|\\^|<<|>>|>>>|\\+|\\-|\\*|/|%|!|\\+\\+|\\-\\-|\126|\\.|\\?|\\:)" (Arbitrary "Operator")+ , tok "(?:[a-zA-Z_][a-zA-Z0-9_]*)" (Arbitrary "Name")+ , tokNext "}" (Arbitrary "Punctuation") Pop+ , tokNext "{" (Arbitrary "Punctuation") Push+ ]++case' :: TokenMatcher+case' =+ [ tokNext "\\b(case)(\\s+)((?:[a-zA-Z_][a-zA-Z0-9_]*))(\\s*)(\\()" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Reserved"), (Arbitrary "Text"), (Arbitrary "Name"), (Arbitrary "Text"), (Arbitrary "Punctuation")]) (GoTo funargdecl')+ ]++enumdefprebody' :: TokenMatcher+enumdefprebody' =+ [ anyOf whitespace'+ , tokNext "{" (Arbitrary "Punctuation") (DoAll [Pop, (GoTo enumdefbody')])+ ]++typedef' :: TokenMatcher+typedef' =+ [ tokNext "typedef" (Arbitrary "Keyword" :. Arbitrary "Declaration") (DoAll [(GoTo typedefprebody'), (GoTo typedecl')])+ ]++instancevardef' :: TokenMatcher+instancevardef' =+ [ tok "(?:public|private|override|static|inline|extern|dynamic)" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , tokNext "\\b(var)(\\s+)((?:[a-zA-Z_][a-zA-Z0-9_]*))" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Declaration"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Variable" :. Arbitrary "Instance")]) (GoTo instancevardecl')+ ]++literals' :: TokenMatcher+literals' =+ [ tok "0[xX][0-9a-fA-F]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "[0-9][0-9]*\\.[0-9]+([eE][0-9]+)?[fd]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "'(\\\\\\\\|\\\\'|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "\126/([^\\n])*?/[gisx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ , tok "\\b(true|false|null)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ ]++whitespace' :: TokenMatcher+whitespace' =+ [ anyOf comments'+ , tok "\\s+" (Arbitrary "Text")+ ]++interfacedefprebody' :: TokenMatcher+interfacedefprebody' =+ [ anyOf whitespace'+ , tokNext "(extends)" (Arbitrary "Keyword" :. Arbitrary "Declaration") (GoTo typedecl')+ , tokNext "{" (Arbitrary "Punctuation") (DoAll [Pop, (GoTo classdefbody')])+ ]++type' :: TokenMatcher+type' =+ [ anyOf whitespace'+ , tok "(?:(?:[a-z0-9_\\.])*[A-Z_][A-Za-z0-9_]*)" (Arbitrary "Name" :. Arbitrary "Class")+ , tokNext "<" (Arbitrary "Punctuation") (GoTo generictypedecl')+ , tok "->" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tokNext "(?=[{}(),;=])" (Arbitrary "Text") Pop+ ]++vardecl' :: TokenMatcher+vardecl' =+ [ anyOf whitespace'+ , anyOf typelabel'+ , tokNext "=" (Arbitrary "Operator") Pop+ , tokNext ";" (Arbitrary "Punctuation") Pop+ ]++comments' :: TokenMatcher+comments' =+ [ tok "//.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/\\*.*?\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "#[^\\n]*" (Arbitrary "Comment" :. Arbitrary "Preproc")+ ]++enumdef' :: TokenMatcher+enumdef' =+ [ tokNext "enum" (Arbitrary "Keyword" :. Arbitrary "Declaration") (DoAll [(GoTo enumdefprebody'), (GoTo typedecl')])+ ]++imports' :: TokenMatcher+imports' =+ [ tok "(package|import|using)(\\s+)([^;]+)(;)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Namespace"), (Arbitrary "Punctuation")])+ ]++new' :: TokenMatcher+new' =+ [ tokNext "\\bnew\\b" (Arbitrary "Keyword") (GoTo typedecl')+ ]++typelabel' :: TokenMatcher+typelabel' =+ [ tokNext ":" (Arbitrary "Punctuation") (GoTo type')+ ]++root' :: TokenMatcher+root' =+ [ anyOf whitespace'+ , anyOf comments'+ , tok "(?:public|private|override|static|inline|extern|dynamic)" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , anyOf enumdef'+ , anyOf typedef'+ , anyOf classdef'+ , anyOf imports'+ ]++funargdecl' :: TokenMatcher+funargdecl' =+ [ anyOf whitespace'+ , tok "(?:[a-zA-Z_][a-zA-Z0-9_]*)" (Arbitrary "Name" :. Arbitrary "Variable")+ , anyOf typelabel'+ , anyOf literals'+ , tok "=" (Arbitrary "Operator")+ , tok "," (Arbitrary "Punctuation")+ , tok "\\?" (Arbitrary "Punctuation")+ , tokNext "\\)" (Arbitrary "Punctuation") Pop+ ]+
+ src/Text/Highlighter/Lexers/Html.hs view
@@ -0,0 +1,64 @@+module Text.Highlighter.Lexers.Html (lexer) where+import qualified Text.Highlighter.Lexers.Css as Css+import qualified Text.Highlighter.Lexers.Javascript as Javascript+import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "HTML"+ , lAliases = ["html"]+ , lExtensions = [".html", ".htm", ".xhtml", ".xslt"]+ , lMimetypes = ["text/html", "application/xhtml+xml"]+ , lStart = root'+ , lFlags = [caseless, dotall]+ }++comment' :: TokenMatcher+comment' =+ [ tok "[^-]+" (Arbitrary "Comment")+ , tokNext "-->" (Arbitrary "Comment") Pop+ , tok "-" (Arbitrary "Comment")+ ]++styleContent' :: TokenMatcher+styleContent' =+ [ tokNext "<\\s*/\\s*style\\s*>" (Arbitrary "Name" :. Arbitrary "Tag") Pop+ , tok ".+?(?=<\\s*/\\s*style\\s*>)" (Using Css.lexer)+ ]++attr' :: TokenMatcher+attr' =+ [ tokNext "\".*?\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tokNext "'.*?'" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tokNext "[^\\s>]+" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]++scriptContent' :: TokenMatcher+scriptContent' =+ [ tokNext "<\\s*/\\s*script\\s*>" (Arbitrary "Name" :. Arbitrary "Tag") Pop+ , tok ".+?(?=<\\s*/\\s*script\\s*>)" (Using Javascript.lexer)+ ]++tag' :: TokenMatcher+tag' =+ [ tok "\\s+" (Arbitrary "Text")+ , tokNext "[a-zA-Z0-9_:-]+\\s*=" (Arbitrary "Name" :. Arbitrary "Attribute") (GoTo attr')+ , tok "[a-zA-Z0-9_:-]+" (Arbitrary "Name" :. Arbitrary "Attribute")+ , tokNext "/?\\s*>" (Arbitrary "Name" :. Arbitrary "Tag") Pop+ ]++root' :: TokenMatcher+root' =+ [ tok "[^<&]+" (Arbitrary "Text")+ , tok "&\\S*?;" (Arbitrary "Name" :. Arbitrary "Entity")+ , tok "\\<\\!\\[CDATA\\[.*?\\]\\]\\>" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tokNext "<!--" (Arbitrary "Comment") (GoTo comment')+ , tok "<\\?.*?\\?>" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "<![^>]*>" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tokNext "<\\s*script\\s*" (Arbitrary "Name" :. Arbitrary "Tag") (DoAll [(GoTo scriptContent'), (GoTo tag')])+ , tokNext "<\\s*style\\s*" (Arbitrary "Name" :. Arbitrary "Tag") (DoAll [(GoTo styleContent'), (GoTo tag')])+ , tokNext "<\\s*[a-zA-Z0-9:]+" (Arbitrary "Name" :. Arbitrary "Tag") (GoTo tag')+ , tok "<\\s*/\\s*[a-zA-Z0-9:]+\\s*>" (Arbitrary "Name" :. Arbitrary "Tag")+ ]+
+ src/Text/Highlighter/Lexers/Hybris.hs view
@@ -0,0 +1,51 @@+module Text.Highlighter.Lexers.Hybris (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Hybris"+ , lAliases = ["hybris", "hy"]+ , lExtensions = [".hy", ".hyb"]+ , lMimetypes = ["text/x-hybris", "application/x-hybris"]+ , lStart = root'+ , lFlags = [multiline, dotall]+ }++import' :: TokenMatcher+import' =+ [ tokNext "[a-zA-Z0-9_.]+\\*?" (Arbitrary "Name" :. Arbitrary "Namespace") Pop+ ]++root' :: TokenMatcher+root' =+ [ tok "^(\\s*(?:function|method|operator\\s+)+?)([a-zA-Z_][a-zA-Z0-9_]*)(\\s*)(\\()" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Operator")])+ , tok "[^\\S\\n]+" (Arbitrary "Text")+ , tok "//.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/\\*.*?\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "@[a-zA-Z_][a-zA-Z0-9_\\.]*" (Arbitrary "Name" :. Arbitrary "Decorator")+ , tok "(break|case|catch|next|default|do|else|finally|for|foreach|of|unless|if|new|return|switch|me|throw|try|while)\\b" (Arbitrary "Keyword")+ , tok "(extends|private|protected|public|static|throws|function|method|operator)\\b" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , tok "(true|false|null|__FILE__|__LINE__|__VERSION__|__LIB_PATH__|__INC_PATH__)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tokNext "(class|struct)(\\s+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Declaration"), (Arbitrary "Text")]) (GoTo class')+ , tokNext "(import|include)(\\s+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text")]) (GoTo import')+ , tok "(gc_collect|gc_mm_items|gc_mm_usage|gc_collect_threshold|urlencode|urldecode|base64encode|base64decode|sha1|crc32|sha2|md5|md5_file|acos|asin|atan|atan2|ceil|cos|cosh|exp|fabs|floor|fmod|log|log10|pow|sin|sinh|sqrt|tan|tanh|isint|isfloat|ischar|isstring|isarray|ismap|isalias|typeof|sizeof|toint|tostring|fromxml|toxml|binary|pack|load|eval|var_names|var_values|user_functions|dyn_functions|methods|call|call_method|mknod|mkfifo|mount|umount2|umount|ticks|usleep|sleep|time|strtime|strdate|dllopen|dlllink|dllcall|dllcall_argv|dllclose|env|exec|fork|getpid|wait|popen|pclose|exit|kill|pthread_create|pthread_create_argv|pthread_exit|pthread_join|pthread_kill|smtp_send|http_get|http_post|http_download|socket|bind|listen|accept|getsockname|getpeername|settimeout|connect|server|recv|send|close|print|println|printf|input|readline|serial_open|serial_fcntl|serial_get_attr|serial_get_ispeed|serial_get_ospeed|serial_set_attr|serial_set_ispeed|serial_set_ospeed|serial_write|serial_read|serial_close|xml_load|xml_parse|fopen|fseek|ftell|fsize|fread|fwrite|fgets|fclose|file|readdir|pcre_replace|size|pop|unmap|has|keys|values|length|find|substr|replace|split|trim|remove|contains|join)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(MethodReference|Runner|Dll|Thread|Pipe|Process|Runnable|CGI|ClientSocket|Socket|ServerSocket|File|Console|Directory|Exception)\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "'\\\\.'|'[^\\\\]'|'\\\\u[0-9a-f]{4}'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "(\\.)([a-zA-Z_][a-zA-Z0-9_]*)" (ByGroups [(Arbitrary "Operator"), (Arbitrary "Name" :. Arbitrary "Attribute")])+ , tok "[a-zA-Z_][a-zA-Z0-9_]*:" (Arbitrary "Name" :. Arbitrary "Label")+ , tok "[a-zA-Z_\\$][a-zA-Z0-9_]*" (Arbitrary "Name")+ , tok "[\126\\^\\*!%&\\[\\]\\(\\)\\{\\}<>\\|+=:;,./?\\-@]+" (Arbitrary "Operator")+ , tok "[0-9][0-9]*\\.[0-9]+([eE][0-9]+)?[fd]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0x[0-9a-f]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "[0-9]+L?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\\n" (Arbitrary "Text")+ ]++class' :: TokenMatcher+class' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Class") Pop+ ]+
+ src/Text/Highlighter/Lexers/Ini.hs view
@@ -0,0 +1,23 @@+module Text.Highlighter.Lexers.Ini (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "INI"+ , lAliases = ["ini", "cfg"]+ , lExtensions = [".ini", ".cfg"]+ , lMimetypes = ["text/x-ini"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "[;#].*?$" (Arbitrary "Comment")+ , tok "\\[.*?\\]$" (Arbitrary "Keyword")+ , tok "(.*?)([ \\t]*)(=)([ \\t]*)(.*(?:\\n[ \\t].+)*)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Attribute"), (Arbitrary "Text"), (Arbitrary "Operator"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String")])+ ]+
+ src/Text/Highlighter/Lexers/Io.hs view
@@ -0,0 +1,41 @@+module Text.Highlighter.Lexers.Io (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Io"+ , lAliases = ["io"]+ , lExtensions = [".io"]+ , lMimetypes = ["text/x-iosrc"]+ , lStart = root'+ , lFlags = [multiline]+ }++nestedcomment' :: TokenMatcher+nestedcomment' =+ [ tok "[^+/]+" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "/\\+" (Arbitrary "Comment" :. Arbitrary "Multiline") Push+ , tokNext "\\+/" (Arbitrary "Comment" :. Arbitrary "Multiline") Pop+ , tok "[+/]" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]++root' :: TokenMatcher+root' =+ [ tok "\\n" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ , tok "//(.*?)\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "#(.*?)\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/(\\\\\\n)?[*](.|\\n)*?[*](\\\\\\n)?/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "/\\+" (Arbitrary "Comment" :. Arbitrary "Multiline") (GoTo nestedcomment')+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "::=|:=|=|\\(|\\)|;|,|\\*|-|\\+|>|<|@|!|/|\\||\\^|\\.|%|&|\\[|\\]|\\{|\\}" (Arbitrary "Operator")+ , tok "(clone|do|doFile|doString|method|for|if|else|elseif|then)\\b" (Arbitrary "Keyword")+ , tok "(nil|false|true)\\b" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "(Object|list|List|Map|args|Sequence|Coroutine|File)\8" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name")+ , tok "(\\d+\\.?\\d*|\\d*\\.\\d+)([eE][+-]?[0-9]+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ ]+
+ src/Text/Highlighter/Lexers/Ioke.hs view
@@ -0,0 +1,107 @@+module Text.Highlighter.Lexers.Ioke (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Ioke"+ , lAliases = ["ioke", "ik"]+ , lExtensions = [".ik"]+ , lMimetypes = ["text/x-iokesrc"]+ , lStart = root'+ , lFlags = [multiline]+ }++squareRegexp' :: TokenMatcher+squareRegexp' =+ [ tokNext "(?<!\\\\)][oxpniums]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") Pop+ , anyOf interpolatableText'+ , tok "\\\\]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ , tok "[^\\]]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ ]++textInterpolationRoot' :: TokenMatcher+textInterpolationRoot' =+ [ tokNext "}" (Arbitrary "Punctuation") Pop+ , anyOf root'+ ]++interpolatableText' :: TokenMatcher+interpolatableText' =+ [ tok "(\\\\b|\\\\e|\\\\t|\\\\n|\\\\f|\\\\r|\\\\\"|\\\\\\\\|\\\\#|\\\\\\Z|\\\\u[0-9a-fA-F]{1,4}|\\\\[0-3]?[0-7]?[0-7])" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tokNext "#{" (Arbitrary "Punctuation") (GoTo textInterpolationRoot')+ ]++text' :: TokenMatcher+text' =+ [ tokNext "(?<!\\\\)\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , anyOf interpolatableText'+ , tok "[^\"]" (Arbitrary "Literal" :. Arbitrary "String")+ ]++documentation' :: TokenMatcher+documentation' =+ [ tokNext "(?<!\\\\)\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Doc") Pop+ , anyOf interpolatableText'+ , tok "[^\"]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Doc")+ ]++slashRegexp' :: TokenMatcher+slashRegexp' =+ [ tokNext "(?<!\\\\)/[oxpniums]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") Pop+ , anyOf interpolatableText'+ , tok "\\\\/" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ , tok "[^/]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ ]++squareText' :: TokenMatcher+squareText' =+ [ tokNext "(?<!\\\\)]" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , anyOf interpolatableText'+ , tok "[^\\]]" (Arbitrary "Literal" :. Arbitrary "String")+ ]++root' :: TokenMatcher+root' =+ [ tok "\\n" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ , tok ";(.*?)\\n" (Arbitrary "Comment")+ , tok "\\A#!(.*?)\\n" (Arbitrary "Comment")+ , tokNext "#/" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") (GoTo slashRegexp')+ , tokNext "#r\\[" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") (GoTo squareRegexp')+ , tok ":[a-zA-Z0-9_!:?]+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol")+ , tok "[a-zA-Z0-9_!:?]+:(?![a-zA-Z0-9_!?])" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ , tok ":\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol")+ , tokNext "((?<=fn\\()|(?<=fnx\\()|(?<=method\\()|(?<=macro\\()|(?<=lecro\\()|(?<=syntax\\()|(?<=dmacro\\()|(?<=dlecro\\()|(?<=dlecrox\\()|(?<=dsyntax\\())[\\s\\n\\r]*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Doc") (GoTo documentation')+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo text')+ , tokNext "#\\[" (Arbitrary "Literal" :. Arbitrary "String") (GoTo squareText')+ , tok "[a-zA-Z0-9_][a-zA-Z0-9!?_:]+(?=\\s*=.*mimic\\s)" (Arbitrary "Name" :. Arbitrary "Entity")+ , tok "[a-zA-Z_][a-zA-Z0-9_!:?]*(?=[\\s]*[+*/-]?=[^=].*($|\\.))" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "(break|cond|continue|do|ensure|for|for:dict|for:set|if|let|loop|p:for|p:for:dict|p:for:set|return|unless|until|while|with)(?![a-zA-Z0-9!:_?])" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "(eval|mimic|print|println)(?![a-zA-Z0-9!:_?])" (Arbitrary "Keyword")+ , tok "(cell\\?|cellNames|cellOwner\\?|cellOwner|cells|cell|documentation|hash|identity|mimic|removeCell\\!|undefineCell\\!)(?![a-zA-Z0-9!:_?])" (Arbitrary "Keyword")+ , tok "(stackTraceAsText)(?![a-zA-Z0-9!:_?])" (Arbitrary "Keyword")+ , tok "(dict|list|message|set)(?![a-zA-Z0-9!:_?])" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "(case|case:and|case:else|case:nand|case:nor|case:not|case:or|case:otherwise|case:xor)(?![a-zA-Z0-9!:_?])" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "(asText|become\\!|derive|freeze\\!|frozen\\?|in\\?|is\\?|kind\\?|mimic\\!|mimics|mimics\\?|prependMimic\\!|removeAllMimics\\!|removeMimic\\!|same\\?|send|thaw\\!|uniqueHexId)(?![a-zA-Z0-9!:_?])" (Arbitrary "Keyword")+ , tok "(after|around|before)(?![a-zA-Z0-9!:_?])" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "(kind|cellDescriptionDict|cellSummary|genSym|inspect|notice)(?![a-zA-Z0-9!:_?])" (Arbitrary "Keyword")+ , tok "(use|destructuring)" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "(cell\\?|cellOwner\\?|cellOwner|cellNames|cells|cell|documentation|identity|removeCell!|undefineCell)(?![a-zA-Z0-9!:_?])" (Arbitrary "Keyword")+ , tok "(internal:compositeRegexp|internal:concatenateText|internal:createDecimal|internal:createNumber|internal:createRegexp|internal:createText)(?![a-zA-Z0-9!:_?])" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "(availableRestarts|bind|error\\!|findRestart|handle|invokeRestart|rescue|restart|signal\\!|warn\\!)(?![a-zA-Z0-9!:_?])" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "(nil|false|true)(?![a-zA-Z0-9!:_?])" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "(Arity|Base|Call|Condition|DateTime|Aspects|Pointcut|Assignment|BaseBehavior|Boolean|Case|AndCombiner|Else|NAndCombiner|NOrCombiner|NotCombiner|OrCombiner|XOrCombiner|Conditions|Definitions|FlowControl|Internal|Literals|Reflection|DefaultMacro|DefaultMethod|DefaultSyntax|Dict|FileSystem|Ground|Handler|Hook|IO|IokeGround|Struct|LexicalBlock|LexicalMacro|List|Message|Method|Mixins|NativeMethod|Number|Origin|Pair|Range|Reflector|Regexp Match|Regexp|Rescue|Restart|Runtime|Sequence|Set|Symbol|System|Text|Tuple)(?![a-zA-Z0-9!:_?])" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(generateMatchMethod|aliasMethod|\955|\654|fnx|fn|method|dmacro|dlecro|syntax|macro|dlecrox|lecrox|lecro|syntax)(?![a-zA-Z0-9!:_?])" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "-?0[xX][0-9a-fA-F]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "-?(\\d+\\.?\\d*|\\d*\\.\\d+)([eE][+-]?[0-9]+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "-?\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "#\\(" (Arbitrary "Punctuation")+ , tok "(&&>>|\\|\\|>>|\\*\\*>>|:::|::|\\.\\.\\.|===|\\*\\*>|\\*\\*=|&&>|&&=|\\|\\|>|\\|\\|=|\\->>|\\+>>|!>>|<>>>|<>>|&>>|%>>|#>>|@>>|/>>|\\*>>|\\?>>|\\|>>|\\^>>|\126>>|\\$>>|=>>|<<=|>>=|<=>|<\\->|=\126|!\126|=>|\\+\\+|\\-\\-|<=|>=|==|!=|&&|\\.\\.|\\+=|\\-=|\\*=|\\/=|%=|&=|\\^=|\\|=|<\\-|\\+>|!>|<>|&>|%>|#>|\\@>|\\/>|\\*>|\\?>|\\|>|\\^>|\126>|\\$>|<\\->|\\->|<<|>>|\\*\\*|\\?\\||\\?&|\\|\\||>|<|\\*|\\/|%|\\+|\\-|&|\\^|\\||=|\\$|!|\126|\\?|#|\8800|\8728|\8712|\8713)" (Arbitrary "Operator")+ , tok "(and|nand|or|xor|nor|return|import)(?![a-zA-Z0-9_!?])" (Arbitrary "Operator")+ , tok "(\\`\\`|\\`|\\'\\'|\\'|\\.|\\,|@|@@|\\[|\\]|\\(|\\)|{|})" (Arbitrary "Punctuation")+ , tok "[A-Z][a-zA-Z0-9_!:?]*" (Arbitrary "Name" :. Arbitrary "Class")+ , tok "[a-z_][a-zA-Z0-9_!:?]*" (Arbitrary "Name")+ ]+
+ src/Text/Highlighter/Lexers/IrcLogs.hs view
@@ -0,0 +1,31 @@+module Text.Highlighter.Lexers.IrcLogs (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "IRC logs"+ , lAliases = ["irc"]+ , lExtensions = [".weechatlog"]+ , lMimetypes = ["text/x-irclog"]+ , lStart = root'+ , lFlags = [multiline]+ }++msg' :: TokenMatcher+msg' =+ [ tok "[^\\s]+:(?!//)" (Arbitrary "Name" :. Arbitrary "Attribute")+ , tokNext ".*\\n" (Arbitrary "Text") Pop+ ]++root' :: TokenMatcher+root' =+ [ tok "^\\*\\*\\*\\*(.*)\\*\\*\\*\\*$" (Arbitrary "Comment")+ , tok "^\10 (\10 # irssi / xchat and others\10 (?: \\[|\\()? # Opening bracket or paren for the timestamp\10 (?: # Timestamp\10 (?: (?:\\d{1,4} [-/]?)+ # Date as - or /-separated groups of digits\10 [T ])? # Date/time separator: T or space\10 (?: \\d?\\d [:.]?)+ # Time as :/.-separated groups of 1 or 2 digits\10 )\10 (?: \\]|\\))?\\s+ # Closing bracket or paren for the timestamp\10 |\10 # weechat\10 \\d{4}\\s\\w{3}\\s\\d{2}\\s # Date\10 \\d{2}:\\d{2}:\\d{2}\\s+ # Time + Whitespace\10 |\10 # xchat\10 \\w{3}\\s\\d{2}\\s # Date\10 \\d{2}:\\d{2}:\\d{2}\\s+ # Time + Whitespace\10 )?\10 (\\s*<[^>]*>\\s*)$" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Name" :. Arbitrary "Tag")])+ , tokNext "^\10 (\10 # irssi / xchat and others\10 (?: \\[|\\()? # Opening bracket or paren for the timestamp\10 (?: # Timestamp\10 (?: (?:\\d{1,4} [-/]?)+ # Date as - or /-separated groups of digits\10 [T ])? # Date/time separator: T or space\10 (?: \\d?\\d [:.]?)+ # Time as :/.-separated groups of 1 or 2 digits\10 )\10 (?: \\]|\\))?\\s+ # Closing bracket or paren for the timestamp\10 |\10 # weechat\10 \\d{4}\\s\\w{3}\\s\\d{2}\\s # Date\10 \\d{2}:\\d{2}:\\d{2}\\s+ # Time + Whitespace\10 |\10 # xchat\10 \\w{3}\\s\\d{2}\\s # Date\10 \\d{2}:\\d{2}:\\d{2}\\s+ # Time + Whitespace\10 )?\10 \10 (\\s*<.*?>\\s*) # Nick " (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Name" :. Arbitrary "Tag")]) (GoTo msg')+ , tok "^\10 (\10 # irssi / xchat and others\10 (?: \\[|\\()? # Opening bracket or paren for the timestamp\10 (?: # Timestamp\10 (?: (?:\\d{1,4} [-/]?)+ # Date as - or /-separated groups of digits\10 [T ])? # Date/time separator: T or space\10 (?: \\d?\\d [:.]?)+ # Time as :/.-separated groups of 1 or 2 digits\10 )\10 (?: \\]|\\))?\\s+ # Closing bracket or paren for the timestamp\10 |\10 # weechat\10 \\d{4}\\s\\w{3}\\s\\d{2}\\s # Date\10 \\d{2}:\\d{2}:\\d{2}\\s+ # Time + Whitespace\10 |\10 # xchat\10 \\w{3}\\s\\d{2}\\s # Date\10 \\d{2}:\\d{2}:\\d{2}\\s+ # Time + Whitespace\10 )?\10 \10 (\\s*[*]\\s+) # Star\10 ([^\\s]+\\s+.*?\\n) # Nick + rest of message " (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Keyword"), (Arbitrary "Generic" :. Arbitrary "Inserted")])+ , tok "^\10 (\10 # irssi / xchat and others\10 (?: \\[|\\()? # Opening bracket or paren for the timestamp\10 (?: # Timestamp\10 (?: (?:\\d{1,4} [-/]?)+ # Date as - or /-separated groups of digits\10 [T ])? # Date/time separator: T or space\10 (?: \\d?\\d [:.]?)+ # Time as :/.-separated groups of 1 or 2 digits\10 )\10 (?: \\]|\\))?\\s+ # Closing bracket or paren for the timestamp\10 |\10 # weechat\10 \\d{4}\\s\\w{3}\\s\\d{2}\\s # Date\10 \\d{2}:\\d{2}:\\d{2}\\s+ # Time + Whitespace\10 |\10 # xchat\10 \\w{3}\\s\\d{2}\\s # Date\10 \\d{2}:\\d{2}:\\d{2}\\s+ # Time + Whitespace\10 )?\10 \10 (\\s*(?:\\*{3}|<?-[!@=P]?->?)\\s*) # Star(s) or symbols\10 ([^\\s]+\\s+) # Nick + Space\10 (.*?\\n) # Rest of message " (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Keyword"), (Arbitrary "Literal" :. Arbitrary "String"), (Arbitrary "Comment")])+ , tok "^.*?\\n" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Java.hs view
@@ -0,0 +1,51 @@+module Text.Highlighter.Lexers.Java (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Java"+ , lAliases = ["java"]+ , lExtensions = [".java"]+ , lMimetypes = ["text/x-java"]+ , lStart = root'+ , lFlags = [multiline, dotall]+ }++import' :: TokenMatcher+import' =+ [ tokNext "[a-zA-Z0-9_.]+\\*?" (Arbitrary "Name" :. Arbitrary "Namespace") Pop+ ]++root' :: TokenMatcher+root' =+ [ tok "^(\\s*(?:[a-zA-Z_][a-zA-Z0-9_\\.\\[\\]]*\\s+)+?)([a-zA-Z_][a-zA-Z0-9_]*)(\\s*)(\\()" (ByGroups [(Using lexer), (Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Operator")])+ , tok "[^\\S\\n]+" (Arbitrary "Text")+ , tok "//.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/\\*.*?\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "@[a-zA-Z_][a-zA-Z0-9_\\.]*" (Arbitrary "Name" :. Arbitrary "Decorator")+ , tok "(assert|break|case|catch|continue|default|do|else|finally|for|if|goto|instanceof|new|return|switch|this|throw|try|while)\\b" (Arbitrary "Keyword")+ , tok "(abstract|const|enum|extends|final|implements|native|private|protected|public|static|strictfp|super|synchronized|throws|transient|volatile)\\b" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , tok "(boolean|byte|char|double|float|int|long|short|void)\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "(package)(\\s+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text")])+ , tok "(true|false|null)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tokNext "(class|interface)(\\s+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Declaration"), (Arbitrary "Text")]) (GoTo class')+ , tokNext "(import)(\\s+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text")]) (GoTo import')+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "'\\\\.'|'[^\\\\]'|'\\\\u[0-9a-f]{4}'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "(\\.)([a-zA-Z_][a-zA-Z0-9_]*)" (ByGroups [(Arbitrary "Operator"), (Arbitrary "Name" :. Arbitrary "Attribute")])+ , tok "[a-zA-Z_][a-zA-Z0-9_]*:" (Arbitrary "Name" :. Arbitrary "Label")+ , tok "[a-zA-Z_\\$][a-zA-Z0-9_]*" (Arbitrary "Name")+ , tok "[\126\\^\\*!%&\\[\\]\\(\\)\\{\\}<>\\|+=:;,./?-]" (Arbitrary "Operator")+ , tok "[0-9][0-9]*\\.[0-9]+([eE][0-9]+)?[fd]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0x[0-9a-f]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "[0-9]+L?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\\n" (Arbitrary "Text")+ ]++class' :: TokenMatcher+class' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Class") Pop+ ]+
+ src/Text/Highlighter/Lexers/Javascript.hs view
@@ -0,0 +1,56 @@+module Text.Highlighter.Lexers.Javascript (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "JavaScript"+ , lAliases = ["js", "javascript"]+ , lExtensions = [".js"]+ , lMimetypes = ["application/javascript", "application/x-javascript", "text/x-javascript", "text/javascript"]+ , lStart = root'+ , lFlags = [dotall]+ }++commentsandwhitespace' :: TokenMatcher+commentsandwhitespace' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "<!--" (Arbitrary "Comment")+ , tok "//.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/\\*.*?\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]++root' :: TokenMatcher+root' =+ [ tokNext "^(?=\\s|/|<!--)" (Arbitrary "Text") (GoTo slashstartsregex')+ , anyOf commentsandwhitespace'+ , tokNext "\\+\\+|--|\126|&&|\\?|:|\\|\\||\\\\(?=\\n)|(<<|>>>?|==?|!=?|[-<>+*%&\\|\\^/])=?" (Arbitrary "Operator") (GoTo slashstartsregex')+ , tokNext "[{(\\[;,]" (Arbitrary "Punctuation") (GoTo slashstartsregex')+ , tok "[})\\].]" (Arbitrary "Punctuation")+ , tokNext "(for|in|while|do|break|return|continue|switch|case|default|if|else|throw|try|catch|finally|new|delete|typeof|instanceof|void|this)\\b" (Arbitrary "Keyword") (GoTo slashstartsregex')+ , tokNext "(var|with|function)\\b" (Arbitrary "Keyword" :. Arbitrary "Declaration") (GoTo slashstartsregex')+ , tok "(abstract|boolean|byte|char|class|const|debugger|double|enum|export|extends|final|float|goto|implements|import|int|interface|long|native|package|private|protected|public|short|static|super|synchronized|throws|transient|volatile)\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "(true|false|null|NaN|Infinity|undefined)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tok "(Array|Boolean|Date|Error|Function|Math|netscape|Number|Object|Packages|RegExp|String|sun|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|Error|eval|isFinite|isNaN|parseFloat|parseInt|document|this|window)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "[$a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Other")+ , tok "[0-9][0-9]*\\.[0-9]+([eE][0-9]+)?[fd]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0x[0-9a-fA-F]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "'(\\\\\\\\|\\\\'|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ ]++slashstartsregex' :: TokenMatcher+slashstartsregex' =+ [ anyOf commentsandwhitespace'+ , tokNext "/(\\\\.|[^[/\\\\\\n]|\\[(\\\\.|[^\\]\\\\\\n])*])+/([gim]+\\b|\\B)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") Pop+ , tokNext "(?=/)" (Arbitrary "Text") (DoAll [Pop, (GoTo badregex')])+ , tokNext "" (Arbitrary "Text") Pop+ ]++badregex' :: TokenMatcher+badregex' =+ [ tokNext "\10" (Arbitrary "Text") Pop+ ]+
+ src/Text/Highlighter/Lexers/LighttpdConf.hs view
@@ -0,0 +1,29 @@+module Text.Highlighter.Lexers.LighttpdConf (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Lighttpd configuration file"+ , lAliases = ["lighty", "lighttpd"]+ , lExtensions = []+ , lMimetypes = ["text/x-lighttpd-conf"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "#.*\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/\\S*" (Arbitrary "Name")+ , tok "[a-zA-Z._-]+" (Arbitrary "Keyword")+ , tok "\\d+\\.\\d+\\.\\d+\\.\\d+(?:/\\d+)?" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "=>|=\126|\\+=|==|=|\\+" (Arbitrary "Operator")+ , tok "\\$[A-Z]+" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "[(){}\\[\\],]" (Arbitrary "Punctuation")+ , tok "\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "\\s+" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Llvm.hs view
@@ -0,0 +1,45 @@+module Text.Highlighter.Lexers.Llvm (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "LLVM"+ , lAliases = ["llvm"]+ , lExtensions = [".ll"]+ , lMimetypes = ["text/x-llvm"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ anyOf whitespace'+ , tok "^\\s*([-a-zA-Z$._][-a-zA-Z$._0-9]*|\"[^\"]*?\")\\s*:" (Arbitrary "Name" :. Arbitrary "Label")+ , anyOf keyword'+ , tok "%([-a-zA-Z$._][-a-zA-Z$._0-9]*|\"[^\"]*?\")" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "@([-a-zA-Z$._][-a-zA-Z$._0-9]*|\"[^\"]*?\")" (Arbitrary "Name" :. Arbitrary "Variable" :. Arbitrary "Global")+ , tok "%\\d+" (Arbitrary "Name" :. Arbitrary "Variable" :. Arbitrary "Anonymous")+ , tok "@\\d+" (Arbitrary "Name" :. Arbitrary "Variable" :. Arbitrary "Global")+ , tok "!([-a-zA-Z$._][-a-zA-Z$._0-9]*|\"[^\"]*?\")" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "!\\d+" (Arbitrary "Name" :. Arbitrary "Variable" :. Arbitrary "Anonymous")+ , tok "c?\"[^\"]*?\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "0[xX][a-fA-F0-9]+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "-?\\d+(?:[.]\\d+)?(?:[eE][-+]?\\d+(?:[.]\\d+)?)?" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "[=<>{}\\[\\]()*.,!]|x\\b" (Arbitrary "Punctuation")+ ]++whitespace' :: TokenMatcher+whitespace' =+ [ tok "(\\n|\\s)+" (Arbitrary "Text")+ , tok ";.*?\\n" (Arbitrary "Comment")+ ]++keyword' :: TokenMatcher+keyword' =+ [ tok "(begin|end|true|false|declare|define|global|constant|private|linker_private|internal|available_externally|linkonce|linkonce_odr|weak|weak_odr|appending|dllimport|dllexport|common|default|hidden|protected|extern_weak|external|thread_local|zeroinitializer|undef|null|to|tail|target|triple|deplibs|datalayout|volatile|nuw|nsw|exact|inbounds|align|addrspace|section|alias|module|asm|sideeffect|gc|dbg|ccc|fastcc|coldcc|x86_stdcallcc|x86_fastcallcc|arm_apcscc|arm_aapcscc|arm_aapcs_vfpcc|cc|c|signext|zeroext|inreg|sret|nounwind|noreturn|noalias|nocapture|byval|nest|readnone|readonly|inlinehint|noinline|alwaysinline|optsize|ssp|sspreq|noredzone|noimplicitfloat|naked|type|opaque|eq|ne|slt|sgt|sle|sge|ult|ugt|ule|uge|oeq|one|olt|ogt|ole|oge|ord|uno|ueq|une|x|add|fadd|sub|fsub|mul|fmul|udiv|sdiv|fdiv|urem|srem|frem|shl|lshr|ashr|and|or|xor|icmp|fcmp|phi|call|trunc|zext|sext|fptrunc|fpext|uitofp|sitofp|fptouifptosi|inttoptr|ptrtoint|bitcast|select|va_arg|ret|br|switch|invoke|unwind|unreachable|malloc|alloca|free|load|store|getelementptr|extractelement|insertelement|shufflevector|getresult|extractvalue|insertvalue)\\b" (Arbitrary "Keyword")+ , tok "void|float|double|x86_fp80|fp128|ppc_fp128|label|metadata" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "i[1-9]\\d*" (Arbitrary "Keyword")+ ]+
+ src/Text/Highlighter/Lexers/Logtalk.hs view
@@ -0,0 +1,141 @@+module Text.Highlighter.Lexers.Logtalk (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Logtalk"+ , lAliases = ["logtalk"]+ , lExtensions = [".lgt"]+ , lMimetypes = ["text/x-logtalk"]+ , lStart = root'+ , lFlags = [multiline]+ }++quoted_atom' :: TokenMatcher+quoted_atom' =+ [ tok "['][']" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "[']" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\([\\\\abfnrtv\"\\']|(x[a-fA-F0-9]+|[0-7]+)\\\\)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "[^\\\\'\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\" (Arbitrary "Literal" :. Arbitrary "String")+ ]++root' :: TokenMatcher+root' =+ [ tokNext "^\\s*:-\\s" (Arbitrary "Punctuation") (GoTo directive')+ , tok "%.*?\\n" (Arbitrary "Comment")+ , tok "/\\*(.|\\n)*?\\*/" (Arbitrary "Comment")+ , tok "\\n" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ , tok "0'." (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "0b[01]+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "0o[0-7]+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "0x[0-9a-fA-F]+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "\\d+\\.?\\d*((e|E)(\\+|-)?\\d+)?" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "([A-Z_][a-zA-Z0-9_]*)" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "(after|before)(?=[(])" (Arbitrary "Keyword")+ , tok "(parameter|this|se(lf|nder))(?=[(])" (Arbitrary "Keyword")+ , tok "(current_predicate|predicate_property)(?=[(])" (Arbitrary "Keyword")+ , tok "(expand_(goal|term)|(goal|term)_expansion|phrase)(?=[(])" (Arbitrary "Keyword")+ , tok "(abolish|c(reate|urrent))_(object|protocol|category)(?=[(])" (Arbitrary "Keyword")+ , tok "(object|protocol|category)_property(?=[(])" (Arbitrary "Keyword")+ , tok "complements_object(?=[(])" (Arbitrary "Keyword")+ , tok "extends_(object|protocol|category)(?=[(])" (Arbitrary "Keyword")+ , tok "imp(lements_protocol|orts_category)(?=[(])" (Arbitrary "Keyword")+ , tok "(instantiat|specializ)es_class(?=[(])" (Arbitrary "Keyword")+ , tok "(current_event|(abolish|define)_events)(?=[(])" (Arbitrary "Keyword")+ , tok "(current|set)_logtalk_flag(?=[(])" (Arbitrary "Keyword")+ , tok "logtalk_(compile|l(ibrary_path|oad))(?=[(])" (Arbitrary "Keyword")+ , tok "(clause|retract(all)?)(?=[(])" (Arbitrary "Keyword")+ , tok "a(bolish|ssert(a|z))(?=[(])" (Arbitrary "Keyword")+ , tok "(ca(ll|tch)|throw)(?=[(])" (Arbitrary "Keyword")+ , tok "(fail|true)\\b" (Arbitrary "Keyword")+ , tok "((bag|set)of|f(ind|or)all)(?=[(])" (Arbitrary "Keyword")+ , tok "threaded(_(call|once|ignore|exit|peek|wait|notify))?(?=[(])" (Arbitrary "Keyword")+ , tok "unify_with_occurs_check(?=[(])" (Arbitrary "Keyword")+ , tok "(functor|arg|copy_term)(?=[(])" (Arbitrary "Keyword")+ , tok "(rem|mod|abs|sign)(?=[(])" (Arbitrary "Keyword")+ , tok "float(_(integer|fractional)_part)?(?=[(])" (Arbitrary "Keyword")+ , tok "(floor|truncate|round|ceiling)(?=[(])" (Arbitrary "Keyword")+ , tok "(cos|atan|exp|log|s(in|qrt))(?=[(])" (Arbitrary "Keyword")+ , tok "(var|atom(ic)?|integer|float|compound|n(onvar|umber))(?=[(])" (Arbitrary "Keyword")+ , tok "(curren|se)t_(in|out)put(?=[(])" (Arbitrary "Keyword")+ , tok "(open|close)(?=[(])" (Arbitrary "Keyword")+ , tok "flush_output(?=[(])" (Arbitrary "Keyword")+ , tok "(at_end_of_stream|flush_output)\\b" (Arbitrary "Keyword")+ , tok "(stream_property|at_end_of_stream|set_stream_position)(?=[(])" (Arbitrary "Keyword")+ , tok "(nl|(get|peek|put)_(byte|c(har|ode)))(?=[(])" (Arbitrary "Keyword")+ , tok "\\bnl\\b" (Arbitrary "Keyword")+ , tok "read(_term)?(?=[(])" (Arbitrary "Keyword")+ , tok "write(q|_(canonical|term))?(?=[(])" (Arbitrary "Keyword")+ , tok "(current_)?op(?=[(])" (Arbitrary "Keyword")+ , tok "(current_)?char_conversion(?=[(])" (Arbitrary "Keyword")+ , tok "atom_(length|c(hars|o(ncat|des)))(?=[(])" (Arbitrary "Keyword")+ , tok "(char_code|sub_atom)(?=[(])" (Arbitrary "Keyword")+ , tok "number_c(har|ode)s(?=[(])" (Arbitrary "Keyword")+ , tok "(se|curren)t_prolog_flag(?=[(])" (Arbitrary "Keyword")+ , tok "\\bhalt\\b" (Arbitrary "Keyword")+ , tok "halt(?=[(])" (Arbitrary "Keyword")+ , tok "(::|:|\\^\\^)" (Arbitrary "Operator")+ , tok "[{}]" (Arbitrary "Keyword")+ , tok "\\bonce(?=[(])" (Arbitrary "Keyword")+ , tok "\\brepeat\\b" (Arbitrary "Keyword")+ , tok "(>>|<<|/\\\\|\\\\\\\\|\\\\)" (Arbitrary "Operator")+ , tok "\\bis\\b" (Arbitrary "Keyword")+ , tok "(=:=|=\\\\=|<|=<|>=|>)" (Arbitrary "Operator")+ , tok "=\\.\\." (Arbitrary "Operator")+ , tok "(=|\\\\=)" (Arbitrary "Operator")+ , tok "(==|\\\\==|@=<|@<|@>=|@>)" (Arbitrary "Operator")+ , tok "(//|[-+*/])" (Arbitrary "Operator")+ , tok "\\b(mod|rem)\\b" (Arbitrary "Operator")+ , tok "\\b\\*\\*\\b" (Arbitrary "Operator")+ , tok "-->" (Arbitrary "Operator")+ , tok "([!;]|->)" (Arbitrary "Operator")+ , tok "\\\\+" (Arbitrary "Operator")+ , tok "[?@]" (Arbitrary "Operator")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "[()\\[\\],.|]" (Arbitrary "Text")+ , tok "[a-z][a-zA-Z0-9_]*" (Arbitrary "Text")+ , tokNext "[']" (Arbitrary "Literal" :. Arbitrary "String") (GoTo quoted_atom')+ ]++directive' :: TokenMatcher+directive' =+ [ tokNext "(el)?if(?=[(])" (Arbitrary "Keyword") (GoTo root')+ , tokNext "(e(lse|ndif))[.]" (Arbitrary "Keyword") (GoTo root')+ , tokNext "(category|object|protocol)(?=[(])" (Arbitrary "Keyword") (GoTo entityrelations')+ , tokNext "(end_(category|object|protocol))[.]" (Arbitrary "Keyword") (GoTo root')+ , tokNext "(public|protected|private)(?=[(])" (Arbitrary "Keyword") (GoTo root')+ , tokNext "e(n(coding|sure_loaded)|xport)(?=[(])" (Arbitrary "Keyword") (GoTo root')+ , tokNext "in(fo|itialization)(?=[(])" (Arbitrary "Keyword") (GoTo root')+ , tokNext "(dynamic|synchronized|threaded)[.]" (Arbitrary "Keyword") (GoTo root')+ , tokNext "(alias|d(ynamic|iscontiguous)|m(eta_predicate|ode|ultifile)|s(et_(logtalk|prolog)_flag|ynchronized))(?=[(])" (Arbitrary "Keyword") (GoTo root')+ , tokNext "op(?=[(])" (Arbitrary "Keyword") (GoTo root')+ , tokNext "(calls|reexport|use(s|_module))(?=[(])" (Arbitrary "Keyword") (GoTo root')+ , tokNext "[a-z][a-zA-Z0-9_]*(?=[(])" (Arbitrary "Text") (GoTo root')+ , tokNext "[a-z][a-zA-Z0-9_]*[.]" (Arbitrary "Text") (GoTo root')+ ]++entityrelations' :: TokenMatcher+entityrelations' =+ [ tok "(extends|i(nstantiates|mp(lements|orts))|specializes)(?=[(])" (Arbitrary "Keyword")+ , tok "0'." (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "0b[01]+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "0o[0-7]+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "0x[0-9a-fA-F]+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "\\d+\\.?\\d*((e|E)(\\+|-)?\\d+)?" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "([A-Z_][a-zA-Z0-9_]*)" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "[a-z][a-zA-Z0-9_]*" (Arbitrary "Text")+ , tokNext "[']" (Arbitrary "Literal" :. Arbitrary "String") (GoTo quoted_atom')+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "([)]\\.)" (Arbitrary "Text") (GoTo root')+ , tok "(::)" (Arbitrary "Operator")+ , tok "[()\\[\\],.|]" (Arbitrary "Text")+ , tok "%.*?\\n" (Arbitrary "Comment")+ , tok "/\\*(.|\\n)*?\\*/" (Arbitrary "Comment")+ , tok "\\n" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Lua.hs view
@@ -0,0 +1,78 @@+module Text.Highlighter.Lexers.Lua (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Lua"+ , lAliases = ["lua"]+ , lExtensions = [".lua", ".wlua"]+ , lMimetypes = ["text/x-lua", "application/x-lua"]+ , lStart = root'+ , lFlags = [multiline]+ }++classname' :: TokenMatcher+classname' =+ [ tokNext "[A-Za-z_][A-Za-z0-9_]*" (Arbitrary "Name" :. Arbitrary "Class") Pop+ ]++stringescape' :: TokenMatcher+stringescape' =+ [ tok "\\\\([abfnrtv\\\\\"']|\\d{1,3})" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ ]++base' :: TokenMatcher+base' =+ [ tok "(?s)--\\[(=*)\\[.*?\\]\\1\\]" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "--.*$" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "(?i)(\\d*\\.\\d+|\\d+\\.\\d*)(e[+-]?\\d+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "(?i)\\d+e[+-]?\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "(?i)0x[0-9a-f]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\\n" (Arbitrary "Text")+ , tok "[^\\S\\n]" (Arbitrary "Text")+ , tok "(?s)\\[(=*)\\[.*?\\]\\1\\]" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "(==|\126=|<=|>=|\\.\\.|\\.\\.\\.|[=+\\-*/%^<>#])" (Arbitrary "Operator")+ , tok "[\\[\\]\\{\\}\\(\\)\\.,:;]" (Arbitrary "Punctuation")+ , tok "(and|or|not)\\b" (Arbitrary "Operator" :. Arbitrary "Word")+ , tok "(break|do|else|elseif|end|for|if|in|repeat|return|then|until|while)\\b" (Arbitrary "Keyword")+ , tok "(local)\\b" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , tok "(true|false|nil)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tokNext "(function)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo funcname')+ , tokNext "(class)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo classname')+ , tok "[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)?" (Arbitrary "Name")+ , tokNext "'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single") (Combined [stringescape', sqs'])+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") (Combined [stringescape', dqs'])+ ]++string' :: TokenMatcher+string' =+ [ tok "." (Arbitrary "Literal" :. Arbitrary "String")+ ]++dqs' :: TokenMatcher+dqs' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , anyOf string'+ ]++sqs' :: TokenMatcher+sqs' =+ [ tokNext "'" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , anyOf string'+ ]++root' :: TokenMatcher+root' =+ [ tok "#!(.*?)$" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tokNext "" (Arbitrary "Text") (GoTo base')+ ]++funcname' :: TokenMatcher+funcname' =+ [ tokNext "(?:([A-Za-z_][A-Za-z0-9_]*)(\\.))?([A-Za-z_][A-Za-z0-9_]*)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Punctuation"), (Arbitrary "Name" :. Arbitrary "Function")]) Pop+ , tokNext "\\(" (Arbitrary "Punctuation") Pop+ ]+
+ src/Text/Highlighter/Lexers/MOOCode.hs view
@@ -0,0 +1,31 @@+module Text.Highlighter.Lexers.MOOCode (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "MOOCode"+ , lAliases = ["moocode"]+ , lExtensions = [".moo"]+ , lMimetypes = ["text/x-moocode"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "(0|[1-9][0-9_]*)" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "(E_PERM|E_DIV)" (Arbitrary "Name" :. Arbitrary "Exception")+ , tok "((#[-0-9]+)|(\\$[a-z_A-Z0-9]+))" (Arbitrary "Name" :. Arbitrary "Entity")+ , tok "\\b(if|else|elseif|endif|for|endfor|fork|endfork|while|endwhile|break|continue|return|try|except|endtry|finally|in)\\b" (Arbitrary "Keyword")+ , tok "(random|length)" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(player|caller|this|args)" (Arbitrary "Name" :. Arbitrary "Variable" :. Arbitrary "Instance")+ , tok "\\s+" (Arbitrary "Text")+ , tok "\\n" (Arbitrary "Text")+ , tok "([!;=,{}&\\|:\\.\\[\\]@\\(\\)\\<\\>\\?]+)" (Arbitrary "Operator")+ , tok "([a-z_A-Z0-9]+)(\\()" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Operator")])+ , tok "([a-zA-Z_0-9]+)" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Mako.hs view
@@ -0,0 +1,53 @@+module Text.Highlighter.Lexers.Mako (lexer) where+import qualified Text.Highlighter.Lexers.Python as Python+import qualified Text.Highlighter.Lexers.Python as Python+import qualified Text.Highlighter.Lexers.Python as Python+import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Mako"+ , lAliases = ["mako"]+ , lExtensions = [".mao"]+ , lMimetypes = ["application/x-mako"]+ , lStart = root'+ , lFlags = [multiline]+ }++ondeftags' :: TokenMatcher+ondeftags' =+ [ tok "<%" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "(?<=<%)(include|inherit|namespace|page)" (Arbitrary "Name" :. Arbitrary "Builtin")+ , anyOf tag'+ ]++tag' :: TokenMatcher+tag' =+ [ tok "((?:\\w+)\\s*=)\\s*(\".*?\")" (ByGroups [(Arbitrary "Name" :. Arbitrary "Attribute"), (Arbitrary "Literal" :. Arbitrary "String")])+ , tokNext "/?\\s*>" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ , tok "\\s+" (Arbitrary "Text")+ ]++root' :: TokenMatcher+root' =+ [ tok "(\\s*)(%)(\\s*end(?:\\w+))(\\n|\\Z)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Keyword"), (Arbitrary "Other")])+ , tok "(\\s*)(%)([^\\n]*)(\\n|\\Z)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Comment" :. Arbitrary "Preproc"), (Using Python.lexer), (Arbitrary "Other")])+ , tok "(\\s*)(##[^\\n]*)(\\n|\\Z)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Other")])+ , tok "(?s)<%doc>.*?</%doc>" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tokNext "(<%)([\\w\\.\\:]+)" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Name" :. Arbitrary "Builtin")]) (GoTo tag')+ , tok "(</%)([\\w\\.\\:]+)(>)" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Name" :. Arbitrary "Builtin"), (Arbitrary "Comment" :. Arbitrary "Preproc")])+ , tokNext "<%(?=([\\w\\.\\:]+))" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo ondeftags')+ , tok "(<%(?:!?))(.*?)(%>)(?s)" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Using Python.lexer), (Arbitrary "Comment" :. Arbitrary "Preproc")])+ , tok "(\\$\\{)(.*?)(\\})" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Using Python.lexer), (Arbitrary "Comment" :. Arbitrary "Preproc")])+ , tok "(?sx)\10 (.+?) # anything, followed by:\10 (?:\10 (?<=\\n)(?=%|\\#\\#) | # an eval or comment line\10 (?=\\#\\*) | # multiline comment\10 (?=</?%) | # a python block\10 # call start or end\10 (?=\\$\\{) | # a substitution\10 (?<=\\n)(?=\\s*%) |\10 # - don't consume\10 (\\\\\\n) | # an escaped newline\10 \\Z # end of string\10 )\10 " (ByGroups [(Arbitrary "Other"), (Arbitrary "Operator")])+ , tok "\\s+" (Arbitrary "Text")+ ]++attr' :: TokenMatcher+attr' =+ [ tokNext "\".*?\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tokNext "'.*?'" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tokNext "[^\\s>]+" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]+
+ src/Text/Highlighter/Lexers/Maql.hs view
@@ -0,0 +1,39 @@+module Text.Highlighter.Lexers.Maql (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "MAQL"+ , lAliases = ["maql"]+ , lExtensions = [".maql"]+ , lMimetypes = ["text/x-gooddata-maql", "application/x-gooddata-maql"]+ , lStart = root'+ , lFlags = [caseless]+ }++root' :: TokenMatcher+root' =+ [ tok "IDENTIFIER\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "\\{[^}]+\\}" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "[0-9]+(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]{1,3})?" (Arbitrary "Literal" :. Arbitrary "Number")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo stringLiteral')+ , tok "\\<\\>|\\!\\=" (Arbitrary "Operator")+ , tok "\\=|\\>\\=|\\>|\\<\\=|\\<" (Arbitrary "Operator")+ , tok "\\:\\=" (Arbitrary "Operator")+ , tok "\\[[^]]+\\]" (Arbitrary "Name" :. Arbitrary "Variable" :. Arbitrary "Class")+ , tok "(DIMENSIONS?|BOTTOM|METRIC|COUNT|OTHER|FACT|WITH|TOP|OR|ATTRIBUTE|CREATE|PARENT|FALSE|ROWS?|FROM|ALL|AS|PF|COLUMNS?|DEFINE|REPORT|LIMIT|TABLE|LIKE|AND|BY|BETWEEN|EXCEPT|SELECT|MATCH|WHERE|TRUE|FOR|IN|WITHOUT|FILTER|ALIAS|ORDER|FACT|WHEN|NOT|ON|KEYS|KEY|FULLSET|PRIMARY|LABELS|LABEL|VISUAL|TITLE|DESCRIPTION|FOLDER|ALTER|DROP|ADD|DATASET|DATATYPE|INT|BIGINT|DOUBLE|DATE|VARCHAR|DECIMAL|SYNCHRONIZE|TYPE|DEFAULT|ORDER|ASC|DESC|HYPERLINK|INCLUDE|TEMPLATE|MODIFY)\\b" (Arbitrary "Keyword")+ , tok "[a-zA-Z]\\w*\\b" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "#.*" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "[,;\\(\\)]" (Arbitrary "Punctuation")+ , tok "\\s+" (Arbitrary "Text")+ ]++stringLiteral' :: TokenMatcher+stringLiteral' =+ [ tok "\\\\[tnrfbae\"\\\\]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "[^\\\\\"]+" (Arbitrary "Literal" :. Arbitrary "String")+ ]+
+ src/Text/Highlighter/Lexers/Matlab.hs view
@@ -0,0 +1,42 @@+module Text.Highlighter.Lexers.Matlab (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Matlab"+ , lAliases = ["matlab", "octave"]+ , lExtensions = [".m"]+ , lMimetypes = ["text/matlab"]+ , lStart = root'+ , lFlags = [multiline]+ }++deffunc' :: TokenMatcher+deffunc' =+ [ tokNext "(\\s*)(?:(.+)(\\s*)(=)(\\s*))?(.+)(\\()(.*)(\\))(\\s*)" (ByGroups [(Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Text"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Punctuation"), (Arbitrary "Text" :. Arbitrary "Whitespace"), (Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Punctuation"), (Arbitrary "Text"), (Arbitrary "Punctuation"), (Arbitrary "Text" :. Arbitrary "Whitespace")]) Pop+ ]++root' :: TokenMatcher+root' =+ [ tok "^!.*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ , tok "%.*$" (Arbitrary "Comment")+ , tokNext "^\\s*function" (Arbitrary "Keyword") (GoTo deffunc')+ , tok "(break|case|catch|classdef|continue|else|elseif|end|enumerated|events|for|function|global|if|methods|otherwise|parfor|persistent|properties|return|spmd|switch|try|while)\\b" (Arbitrary "Keyword")+ , tok "(sin|sind|sinh|asin|asind|asinh|cos|cosd|cosh|acos|acosd|acosh|tan|tand|tanh|atan|atand|atan2|atanh|sec|secd|sech|asec|asecd|asech|csc|cscd|csch|acsc|acscd|acsch|cot|cotd|coth|acot|acotd|acoth|hypot|exp|expm1|log|log1p|log10|log2|pow2|realpow|reallog|realsqrt|sqrt|nthroot|nextpow2|abs|angle|complex|conj|imag|real|unwrap|isreal|cplxpair|fix|floor|ceil|round|mod|rem|sign|airy|besselj|bessely|besselh|besseli|besselk|beta|betainc|betaln|ellipj|ellipke|erf|erfc|erfcx|erfinv|expint|gamma|gammainc|gammaln|psi|legendre|cross|dot|factor|isprime|primes|gcd|lcm|rat|rats|perms|nchoosek|factorial|cart2sph|cart2pol|pol2cart|sph2cart|hsv2rgb|rgb2hsv|zeros|ones|eye|repmat|rand|randn|linspace|logspace|freqspace|meshgrid|accumarray|size|length|ndims|numel|disp|isempty|isequal|isequalwithequalnans|cat|reshape|diag|blkdiag|tril|triu|fliplr|flipud|flipdim|rot90|find|end|sub2ind|ind2sub|bsxfun|ndgrid|permute|ipermute|shiftdim|circshift|squeeze|isscalar|isvector|ans|eps|realmax|realmin|pi|i|inf|nan|isnan|isinf|isfinite|j|why|compan|gallery|hadamard|hankel|hilb|invhilb|magic|pascal|rosser|toeplitz|vander|wilkinson)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "-|==|\126=|<|>|<=|>=|&&|&|\126|\\|\\|?" (Arbitrary "Operator")+ , tok "\\.\\*|\\*|\\+|\\.\\^|\\.\\\\|\\.\\/|\\/|\\\\" (Arbitrary "Operator")+ , tok "\\[|\\]|\\(|\\)|\\{|\\}|:|@|\\.|," (Arbitrary "Punctuation")+ , tok "=|:|;" (Arbitrary "Punctuation")+ , tok "(?<=[\\w\\)\\]])\\'" (Arbitrary "Operator")+ , tokNext "(?<![\\w\\)\\]])\\'" (Arbitrary "Literal" :. Arbitrary "String") (GoTo string')+ , tok "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name")+ , tok "." (Arbitrary "Text")+ ]++string' :: TokenMatcher+string' =+ [ tokNext "[^\\']*\\'" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]+
+ src/Text/Highlighter/Lexers/MiniD.hs view
@@ -0,0 +1,45 @@+module Text.Highlighter.Lexers.MiniD (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "MiniD"+ , lAliases = ["minid"]+ , lExtensions = [".md"]+ , lMimetypes = ["text/x-minidsrc"]+ , lStart = root'+ , lFlags = [multiline]+ }++nestedcomment' :: TokenMatcher+nestedcomment' =+ [ tok "[^+/]+" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "/\\+" (Arbitrary "Comment" :. Arbitrary "Multiline") Push+ , tokNext "\\+/" (Arbitrary "Comment" :. Arbitrary "Multiline") Pop+ , tok "[+/]" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]++root' :: TokenMatcher+root' =+ [ tok "\\n" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ , tok "//(.*?)\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/(\\\\\\n)?[*](.|\\n)*?[*](\\\\\\n)?/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "/\\+" (Arbitrary "Comment" :. Arbitrary "Multiline") (GoTo nestedcomment')+ , tok "(as|assert|break|case|catch|class|continue|coroutine|default|do|else|finally|for|foreach|function|global|namespace|if|import|in|is|local|module|return|super|switch|this|throw|try|vararg|while|with|yield)\\b" (Arbitrary "Keyword")+ , tok "(false|true|null)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tok "([0-9][0-9_]*)?\\.[0-9_]+([eE][+\\-]?[0-9_]+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0[Bb][01_]+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "0[Cc][0-7_]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "0[xX][0-9a-fA-F_]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "(0|[1-9][0-9_]*)" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "'(\\\\['\"?\\\\abfnrtv]|\\\\x[0-9a-fA-F]{2}|\\\\[0-9]{1,3}|\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}|.)'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "@\"(\"\"|.)*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "`(``|.)*`" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "(\126=|\\^=|%=|\\*=|==|!=|>>>=|>>>|>>=|>>|>=|<=>|\\?=|-\\>|<<=|<<|<=|\\+\\+|\\+=|--|-=|\\|\\||\\|=|&&|&=|\\.\\.|/=)|[-/.&$@|\\+<>!()\\[\\]{}?,;:=*%^\126#\\\\]" (Arbitrary "Punctuation")+ , tok "[a-zA-Z_]\\w*" (Arbitrary "Name")+ ]+
+ src/Text/Highlighter/Lexers/Modelica.hs view
@@ -0,0 +1,83 @@+module Text.Highlighter.Lexers.Modelica (lexer) where+import qualified Text.Highlighter.Lexers.Html as Html+import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Modelica"+ , lAliases = ["modelica"]+ , lExtensions = [".mo"]+ , lMimetypes = ["text/x-modelica"]+ , lStart = root'+ , lFlags = [caseless, dotall]+ }++functions' :: TokenMatcher+functions' =+ [ tok "(abs|acos|acosh|asin|asinh|atan|atan2|atan3|ceil|cos|cosh|cross|div|exp|floor|log|log10|mod|rem|sign|sin|sinh|size|sqrt|tan|tanh|zeros)\\b" (Arbitrary "Name" :. Arbitrary "Function")+ ]++classes' :: TokenMatcher+classes' =+ [ tok "(block|class|connector|function|model|package|record|type)\\b" (Arbitrary "Name" :. Arbitrary "Class")+ ]++statements' :: TokenMatcher+statements' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo string')+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+|\\d.)[eE][+-]?\\d+[lL]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "(\\d+\\.\\d*|\\.\\d+)" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "\\d+[Ll]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "[\126!%^&*+=|?:<>/-]" (Arbitrary "Operator")+ , tok "[()\\[\\]{},.;]" (Arbitrary "Punctuation")+ , tok "(true|false|NULL|Real|Integer|Boolean)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "([a-zA-Z_][\\w]*|'[a-zA-Z_\\+\\-\\*\\/\\^][\\w]*')(\\.([a-zA-Z_][\\w]*|'[a-zA-Z_\\+\\-\\*\\/\\^][\\w]*'))+" (Arbitrary "Name" :. Arbitrary "Class")+ , tok "('[\\w\\+\\-\\*\\/\\^]+'|\\w+)" (Arbitrary "Name")+ ]++whitespace' :: TokenMatcher+whitespace' =+ [ tok "\\n" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ , tok "\\\\\\n" (Arbitrary "Text")+ , tok "//(\\n|(.|\\n)*?[^\\\\]\\n)" (Arbitrary "Comment")+ , tok "/(\\\\\\n)?[*](.|\\n)*?[*](\\\\\\n)?/" (Arbitrary "Comment")+ ]++htmlContent' :: TokenMatcher+htmlContent' =+ [ tokNext "<\\s*/\\s*html\\s*>" (Arbitrary "Name" :. Arbitrary "Tag") Pop+ , tok ".+?(?=<\\s*/\\s*html\\s*>)" (Using Html.lexer)+ ]++keywords' :: TokenMatcher+keywords' =+ [ tok "(algorithm|annotation|break|connect|constant|constrainedby|discrete|each|else|elseif|elsewhen|encapsulated|enumeration|end|equation|exit|expandable|extends|external|false|final|flow|for|if|import|in|inner|input|loop|nondiscrete|outer|output|parameter|partial|protected|public|redeclare|replaceable|stream|time|then|true|when|while|within)\\b" (Arbitrary "Keyword")+ ]++operators' :: TokenMatcher+operators' =+ [ tok "(and|assert|cardinality|change|delay|der|edge|initial|noEvent|not|or|pre|reinit|return|sample|smooth|terminal|terminate)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ ]++root' :: TokenMatcher+root' =+ [ anyOf whitespace'+ , anyOf keywords'+ , anyOf functions'+ , anyOf operators'+ , anyOf classes'+ , tokNext "(\"<html>|<html>)" (Arbitrary "Name" :. Arbitrary "Tag") (GoTo htmlContent')+ , anyOf statements'+ ]++string' :: TokenMatcher+string' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\([\\\\abfnrtv\"\\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "[^\\\\\"\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\" (Arbitrary "Literal" :. Arbitrary "String")+ ]+
+ src/Text/Highlighter/Lexers/Modula2.hs view
@@ -0,0 +1,84 @@+module Text.Highlighter.Lexers.Modula2 (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Modula-2"+ , lAliases = ["modula2", "m2"]+ , lExtensions = [".def", ".mod"]+ , lMimetypes = ["text/x-modula2"]+ , lStart = root'+ , lFlags = [multiline, dotall]+ }++punctuation' :: TokenMatcher+punctuation' =+ [ tok "[\\(\\)\\[\\]{},.:;|]" (Arbitrary "Punctuation")+ ]++pragmas' :: TokenMatcher+pragmas' =+ [ tok "\\(\\*\\$(.*?)\\*\\)" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "<\\*(.*?)\\*>" (Arbitrary "Comment" :. Arbitrary "Preproc")+ ]++whitespace' :: TokenMatcher+whitespace' =+ [ tok "\\n+" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ ]++numliterals' :: TokenMatcher+numliterals' =+ [ tok "[01]+B" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Binary")+ , tok "[0-7]+B" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "[0-7]+C" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "[0-9A-F]+C" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "[0-9A-F]+H" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "[0-9]+\\.[0-9]+E[+-][0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "[0-9]+\\.[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ ]++operators' :: TokenMatcher+operators' =+ [ tok "[*/+=#\126&<>\\^-]" (Arbitrary "Operator")+ , tok ":=" (Arbitrary "Operator")+ , tok "@" (Arbitrary "Operator")+ , tok "\\.\\." (Arbitrary "Operator")+ , tok "`" (Arbitrary "Operator")+ , tok "::" (Arbitrary "Operator")+ ]++identifiers' :: TokenMatcher+identifiers' =+ [ tok "([a-zA-Z_\\$][a-zA-Z0-9_\\$]*)" (Arbitrary "Name")+ ]++root' :: TokenMatcher+root' =+ [ anyOf whitespace'+ , anyOf comments'+ , anyOf pragmas'+ , anyOf identifiers'+ , anyOf numliterals'+ , anyOf strings'+ , anyOf operators'+ , anyOf punctuation'+ ]++strings' :: TokenMatcher+strings' =+ [ tok "'(\\\\\\\\|\\\\'|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ ]++comments' :: TokenMatcher+comments' =+ [ tok "//.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/\\*(.*?)\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "\\(\\*([^\\$].*?)\\*\\)" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]+
+ src/Text/Highlighter/Lexers/MoinWiki.hs view
@@ -0,0 +1,40 @@+module Text.Highlighter.Lexers.MoinWiki (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "MoinMoin/Trac Wiki markup"+ , lAliases = ["trac-wiki", "moin"]+ , lExtensions = []+ , lMimetypes = ["text/x-trac-wiki"]+ , lStart = root'+ , lFlags = [caseless, multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "^#.*$" (Arbitrary "Comment")+ , tok "(!)(\\S+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")])+ , tok "^(=+)([^=]+)(=+)(\\s*#.+)?$" (ByGroups [(Arbitrary "Generic" :. Arbitrary "Heading"), (Using lexer), (Arbitrary "Generic" :. Arbitrary "Heading"), (Arbitrary "Literal" :. Arbitrary "String")])+ , tokNext "({{{)(\\n#!.+)?" (ByGroups [(Arbitrary "Name" :. Arbitrary "Builtin"), (Arbitrary "Name" :. Arbitrary "Namespace")]) (GoTo codeblock')+ , tok "(\\'\\'\\'?|\\|\\||`|__|\126\126|\\^|,,|::)" (Arbitrary "Comment")+ , tok "^( +)([.*-])( )" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Builtin"), (Arbitrary "Text")])+ , tok "^( +)([a-zivx]{1,5}\\.)( )" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Builtin"), (Arbitrary "Text")])+ , tok "\\[\\[\\w+.*?\\]\\]" (Arbitrary "Keyword")+ , tok "(\\[[^\\s\\]]+)(\\s+[^\\]]+?)?(\\])" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Literal" :. Arbitrary "String"), (Arbitrary "Keyword")])+ , tok "^----+$" (Arbitrary "Keyword")+ , tok "[^\\n\\'\\[{!_\126^,|]+" (Arbitrary "Text")+ , tok "\\n" (Arbitrary "Text")+ , tok "." (Arbitrary "Text")+ ]++codeblock' :: TokenMatcher+codeblock' =+ [ tokNext "}}}" (Arbitrary "Name" :. Arbitrary "Builtin") Pop+ , tokNext "{{{" (Arbitrary "Text") Push+ , tok "[^{}]+" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "." (Arbitrary "Comment" :. Arbitrary "Preproc")+ ]+
+ src/Text/Highlighter/Lexers/MuPAD.hs view
@@ -0,0 +1,43 @@+module Text.Highlighter.Lexers.MuPAD (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "MuPAD"+ , lAliases = ["mupad"]+ , lExtensions = [".mu"]+ , lMimetypes = []+ , lStart = root'+ , lFlags = [multiline]+ }++comment' :: TokenMatcher+comment' =+ [ tok "[^*/]" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "/\\*" (Arbitrary "Comment" :. Arbitrary "Multiline") Push+ , tokNext "\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline") Pop+ , tok "[*/]" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]++root' :: TokenMatcher+root' =+ [ tok "//.*?$" (Arbitrary "Comment" :. Arbitrary "Single")+ , tokNext "/\\*" (Arbitrary "Comment" :. Arbitrary "Multiline") (GoTo comment')+ , tok "\"(?:[^\"\\\\]|\\\\.)*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\(|\\)|\\[|\\]|\\{|\\}" (Arbitrary "Punctuation")+ , tok "(?x)\\b(?:\10 next|break|end|\10 axiom|end_axiom|category|end_category|domain|end_domain|inherits|\10 if|%if|then|elif|else|end_if|\10 case|of|do|otherwise|end_case|\10 while|end_while|\10 repeat|until|end_repeat|\10 for|from|to|downto|step|end_for|\10 proc|local|option|save|begin|end_proc|\10 delete|frame\10 )\\b" (Arbitrary "Keyword")+ , tok "(?x)\\b(?:\10 DOM_ARRAY|DOM_BOOL|DOM_COMPLEX|DOM_DOMAIN|DOM_EXEC|DOM_EXPR|\10 DOM_FAIL|DOM_FLOAT|DOM_FRAME|DOM_FUNC_ENV|DOM_HFARRAY|DOM_IDENT|\10 DOM_INT|DOM_INTERVAL|DOM_LIST|DOM_NIL|DOM_NULL|DOM_POLY|DOM_PROC|\10 DOM_PROC_ENV|DOM_RAT|DOM_SET|DOM_STRING|DOM_TABLE|DOM_VAR\10 )\\b" (Arbitrary "Name" :. Arbitrary "Class")+ , tok "(?x)\\b(?:\10 PI|EULER|E|CATALAN|\10 NIL|FAIL|undefined|infinity|\10 TRUE|FALSE|UNKNOWN\10 )\\b" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "\\b(?:dom|procname)\\b" (Arbitrary "Name" :. Arbitrary "Builtin" :. Arbitrary "Pseudo")+ , tok "\\.|,|:|;|=|\\+|-|\\*|/|\\^|@|>|<|\\$|\\||!|\\'|%|\126=" (Arbitrary "Operator")+ , tok "(?x)\\b(?:\10 and|or|not|xor|\10 assuming|\10 div|mod|\10 union|minus|intersect|in|subset\10 )\\b" (Arbitrary "Operator" :. Arbitrary "Word")+ , tok "\\b(?:I|RDN_INF|RD_NINF|RD_NAN)\\b" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "(?x)\10 ((?:[a-zA-Z_#][a-zA-Z_#0-9]*|`[^`]*`)\10 (?:::[a-zA-Z_#][a-zA-Z_#0-9]*|`[^`]*`)*)\\s*([(])" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Punctuation")])+ , tok "(?x)\10 (?:[a-zA-Z_#][a-zA-Z_#0-9]*|`[^`]*`)\10 (?:::[a-zA-Z_#][a-zA-Z_#0-9]*|`[^`]*`)*" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "[0-9]+(?:\\.[0-9]*)?(?:e[0-9]+)?" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "\\.[0-9]+(?:e[0-9]+)?" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "." (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Mxml.hs view
@@ -0,0 +1,49 @@+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 "<!--" (Arbitrary "Comment") (GoTo comment')+ , tok "<\\?.*?\\?>" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "<![^>]*>" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tokNext "<\\s*[a-zA-Z0-9:._-]+" (Arbitrary "Name" :. Arbitrary "Tag") (GoTo tag')+ , tok "<\\s*/\\s*[a-zA-Z0-9:._-]+\\s*>" (Arbitrary "Name" :. Arbitrary "Tag")+ ]++attr' :: TokenMatcher+attr' =+ [ tok "\\s+" (Arbitrary "Text")+ , tokNext "\".*?\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tokNext "'.*?'" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tokNext "[^\\s>]+" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]+
+ src/Text/Highlighter/Lexers/MySql.hs view
@@ -0,0 +1,44 @@+module Text.Highlighter.Lexers.MySql (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "MySQL"+ , lAliases = ["mysql"]+ , lExtensions = []+ , lMimetypes = ["text/x-mysql"]+ , lStart = root'+ , lFlags = [caseless]+ }++multilineComments' :: TokenMatcher+multilineComments' =+ [ tokNext "/\\*" (Arbitrary "Comment" :. Arbitrary "Multiline") (GoTo multilineComments')+ , tokNext "\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline") Pop+ , tok "[^/\\*]+" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "[/*]" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]++root' :: TokenMatcher+root' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "(#|--\\s+).*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tokNext "/\\*" (Arbitrary "Comment" :. Arbitrary "Multiline") (GoTo multilineComments')+ , tok "[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "[0-9]*\\.[0-9]+(e[+-][0-9]+)" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "'(''|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "\"(\"\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "`(``|[^`])*`" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol")+ , tok "[+*/<>=\126!@#%^&|`?^-]" (Arbitrary "Operator")+ , tok "\\b(tinyint|smallint|mediumint|int|integer|bigint|date|datetime|time|bit|bool|tinytext|mediumtext|longtext|text|tinyblob|mediumblob|longblob|blob|float|double|double\\s+precision|real|numeric|dec|decimal|timestamp|year|char|varchar|varbinary|varcharacter|enum|set)(\\b\\s*)(\\()?" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Type"), (Arbitrary "Text"), (Arbitrary "Punctuation")])+ , tok "\\b(add|all|alter|analyze|and|as|asc|asensitive|before|between|bigint|binary|blob|both|by|call|cascade|case|change|char|character|check|collate|column|condition|constraint|continue|convert|create|cross|current_date|current_time|current_timestamp|current_user|cursor|database|databases|day_hour|day_microsecond|day_minute|day_second|dec|decimal|declare|default|delayed|delete|desc|describe|deterministic|distinct|distinctrow|div|double|drop|dual|each|else|elseif|enclosed|escaped|exists|exit|explain|fetch|float|float4|float8|for|force|foreign|from|fulltext|grant|group|having|high_priority|hour_microsecond|hour_minute|hour_second|if|ignore|in|index|infile|inner|inout|insensitive|insert|int|int1|int2|int3|int4|int8|integer|interval|into|is|iterate|join|key|keys|kill|leading|leave|left|like|limit|lines|load|localtime|localtimestamp|lock|long|loop|low_priority|match|minute_microsecond|minute_second|mod|modifies|natural|no_write_to_binlog|not|numeric|on|optimize|option|optionally|or|order|out|outer|outfile|precision|primary|procedure|purge|raid0|read|reads|real|references|regexp|release|rename|repeat|replace|require|restrict|return|revoke|right|rlike|schema|schemas|second_microsecond|select|sensitive|separator|set|show|smallint|soname|spatial|specific|sql|sql_big_result|sql_calc_found_rows|sql_small_result|sqlexception|sqlstate|sqlwarning|ssl|starting|straight_join|table|terminated|then|to|trailing|trigger|undo|union|unique|unlock|unsigned|update|usage|use|using|utc_date|utc_time|utc_timestamp|values|varying|when|where|while|with|write|x509|xor|year_month|zerofill)\\b" (Arbitrary "Keyword")+ , tok "\\b(auto_increment|engine|charset|tables)\\b" (Arbitrary "Keyword" :. Arbitrary "Pseudo")+ , tok "(true|false|null)" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "([a-zA-Z_][a-zA-Z0-9_]*)(\\s*)(\\()" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Punctuation")])+ , tok "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name")+ , tok "@[A-Za-z0-9]*[._]*[A-Za-z0-9]*" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "[;:()\\[\\],\\.]" (Arbitrary "Punctuation")+ ]+
+ src/Text/Highlighter/Lexers/Nasm.hs view
@@ -0,0 +1,65 @@+module Text.Highlighter.Lexers.Nasm (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "NASM"+ , lAliases = ["nasm"]+ , lExtensions = [".asm", ".ASM"]+ , lMimetypes = ["text/x-nasm"]+ , lStart = root'+ , lFlags = [caseless, multiline]+ }++preproc' :: TokenMatcher+preproc' =+ [ tok "[^;\\n]+" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tokNext ";.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single") Pop+ , tokNext "\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ ]++punctuation' :: TokenMatcher+punctuation' =+ [ tok "[,():\\[\\]]+" (Arbitrary "Punctuation")+ , tok "[&|^<>+*/%\126-]+" (Arbitrary "Operator")+ , tok "[$]+" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tok "seg|wrt|strict" (Arbitrary "Operator" :. Arbitrary "Word")+ , tok "byte|[dq]?word" (Arbitrary "Keyword" :. Arbitrary "Type")+ ]++root' :: TokenMatcher+root' =+ [ anyOf whitespace'+ , tokNext "^\\s*%" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo preproc')+ , tok "[a-zA-Z$._?][a-zA-Z0-9$._?#@\126]*:" (Arbitrary "Name" :. Arbitrary "Label")+ , tokNext "([a-zA-Z$._?][a-zA-Z0-9$._?#@\126]*)(\\s+)(equ)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Constant"), (Arbitrary "Keyword" :. Arbitrary "Declaration"), (Arbitrary "Keyword" :. Arbitrary "Declaration")]) (GoTo instructionArgs')+ , tokNext "BITS|USE16|USE32|SECTION|SEGMENT|ABSOLUTE|EXTERN|GLOBAL|ORG|ALIGN|STRUC|ENDSTRUC|COMMON|CPU|GROUP|UPPERCASE|IMPORT|EXPORT|LIBRARY|MODULE" (Arbitrary "Keyword") (GoTo instructionArgs')+ , tokNext "(?:res|d)[bwdqt]|times" (Arbitrary "Keyword" :. Arbitrary "Declaration") (GoTo instructionArgs')+ , tokNext "[a-zA-Z$._?][a-zA-Z0-9$._?#@\126]*" (Arbitrary "Name" :. Arbitrary "Function") (GoTo instructionArgs')+ , tok "[\\r\\n]+" (Arbitrary "Text")+ ]++whitespace' :: TokenMatcher+whitespace' =+ [ tok "\\n" (Arbitrary "Text")+ , tok "[ \\t]+" (Arbitrary "Text")+ , tok ";.*" (Arbitrary "Comment" :. Arbitrary "Single")+ ]++instructionArgs' :: TokenMatcher+instructionArgs' =+ [ tok "\"(\\\\\"|[^\"])*\"|'(\\\\'|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "(?:0[xX][0-9a-fA-F]+|$0[0-9a-fA-F]*|[0-9]+[0-9a-fA-F]*h)" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "[0-7]+q" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "[01]+b" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "[0-9]+\\.e?[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , anyOf punctuation'+ , tok "[a-d][lh]|e?[a-d]x|e?[sb]p|e?[sd]i|[c-gs]s|st[0-7]|mm[0-7]|cr[0-4]|dr[0-367]|tr[3-7]" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "[a-zA-Z$._?][a-zA-Z0-9$._?#@\126]*" (Arbitrary "Name" :. Arbitrary "Variable")+ , tokNext "[\\r\\n]+" (Arbitrary "Text") Pop+ , anyOf whitespace'+ ]+
+ src/Text/Highlighter/Lexers/Newspeak.hs view
@@ -0,0 +1,60 @@+module Text.Highlighter.Lexers.Newspeak (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Newspeak"+ , lAliases = ["newspeak"]+ , lExtensions = [".ns2"]+ , lMimetypes = ["text/x-newspeak"]+ , lStart = root'+ , lFlags = [multiline]+ }++literals' :: TokenMatcher+literals' =+ [ tok "\\$." (Arbitrary "Literal" :. Arbitrary "String")+ , tok "'[^']*'" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "#'[^']*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol")+ , tok "#\\w+:?" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol")+ , tok "#(\\+|\\/|\126|\\*|<|>|=|@|%|\\||&|\\?|!|,|-)+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol")+ ]++root' :: TokenMatcher+root' =+ [ tok "\\b(Newsqueak2)\\b" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , tok "'[^']*'" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\b(class)(\\s+)([a-zA-Z0-9_]+)(\\s*)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Declaration"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Text")])+ , tok "\\b(mixin|self|super|private|public|protected|nil|true|false)\\b" (Arbitrary "Keyword")+ , tok "([a-zA-Z0-9_]+\\:)(\\s*)([a-zA-Z_]\\w+)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Variable")])+ , tok "([a-zA-Z0-9_]+)(\\s*)(=)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Attribute"), (Arbitrary "Text"), (Arbitrary "Operator")])+ , tok "<[a-zA-Z0-9_]+>" (Arbitrary "Comment" :. Arbitrary "Special")+ , anyOf expressionstat'+ , anyOf whitespace'+ ]++whitespace' :: TokenMatcher+whitespace' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "\"[^\"]*\"" (Arbitrary "Comment")+ ]++expressionstat' :: TokenMatcher+expressionstat' =+ [ tok "(\\d+\\.\\d*|\\.\\d+|\\d+[fF])[fF]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok ":\\w+" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "(\\w+)(::)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Operator")])+ , tok "\\w+:" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "\\w+" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "\\(|\\)" (Arbitrary "Punctuation")+ , tok "\\[|\\]" (Arbitrary "Punctuation")+ , tok "\\{|\\}" (Arbitrary "Punctuation")+ , tok "(\\^|\\+|\\/|\126|\\*|<|>|=|@|%|\\||&|\\?|!|,|-|:)" (Arbitrary "Operator")+ , tok "\\.|;" (Arbitrary "Punctuation")+ , anyOf whitespace'+ , anyOf literals'+ ]+
+ src/Text/Highlighter/Lexers/NginxConf.hs view
@@ -0,0 +1,52 @@+module Text.Highlighter.Lexers.NginxConf (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Nginx configuration file"+ , lAliases = ["nginx"]+ , lExtensions = []+ , lMimetypes = ["text/x-nginx-conf"]+ , lStart = root'+ , lFlags = [multiline]+ }++base' :: TokenMatcher+base' =+ [ tok "#.*\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "on|off" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "\\$[^\\s;#()]+" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "([a-z0-9.-]+)(:)([0-9]+)" (ByGroups [(Arbitrary "Name"), (Arbitrary "Punctuation"), (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")])+ , tok "[a-z-]+/[a-z-+]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "[0-9]+[km]?\\b" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "(\126)(\\s*)([^\\s{]+)" (ByGroups [(Arbitrary "Punctuation"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")])+ , tok "[:=\126]" (Arbitrary "Punctuation")+ , tok "[^\\s;#{}$]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "/[^\\s;#]*" (Arbitrary "Name")+ , tok "\\s+" (Arbitrary "Text")+ , tok "[$;]" (Arbitrary "Text")+ ]++root' :: TokenMatcher+root' =+ [ tok "(include)(\\s+)([^\\s;]+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name")])+ , tokNext "[^\\s;#]+" (Arbitrary "Keyword") (GoTo stmt')+ , anyOf base'+ ]++stmt' :: TokenMatcher+stmt' =+ [ tokNext "{" (Arbitrary "Punctuation") (GoTo block')+ , tokNext ";" (Arbitrary "Punctuation") Pop+ , anyOf base'+ ]++block' :: TokenMatcher+block' =+ [ tokNext "}" (Arbitrary "Punctuation") (PopNum 2)+ , tokNext "[^\\s;#]+" (Arbitrary "Keyword" :. Arbitrary "Namespace") (GoTo stmt')+ , anyOf base'+ ]+
+ src/Text/Highlighter/Lexers/NumPy.hs view
@@ -0,0 +1,149 @@+module Text.Highlighter.Lexers.NumPy (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "NumPy"+ , lAliases = ["numpy"]+ , lExtensions = []+ , lMimetypes = []+ , lStart = root'+ , lFlags = [multiline]+ }++tsqs' :: TokenMatcher+tsqs' =+ [ tokNext "'''" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , anyOf strings'+ , anyOf nl'+ ]++builtins' :: TokenMatcher+builtins' =+ [ tok "(?<!\\.)(__import__|abs|all|any|apply|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|exit|file|filter|float|frozenset|getattr|globals|hasattr|hash|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(?<!\\.)(self|None|Ellipsis|NotImplemented|False|True)\\b" (Arbitrary "Name" :. Arbitrary "Builtin" :. Arbitrary "Pseudo")+ , tok "(?<!\\.)(ArithmeticError|AssertionError|AttributeError|BaseException|DeprecationWarning|EOFError|EnvironmentError|Exception|FloatingPointError|FutureWarning|GeneratorExit|IOError|ImportError|ImportWarning|IndentationError|IndexError|KeyError|KeyboardInterrupt|LookupError|MemoryError|NameError|NotImplemented|NotImplementedError|OSError|OverflowError|OverflowWarning|PendingDeprecationWarning|ReferenceError|RuntimeError|RuntimeWarning|StandardError|StopIteration|SyntaxError|SyntaxWarning|SystemError|SystemExit|TabError|TypeError|UnboundLocalError|UnicodeDecodeError|UnicodeEncodeError|UnicodeError|UnicodeTranslateError|UnicodeWarning|UserWarning|ValueError|VMSError|Warning|WindowsError|ZeroDivisionError)\\b" (Arbitrary "Name" :. Arbitrary "Exception")+ ]++name' :: TokenMatcher+name' =+ [ tok "@[a-zA-Z0-9_.]+" (Arbitrary "Name" :. Arbitrary "Decorator")+ , tok "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name")+ ]++dqs' :: TokenMatcher+dqs' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\\\\\|\\\\\"|\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , anyOf strings'+ ]++sqs' :: TokenMatcher+sqs' =+ [ tokNext "'" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\\\\\|\\\\'|\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , anyOf strings'+ ]++tdqs' :: TokenMatcher+tdqs' =+ [ tokNext "\"\"\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , anyOf strings'+ , anyOf nl'+ ]++backtick' :: TokenMatcher+backtick' =+ [ tok "`.*?`" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Backtick")+ ]++funcname' :: TokenMatcher+funcname' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Function") Pop+ ]++classname' :: TokenMatcher+classname' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Class") Pop+ ]++stringescape' :: TokenMatcher+stringescape' =+ [ tok "\\\\([\\\\abfnrtv\"\\']|\\n|N{.*?}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ ]++numbers' :: TokenMatcher+numbers' =+ [ tok "(\\d+\\.\\d*|\\d*\\.\\d+)([eE][+-]?[0-9]+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "\\d+[eE][+-]?[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0[0-7]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "0[xX][a-fA-F0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "\\d+L" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer" :. Arbitrary "Long")+ , tok "\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ ]++keywords' :: TokenMatcher+keywords' =+ [ tok "(assert|break|continue|del|elif|else|except|exec|finally|for|global|if|lambda|pass|print|raise|return|try|while|yield|as|with)\\b" (Arbitrary "Keyword")+ ]++import' :: TokenMatcher+import' =+ [ tok "((?:\\s|\\\\\\s)+)(as)((?:\\s|\\\\\\s)+)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text")])+ , tok "[a-zA-Z_][a-zA-Z0-9_.]*" (Arbitrary "Name" :. Arbitrary "Namespace")+ , tok "(\\s*)(,)(\\s*)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Operator"), (Arbitrary "Text")])+ , tokNext "" (Arbitrary "Text") Pop+ ]++nl' :: TokenMatcher+nl' =+ [ tok "\\n" (Arbitrary "Literal" :. Arbitrary "String")+ ]++root' :: TokenMatcher+root' =+ [ tok "\\n" (Arbitrary "Text")+ , tok "^(\\s*)([rRuU]{,2}\"\"\"(?:.|\\n)*?\"\"\")" (ByGroups [(Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Doc")])+ , tok "^(\\s*)([rRuU]{,2}'''(?:.|\\n)*?''')" (ByGroups [(Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Doc")])+ , tok "[^\\S\\n]+" (Arbitrary "Text")+ , tok "#.*$" (Arbitrary "Comment")+ , tok "[]{}:(),;[]" (Arbitrary "Punctuation")+ , tok "\\\\\\n" (Arbitrary "Text")+ , tok "\\\\" (Arbitrary "Text")+ , tok "(in|is|and|or|not)\\b" (Arbitrary "Operator" :. Arbitrary "Word")+ , tok "!=|==|<<|>>|[-\126+/*%=<>&^|.]" (Arbitrary "Operator")+ , anyOf keywords'+ , tokNext "(def)((?:\\s|\\\\\\s)+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo funcname')+ , tokNext "(class)((?:\\s|\\\\\\s)+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo classname')+ , tokNext "(from)((?:\\s|\\\\\\s)+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text")]) (GoTo fromimport')+ , tokNext "(import)((?:\\s|\\\\\\s)+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text")]) (GoTo import')+ , anyOf builtins'+ , anyOf backtick'+ , tokNext "(?:[rR]|[uU][rR]|[rR][uU])\"\"\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo tdqs')+ , tokNext "(?:[rR]|[uU][rR]|[rR][uU])'''" (Arbitrary "Literal" :. Arbitrary "String") (GoTo tsqs')+ , tokNext "(?:[rR]|[uU][rR]|[rR][uU])\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo dqs')+ , tokNext "(?:[rR]|[uU][rR]|[rR][uU])'" (Arbitrary "Literal" :. Arbitrary "String") (GoTo sqs')+ , tokNext "[uU]?\"\"\"" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', tdqs'])+ , tokNext "[uU]?'''" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', tsqs'])+ , tokNext "[uU]?\"" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', dqs'])+ , tokNext "[uU]?'" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', sqs'])+ , anyOf name'+ , anyOf numbers'+ ]++strings' :: TokenMatcher+strings' =+ [ tok "%(\\([a-zA-Z0-9_]+\\))?[-#0 +]*([0-9]+|[*])?(\\.([0-9]+|[*]))?[hlL]?[diouxXeEfFgGcrs%]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol")+ , tok "[^\\\\\\'\"%\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "[\\'\"\\\\]" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "%" (Arbitrary "Literal" :. Arbitrary "String")+ ]++fromimport' :: TokenMatcher+fromimport' =+ [ tokNext "((?:\\s|\\\\\\s)+)(import)\\b" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Namespace")]) Pop+ , tok "[a-zA-Z_.][a-zA-Z0-9_.]*" (Arbitrary "Name" :. Arbitrary "Namespace")+ ]+
+ src/Text/Highlighter/Lexers/Objdump.hs view
@@ -0,0 +1,30 @@+module Text.Highlighter.Lexers.Objdump (lexer) where+import qualified Text.Highlighter.Lexers.Gas as Gas+import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "objdump"+ , lAliases = ["objdump"]+ , lExtensions = [".objdump"]+ , lMimetypes = ["text/x-objdump"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "(.*?)(:)( +file format )(.*?)$" (ByGroups [(Arbitrary "Name" :. Arbitrary "Label"), (Arbitrary "Punctuation"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String")])+ , tok "(Disassembly of section )(.*?)(:)$" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Label"), (Arbitrary "Punctuation")])+ , tok "([0-9A-Za-z]+)( )(<)(.*?)([-+])(0[xX][A-Za-z0-9]+)(>:)$" (ByGroups [(Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex"), (Arbitrary "Text"), (Arbitrary "Punctuation"), (Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Punctuation"), (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex"), (Arbitrary "Punctuation")])+ , tok "([0-9A-Za-z]+)( )(<)(.*?)(>:)$" (ByGroups [(Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex"), (Arbitrary "Text"), (Arbitrary "Punctuation"), (Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Punctuation")])+ , tok "( *)([0-9A-Za-z]+:)(\\t)((?:[0-9A-Za-z][0-9A-Za-z] )+)( *\9)([a-zA-Z].*?)$" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Label"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex"), (Arbitrary "Text"), (Using Gas.lexer)])+ , tok "( *)([0-9A-Za-z]+:)(\\t)((?:[0-9A-Za-z][0-9A-Za-z] )+)( *)(.*?)$" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Label"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String")])+ , tok "( *)([0-9A-Za-z]+:)(\\t)((?:[0-9A-Za-z][0-9A-Za-z] )+)$" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Label"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")])+ , tok "\9\\.\\.\\.$" (Arbitrary "Text")+ , tok "(\9\9\9)([0-9A-Za-z]+:)( )([^\9]+)(\9)(.*?)([-+])(0x[0-9A-Za-z]+)$" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Label"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Property"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Constant"), (Arbitrary "Punctuation"), (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")])+ , tok "(\9\9\9)([0-9A-Za-z]+:)( )([^\9]+)(\9)(.*?)$" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Label"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Property"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Constant")])+ , tok "[^\10]+\10" (Arbitrary "Other")+ ]+
+ src/Text/Highlighter/Lexers/ObjectiveC.hs view
@@ -0,0 +1,115 @@+module Text.Highlighter.Lexers.ObjectiveC (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Objective-C"+ , lAliases = ["objective-c", "objectivec", "obj-c", "objc"]+ , lExtensions = [".m"]+ , lMimetypes = ["text/x-objective-c"]+ , lStart = root'+ , lFlags = [multiline]+ }++classname' :: TokenMatcher+classname' =+ [ tokNext "([a-zA-Z$_][a-zA-Z0-9$_]*)(\\s*:\\s*)([a-zA-Z$_][a-zA-Z0-9$_]*)?" (ByGroups [(Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Class")]) Pop+ , tokNext "([a-zA-Z$_][a-zA-Z0-9$_]*)(\\s*)(\\([a-zA-Z$_][a-zA-Z0-9$_]*\\))" (ByGroups [(Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Label")]) Pop+ , tokNext "([a-zA-Z$_][a-zA-Z0-9$_]*)" (Arbitrary "Name" :. Arbitrary "Class") Pop+ ]++function' :: TokenMatcher+function' =+ [ anyOf whitespace'+ , anyOf statements'+ , tok ";" (Arbitrary "Punctuation")+ , tokNext "{" (Arbitrary "Punctuation") Push+ , tokNext "}" (Arbitrary "Punctuation") Pop+ ]++statement' :: TokenMatcher+statement' =+ [ anyOf whitespace'+ , anyOf statements'+ , tok "[{}]" (Arbitrary "Punctuation")+ , tokNext ";" (Arbitrary "Punctuation") Pop+ ]++statements' :: TokenMatcher+statements' =+ [ tokNext "(L|@)?\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo string')+ , tok "(L|@)?'(\\\\.|\\\\[0-7]{1,3}|\\\\x[a-fA-F0-9]{1,2}|[^\\\\\\'\\n])'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+)[eE][+-]?\\d+[lL]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+[fF])[fF]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0x[0-9a-fA-F]+[Ll]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "0[0-7]+[Ll]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "\\d+[Ll]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "[\126!%^&*+=|?:<>/-]" (Arbitrary "Operator")+ , tok "[()\\[\\],.]" (Arbitrary "Punctuation")+ , tok "(auto|break|case|const|continue|default|do|else|enum|extern|for|goto|if|register|restricted|return|sizeof|static|struct|switch|typedef|union|volatile|virtual|while|in|@selector|@private|@protected|@public|@encode|@synchronized|@try|@throw|@catch|@finally|@end|@property|@synthesize|@dynamic)\\b" (Arbitrary "Keyword")+ , tok "(int|long|float|short|double|char|unsigned|signed|void|id|BOOL|IBOutlet|IBAction|SEL)\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "(_{0,2}inline|naked|restrict|thread|typename)\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "__(asm|int8|based|except|int16|stdcall|cdecl|fastcall|int32|declspec|finally|int64|try|leave)\\b" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "(TRUE|FALSE|nil|NULL)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "[a-zA-Z$_][a-zA-Z0-9$_]*:(?!:)" (Arbitrary "Name" :. Arbitrary "Label")+ , tok "[a-zA-Z$_][a-zA-Z0-9$_]*" (Arbitrary "Name")+ ]++whitespace' :: TokenMatcher+whitespace' =+ [ tokNext "^#if\\s+0" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo if0')+ , tokNext "^#" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo macro')+ , tokNext "^(?:\\s|//.*?\\n|/[*].*?[*]/)+#if\\s+0" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo if0')+ , tokNext "^(?:\\s|//.*?\\n|/[*].*?[*]/)+#" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo macro')+ , tok "\\n" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ , tok "\\\\\\n" (Arbitrary "Text")+ , tok "//(\\n|(.|\\n)*?[^\\\\]\\n)" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/(\\\\\\n)?[*](.|\\n)*?[*](\\\\\\n)?/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]++forward_classname' :: TokenMatcher+forward_classname' =+ [ tokNext "([a-zA-Z$_][a-zA-Z0-9$_]*)(\\s*,\\s*)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Text")]) (GoTo forward_classname')+ , tokNext "([a-zA-Z$_][a-zA-Z0-9$_]*)(\\s*;?)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Text")]) Pop+ ]++if0' :: TokenMatcher+if0' =+ [ tokNext "^\\s*#if.*?(?<!\\\\)\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Push+ , tokNext "^\\s*#endif.*?(?<!\\\\)\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ , tok ".*?\\n" (Arbitrary "Comment")+ ]++macro' :: TokenMatcher+macro' =+ [ tok "[^/\\n]+" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "/[*](.|\\n)*?[*]/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "//.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single") Pop+ , tok "/" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "(?<=\\\\)\\n" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tokNext "\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ ]++root' :: TokenMatcher+root' =+ [ anyOf whitespace'+ , tokNext "((?:[a-zA-Z0-9_*\\s])+?(?:\\s|[*]))([a-zA-Z$_][a-zA-Z0-9$_]*)(\\s*\\([^;]*?\\))((?:\\s|//.*?\\n|/[*].*?[*]/)+)({)" (ByGroups [(Using lexer), (Arbitrary "Name" :. Arbitrary "Function"), (Using lexer), (Arbitrary "Text"), (Arbitrary "Punctuation")]) (GoTo function')+ , tok "((?:[a-zA-Z0-9_*\\s])+?(?:\\s|[*]))([a-zA-Z$_][a-zA-Z0-9$_]*)(\\s*\\([^;]*?\\))((?:\\s|//.*?\\n|/[*].*?[*]/)+)(;)" (ByGroups [(Using lexer), (Arbitrary "Name" :. Arbitrary "Function"), (Using lexer), (Arbitrary "Text"), (Arbitrary "Punctuation")])+ , tokNext "(@interface|@implementation)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo classname')+ , tokNext "(@class|@protocol)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo forward_classname')+ , tok "(\\s*)(@end)(\\s*)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text")])+ , tokNext "" (Arbitrary "Text") (GoTo statement')+ ]++string' :: TokenMatcher+string' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\([\\\\abfnrtv\"\\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "[^\\\\\"\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\" (Arbitrary "Literal" :. Arbitrary "String")+ ]+
+ src/Text/Highlighter/Lexers/ObjectiveJ.hs view
@@ -0,0 +1,149 @@+module Text.Highlighter.Lexers.ObjectiveJ (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Objective-J"+ , lAliases = ["objective-j", "objectivej", "obj-j", "objj"]+ , lExtensions = [".j"]+ , lMimetypes = ["text/x-objective-j"]+ , lStart = root'+ , lFlags = [multiline, dotall]+ }++statements' :: TokenMatcher+statements' =+ [ tokNext "(L|@)?\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo string')+ , tok "(L|@)?'(\\\\.|\\\\[0-7]{1,3}|\\\\x[a-fA-F0-9]{1,2}|[^\\\\\\'\\n])'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "'(\\\\\\\\|\\\\'|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+)[eE][+-]?\\d+[lL]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+[fF])[fF]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0x[0-9a-fA-F]+[Ll]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "0[0-7]+[Ll]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "\\d+[Ll]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tokNext "^(?=\\s|/|<!--)" (Arbitrary "Text") (GoTo slashstartsregex')+ , tokNext "\\+\\+|--|\126|&&|\\?|:|\\|\\||\\\\(?=\\n)|(<<|>>>?|==?|!=?|[-<>+*%&\\|\\^/])=?" (Arbitrary "Operator") (GoTo slashstartsregex')+ , tokNext "[{(\\[;,]" (Arbitrary "Punctuation") (GoTo slashstartsregex')+ , tok "[})\\].]" (Arbitrary "Punctuation")+ , tokNext "(for|in|while|do|break|return|continue|switch|case|default|if|else|throw|try|catch|finally|new|delete|typeof|instanceof|void|prototype|__proto__)\\b" (Arbitrary "Keyword") (GoTo slashstartsregex')+ , tokNext "(var|with|function)\\b" (Arbitrary "Keyword" :. Arbitrary "Declaration") (GoTo slashstartsregex')+ , tok "(@selector|@private|@protected|@public|@encode|@synchronized|@try|@throw|@catch|@finally|@end|@property|@synthesize|@dynamic|@for|@accessors|new)\\b" (Arbitrary "Keyword")+ , tok "(int|long|float|short|double|char|unsigned|signed|void|id|BOOL|bool|boolean|IBOutlet|IBAction|SEL|@outlet|@action)\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "(self|super)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(TRUE|YES|FALSE|NO|Nil|nil|NULL)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tok "(true|false|null|NaN|Infinity|undefined)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tok "(ABS|ASIN|ACOS|ATAN|ATAN2|SIN|COS|TAN|EXP|POW|CEIL|FLOOR|ROUND|MIN|MAX|RAND|SQRT|E|LN2|LN10|LOG2E|LOG10E|PI|PI2|PI_2|SQRT1_2|SQRT2)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tok "(Array|Boolean|Date|Error|Function|Math|netscape|Number|Object|Packages|RegExp|String|sun|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|Error|eval|isFinite|isNaN|parseFloat|parseInt|document|this|window)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "([$a-zA-Z_][a-zA-Z0-9_]*)((?:\\s|//.*?\\n|/[*].*?[*]/)*)(?=\\()" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Using lexer)])+ , tok "[$a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name")+ ]++string' :: TokenMatcher+string' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\([\\\\abfnrtv\"\\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "[^\\\\\"\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\" (Arbitrary "Literal" :. Arbitrary "String")+ ]++function_signature' :: TokenMatcher+function_signature' =+ [ anyOf whitespace'+ , tokNext "(\\((?:\\s|//.*?\\n|/[*].*?[*]/)*)([a-zA-Z_][a-zA-Z0-9_]+)((?:\\s|//.*?\\n|/[*].*?[*]/)*\\)(?:\\s|//.*?\\n|/[*].*?[*]/)*)([$a-zA-Z_][a-zA-Z0-9_]+(?:\\s|//.*?\\n|/[*].*?[*]/)*:)" (ByGroups [(Using lexer), (Arbitrary "Keyword" :. Arbitrary "Type"), (Using lexer), (Arbitrary "Name" :. Arbitrary "Function")]) (GoTo function_parameters')+ , tokNext "(\\((?:\\s|//.*?\\n|/[*].*?[*]/)*)([a-zA-Z_][a-zA-Z0-9_]+)((?:\\s|//.*?\\n|/[*].*?[*]/)*\\)(?:\\s|//.*?\\n|/[*].*?[*]/)*)([$a-zA-Z_][a-zA-Z0-9_]+)" (ByGroups [(Using lexer), (Arbitrary "Keyword" :. Arbitrary "Type"), (Using lexer), (Arbitrary "Name" :. Arbitrary "Function")]) Pop+ , tokNext "([$a-zA-Z_][a-zA-Z0-9_]+(?:\\s|//.*?\\n|/[*].*?[*]/)*:)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function")]) (GoTo function_parameters')+ , tokNext "([$a-zA-Z_][a-zA-Z0-9_]+)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function")]) Pop+ , tokNext "" (Arbitrary "Text") Pop+ ]++classname' :: TokenMatcher+classname' =+ [ tokNext "([a-zA-Z_][a-zA-Z0-9_]*)((?:\\s|//.*?\\n|/[*].*?[*]/)*:(?:\\s|//.*?\\n|/[*].*?[*]/)*)([a-zA-Z_][a-zA-Z0-9_]*)?" (ByGroups [(Arbitrary "Name" :. Arbitrary "Class"), (Using lexer), (Arbitrary "Name" :. Arbitrary "Class")]) Pop+ , tokNext "([a-zA-Z_][a-zA-Z0-9_]*)((?:\\s|//.*?\\n|/[*].*?[*]/)*\\()([a-zA-Z_][a-zA-Z0-9_]*)(\\))" (ByGroups [(Arbitrary "Name" :. Arbitrary "Class"), (Using lexer), (Arbitrary "Name" :. Arbitrary "Label"), (Arbitrary "Text")]) Pop+ , tokNext "([a-zA-Z_][a-zA-Z0-9_]*)" (Arbitrary "Name" :. Arbitrary "Class") Pop+ ]++forward_classname' :: TokenMatcher+forward_classname' =+ [ tokNext "([a-zA-Z_][a-zA-Z0-9_]*)(\\s*,\\s*)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Text")]) Push+ , tokNext "([a-zA-Z_][a-zA-Z0-9_]*)(\\s*;?)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Text")]) Pop+ ]++badregex' :: TokenMatcher+badregex' =+ [ tokNext "\10" (Arbitrary "Text") Pop+ ]++function_parameters' :: TokenMatcher+function_parameters' =+ [ anyOf whitespace'+ , tok "(\\((?:\\s|//.*?\\n|/[*].*?[*]/)*)([^\\)]+)((?:\\s|//.*?\\n|/[*].*?[*]/)*\\)(?:\\s|//.*?\\n|/[*].*?[*]/)*)+([$a-zA-Z_][a-zA-Z0-9_]+)" (ByGroups [(Using lexer), (Arbitrary "Keyword" :. Arbitrary "Type"), (Using lexer), (Arbitrary "Text")])+ , tok "([$a-zA-Z_][a-zA-Z0-9_]+(?:\\s|//.*?\\n|/[*].*?[*]/)*:)" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "(:)" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "(,(?:\\s|//.*?\\n|/[*].*?[*]/)*...)" (Using lexer)+ , tok "([$a-zA-Z_][a-zA-Z0-9_]+)" (Arbitrary "Text")+ ]++if0' :: TokenMatcher+if0' =+ [ tokNext "^\\s*#if.*?(?<!\\\\)\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Push+ , tokNext "^\\s*#endif.*?(?<!\\\\)\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ , tok ".*?\\n" (Arbitrary "Comment")+ ]++whitespace' :: TokenMatcher+whitespace' =+ [ tok "(@import)(\\s+)(\"(\\\\\\\\|\\\\\"|[^\"])*\")" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")])+ , tok "(@import)(\\s+)(<(\\\\\\\\|\\\\>|[^>])*>)" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")])+ , tok "(#(?:include|import))(\\s+)(\"(\\\\\\\\|\\\\\"|[^\"])*\")" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")])+ , tok "(#(?:include|import))(\\s+)(<(\\\\\\\\|\\\\>|[^>])*>)" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")])+ , tokNext "#if\\s+0" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo if0')+ , tokNext "#" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo macro')+ , tok "\\n" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ , tok "\\\\\\n" (Arbitrary "Text")+ , tok "//(\\n|(.|\\n)*?[^\\\\]\\n)" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/(\\\\\\n)?[*](.|\\n)*?[*](\\\\\\n)?/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "<!--" (Arbitrary "Comment")+ ]++root' :: TokenMatcher+root' =+ [ anyOf whitespace'+ , tok "^((?:\\s|//.*?\\n|/[*].*?[*]/)*[\\+-](?:\\s|//.*?\\n|/[*].*?[*]/)*)([\\(a-zA-Z_].*?[^\\(])((?:\\s|//.*?\\n|/[*].*?[*]/)*{)" (ByGroups [(Using lexer), (Using lexer), (Using lexer)])+ , tokNext "(@interface|@implementation)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo classname')+ , tokNext "(@class|@protocol)(\\s*)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo forward_classname')+ , tok "(\\s*)(@end)(\\s*)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text")])+ , anyOf statements'+ , tok "[{\\(\\)}]" (Arbitrary "Punctuation")+ , tok ";" (Arbitrary "Punctuation")+ ]++slashstartsregex' :: TokenMatcher+slashstartsregex' =+ [ anyOf whitespace'+ , tokNext "/(\\\\.|[^[/\\\\\\n]|\\[(\\\\.|[^\\]\\\\\\n])*])+/([gim]+\\b|\\B)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") Pop+ , tokNext "(?=/)" (Arbitrary "Text") (DoAll [Pop, (GoTo badregex')])+ , tokNext "" (Arbitrary "Text") Pop+ ]++macro' :: TokenMatcher+macro' =+ [ tok "[^/\\n]+" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "/[*](.|\\n)*?[*]/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "//.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single") Pop+ , tok "/" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "(?<=\\\\)\\n" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tokNext "\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ ]++expression' :: TokenMatcher+expression' =+ [ tok "([$a-zA-Z_][a-zA-Z0-9_]*)(\\()" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Punctuation")])+ , tokNext "(\\))" (Arbitrary "Punctuation") Pop+ ]+
+ src/Text/Highlighter/Lexers/Ocaml.hs view
@@ -0,0 +1,72 @@+module Text.Highlighter.Lexers.Ocaml (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "OCaml"+ , lAliases = ["ocaml"]+ , lExtensions = [".ml", ".mli", ".mll", ".mly"]+ , lMimetypes = ["text/x-ocaml"]+ , lStart = root'+ , lFlags = [multiline]+ }++comment' :: TokenMatcher+comment' =+ [ tok "[^(*)]+" (Arbitrary "Comment")+ , tokNext "\\(\\*" (Arbitrary "Comment") Push+ , tokNext "\\*\\)" (Arbitrary "Comment") Pop+ , tok "[(*)]" (Arbitrary "Comment")+ ]++root' :: TokenMatcher+root' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "false|true|\\(\\)|\\[\\]" (Arbitrary "Name" :. Arbitrary "Builtin" :. Arbitrary "Pseudo")+ , tokNext "\\b([A-Z][A-Za-z0-9_\\']*)(?=\\s*\\.)" (Arbitrary "Name" :. Arbitrary "Namespace") (GoTo dotted')+ , tok "\\b([A-Z][A-Za-z0-9_\\']*)" (Arbitrary "Name" :. Arbitrary "Class")+ , tokNext "\\(\\*" (Arbitrary "Comment") (GoTo comment')+ , tok "\\b(as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|false|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|object|of|open|private|raise|rec|sig|struct|then|to|true|try|type|val|virtual|when|while|with)\\b" (Arbitrary "Keyword")+ , tok "(!=|#|&|&&|\\(|\\)|\\*|\\+|,|-|-\\.|->|\\.|\\.\\.|:|::|:=|:>|;|;;|<|<-|=|>|>]|>}|\\?|\\?\\?|\\[|\\[<|\\[>|\\[\\||]|_|`|{|{<|\\||\\|]|}|\126)" (Arbitrary "Operator")+ , tok "([=<>@^|&+\\*/$%-]|[!?\126])?[!$%&*+\\./:<=>?@^|\126-]" (Arbitrary "Operator")+ , tok "\\b(and|asr|land|lor|lsl|lxor|mod|or)\\b" (Arbitrary "Operator" :. Arbitrary "Word")+ , tok "\\b(unit|int|float|bool|string|char|list|array)\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "[^\\W\\d][\\w']*" (Arbitrary "Name")+ , tok "\\d[\\d_]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "0[xX][\\da-fA-F][\\da-fA-F_]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "0[oO][0-7][0-7_]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "0[bB][01][01_]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Binary")+ , tok "-?\\d[\\d_]*(.[\\d_]*)?([eE][+\\-]?\\d[\\d_]*)" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "'(?:(\\\\[\\\\\\\"'ntbr ])|(\\\\[0-9]{3})|(\\\\x[0-9a-fA-F]{2}))'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "'.'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "'" (Arbitrary "Keyword")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") (GoTo string')+ , tok "[\126?][a-z][\\w\\']*:" (Arbitrary "Name" :. Arbitrary "Variable")+ ]++string' :: TokenMatcher+string' =+ [ tok "[^\\\\\"]+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , anyOf escapeSequence'+ , tok "\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") Pop+ ]++escapeSequence' :: TokenMatcher+escapeSequence' =+ [ tok "\\\\[\\\\\\\"\\'ntbr]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "\\\\[0-9]{3}" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "\\\\x[0-9a-fA-F]{2}" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ ]++dotted' :: TokenMatcher+dotted' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "\\." (Arbitrary "Punctuation")+ , tok "[A-Z][A-Za-z0-9_\\']*(?=\\s*\\.)" (Arbitrary "Name" :. Arbitrary "Namespace")+ , tokNext "[A-Z][A-Za-z0-9_\\']*" (Arbitrary "Name" :. Arbitrary "Class") Pop+ , tokNext "[a-z_][A-Za-z0-9_\\']*" (Arbitrary "Name") Pop+ ]+
+ src/Text/Highlighter/Lexers/Ooc.hs view
@@ -0,0 +1,52 @@+module Text.Highlighter.Lexers.Ooc (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Ooc"+ , lAliases = ["ooc"]+ , lExtensions = [".ooc"]+ , lMimetypes = ["text/x-ooc"]+ , lStart = root'+ , lFlags = [multiline]+ }++include' :: TokenMatcher+include' =+ [ tok "[\\w/]+" (Arbitrary "Name")+ , tok "," (Arbitrary "Punctuation")+ , tok "[ \\t]" (Arbitrary "Text")+ , tokNext "[;\\n]" (Arbitrary "Text") Pop+ ]++root' :: TokenMatcher+root' =+ [ tok "\\b(class|interface|implement|abstract|extends|from|this|super|new|const|final|static|import|use|extern|inline|proto|break|continue|fallthrough|operator|if|else|for|while|do|switch|case|as|in|version|return|true|false|null)\\b" (Arbitrary "Keyword")+ , tokNext "include\\b" (Arbitrary "Keyword") (GoTo include')+ , tok "(cover)([ \\t]+)(from)([ \\t]+)([a-zA-Z0-9_]+[*@]?)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Class")])+ , tok "(func)((?:[ \\t]|\\\\\\n)+)(\126[a-z_][a-zA-Z0-9_]*)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function")])+ , tok "\\bfunc\\b" (Arbitrary "Keyword")+ , tok "//.*" (Arbitrary "Comment")+ , tok "(?s)/\\*.*?\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "(==?|\\+=?|-[=>]?|\\*=?|/=?|:=|!=?|%=?|\\?|>{1,3}=?|<{1,3}=?|\\.\\.|&&?|\\|\\|?|\\^=?)" (Arbitrary "Operator")+ , tok "(\\.)([ \\t]*)([a-z]\\w*)" (ByGroups [(Arbitrary "Operator"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Function")])+ , tok "[A-Z][A-Z0-9_]+" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "[A-Z][a-zA-Z0-9_]*([@*]|\\[[ \\t]*\\])?" (Arbitrary "Name" :. Arbitrary "Class")+ , tok "([a-z][a-zA-Z0-9_]*(?:\126[a-z][a-zA-Z0-9_]*)?)((?:[ \\t]|\\\\\\n)*)(?=\\()" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text")])+ , tok "[a-z][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "[:(){}\\[\\];,]" (Arbitrary "Punctuation")+ , tok "0x[0-9a-fA-F]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "0c[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "0b[01]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Binary")+ , tok "[0-9_]\\.[0-9_]*(?!\\.)" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "[0-9_]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Decimal")+ , tok "\"(?:\\\\.|\\\\[0-7]{1,3}|\\\\x[a-fA-F0-9]{1,2}|[^\\\\\\\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "'(?:\\\\.|\\\\[0-9]{1,3}|\\\\x[a-fA-F0-9]{1,2}|[^\\\\\\'\\n])'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "@" (Arbitrary "Punctuation")+ , tok "\\." (Arbitrary "Punctuation")+ , tok "\\\\[ \\t\\n]" (Arbitrary "Text")+ , tok "[ \\t]+" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Perl.hs view
@@ -0,0 +1,157 @@+module Text.Highlighter.Lexers.Perl (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Perl"+ , lAliases = ["perl", "pl"]+ , lExtensions = [".pl", ".pm"]+ , lMimetypes = ["text/x-perl", "application/x-perl"]+ , lStart = root'+ , lFlags = [multiline, dotall]+ }++modulename' :: TokenMatcher+modulename' =+ [ tokNext "[a-zA-Z_][\\w_]*" (Arbitrary "Name" :. Arbitrary "Namespace") Pop+ ]++format' :: TokenMatcher+format' =+ [ tokNext "\\.\\n" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol") Pop+ , tok "[^\\n]*\\n" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol")+ ]++rbString' :: TokenMatcher+rbString' =+ [ tok "\\\\[\\(\\)\\\\]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ , tok "\\\\" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ , tokNext "\\(" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other") (GoTo rbString')+ , tokNext "\\)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other") Pop+ , tok "[^\\(\\)]+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ ]++balancedRegex' :: TokenMatcher+balancedRegex' =+ [ tokNext "/(\\\\\\\\|\\\\/|[^/])*/[egimosx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") Pop+ , tokNext "!(\\\\\\\\|\\\\!|[^!])*![egimosx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") Pop+ , tokNext "\\\\(\\\\\\\\|[^\\\\])*\\\\[egimosx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") Pop+ , tokNext "{(\\\\\\\\|\\\\}|[^}])*}[egimosx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") Pop+ , tokNext "<(\\\\\\\\|\\\\>|[^>])*>[egimosx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") Pop+ , tokNext "\\[(\\\\\\\\|\\\\\\]|[^\\]])*\\][egimosx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") Pop+ , tokNext "\\((\\\\\\\\|\\\\\\)|[^\\)])*\\)[egimosx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") Pop+ , tokNext "@(\\\\\\\\|\\\\\\@|[^\\@])*@[egimosx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") Pop+ , tokNext "%(\\\\\\\\|\\\\\\%|[^\\%])*%[egimosx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") Pop+ , tokNext "\\$(\\\\\\\\|\\\\\\$|[^\\$])*\\$[egimosx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") Pop+ ]++name' :: TokenMatcher+name' =+ [ tok "[a-zA-Z0-9_]+::" (Arbitrary "Name" :. Arbitrary "Namespace")+ , tokNext "[a-zA-Z0-9_:]+" (Arbitrary "Name") Pop+ , tokNext "[A-Z_]+(?=[^a-zA-Z0-9_])" (Arbitrary "Name" :. Arbitrary "Constant") Pop+ , tokNext "(?=[^a-zA-Z0-9_])" (Arbitrary "Text") Pop+ ]++varname' :: TokenMatcher+varname' =+ [ tok "\\s+" (Arbitrary "Text")+ , tokNext "\\{" (Arbitrary "Punctuation") Pop+ , tokNext "\\)|," (Arbitrary "Punctuation") Pop+ , tok "[a-zA-Z0-9_]+::" (Arbitrary "Name" :. Arbitrary "Namespace")+ , tokNext "[a-zA-Z0-9_:]+" (Arbitrary "Name" :. Arbitrary "Variable") Pop+ ]++endPart' :: TokenMatcher+endPart' =+ [ tokNext ".+" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ ]++sbString' :: TokenMatcher+sbString' =+ [ tok "\\\\[\\[\\]\\\\]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ , tok "\\\\" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ , tokNext "\\[" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other") (GoTo sbString')+ , tokNext "\\]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other") Pop+ , tok "[^\\[\\]]+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ ]++funcname' :: TokenMatcher+funcname' =+ [ tok "[a-zA-Z_][\\w_]*[\\!\\?]?" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "\\s+" (Arbitrary "Text")+ , tok "(\\([$@%]*\\))(\\s*)" (ByGroups [(Arbitrary "Punctuation"), (Arbitrary "Text")])+ , tokNext ".*?{" (Arbitrary "Punctuation") Pop+ , tokNext ";" (Arbitrary "Punctuation") Pop+ ]++root' :: TokenMatcher+root' =+ [ tok "\\#.*?$" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "^=[a-zA-Z0-9]+\\s+.*?\\n=cut" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "(case|continue|do|else|elsif|for|foreach|if|last|my|next|our|redo|reset|then|unless|until|while|use|print|new|BEGIN|CHECK|INIT|END|return)\\b" (Arbitrary "Keyword")+ , tokNext "(format)(\\s+)([a-zA-Z0-9_]+)(\\s*)(=)(\\s*\\n)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name"), (Arbitrary "Text"), (Arbitrary "Punctuation"), (Arbitrary "Text")]) (GoTo format')+ , tok "(eq|lt|gt|le|ge|ne|not|and|or|cmp)\\b" (Arbitrary "Operator" :. Arbitrary "Word")+ , tok "s/(\\\\\\\\|\\\\/|[^/])*/(\\\\\\\\|\\\\/|[^/])*/[egimosx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ , tok "s!(\\\\\\\\|\\\\!|[^!])*!(\\\\\\\\|\\\\!|[^!])*![egimosx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ , tok "s\\\\(\\\\\\\\|[^\\\\])*\\\\(\\\\\\\\|[^\\\\])*\\\\[egimosx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ , tok "s@(\\\\\\\\|\\\\@|[^@])*@(\\\\\\\\|\\\\@|[^@])*@[egimosx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ , tok "s%(\\\\\\\\|\\\\%|[^%])*%(\\\\\\\\|\\\\%|[^%])*%[egimosx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ , tokNext "s{(\\\\\\\\|\\\\}|[^}])*}\\s*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") (GoTo balancedRegex')+ , tokNext "s<(\\\\\\\\|\\\\>|[^>])*>\\s*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") (GoTo balancedRegex')+ , tokNext "s\\[(\\\\\\\\|\\\\\\]|[^\\]])*\\]\\s*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") (GoTo balancedRegex')+ , tokNext "s\\((\\\\\\\\|\\\\\\)|[^\\)])*\\)\\s*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") (GoTo balancedRegex')+ , tok "m?/(\\\\\\\\|\\\\/|[^/\\n])*/[gcimosx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ , tokNext "m(?=[/!\\\\{<\\[\\(@%\\$])" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex") (GoTo balancedRegex')+ , tok "((?<==\126)|(?<=\\())\\s*/(\\\\\\\\|\\\\/|[^/])*/[gcimosx]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ , tok "\\s+" (Arbitrary "Text")+ , tok "(abs|accept|alarm|atan2|bind|binmode|bless|caller|chdir|chmod|chomp|chop|chown|chr|chroot|close|closedir|connect|continue|cos|crypt|dbmclose|dbmopen|defined|delete|die|dump|each|endgrent|endhostent|endnetent|endprotoent|endpwent|endservent|eof|eval|exec|exists|exit|exp|fcntl|fileno|flock|fork|format|formline|getc|getgrent|getgrgid|getgrnam|gethostbyaddr|gethostbyname|gethostent|getlogin|getnetbyaddr|getnetbyname|getnetent|getpeername|getpgrp|getppid|getpriority|getprotobyname|getprotobynumber|getprotoent|getpwent|getpwnam|getpwuid|getservbyname|getservbyport|getservent|getsockname|getsockopt|glob|gmtime|goto|grep|hex|import|index|int|ioctl|join|keys|kill|last|lc|lcfirst|length|link|listen|local|localtime|log|lstat|map|mkdir|msgctl|msgget|msgrcv|msgsnd|my|next|no|oct|open|opendir|ord|our|pack|package|pipe|pop|pos|printf|prototype|push|quotemeta|rand|read|readdir|readline|readlink|readpipe|recv|redo|ref|rename|require|reverse|rewinddir|rindex|rmdir|scalar|seek|seekdir|select|semctl|semget|semop|send|setgrent|sethostent|setnetent|setpgrp|setpriority|setprotoent|setpwent|setservent|setsockopt|shift|shmctl|shmget|shmread|shmwrite|shutdown|sin|sleep|socket|socketpair|sort|splice|split|sprintf|sqrt|srand|stat|study|substr|symlink|syscall|sysopen|sysread|sysseek|system|syswrite|tell|telldir|tie|tied|time|times|tr|truncate|uc|ucfirst|umask|undef|unlink|unpack|unshift|untie|utime|values|vec|wait|waitpid|wantarray|warn|write)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "((__(DATA|DIE|WARN)__)|(STD(IN|OUT|ERR)))\\b" (Arbitrary "Name" :. Arbitrary "Builtin" :. Arbitrary "Pseudo")+ , tok "<<([\\'\"]?)([a-zA-Z_][a-zA-Z0-9_]*)\\1;?\\n.*?\\n\\2\\n" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "__END__" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo endPart')+ , tok "\\$\\^[ADEFHILMOPSTWX]" (Arbitrary "Name" :. Arbitrary "Variable" :. Arbitrary "Global")+ , tok "\\$[\\\\\\\"\\[\\]'&`+*.,;=%\126?@$!<>(^|/-](?!\\w)" (Arbitrary "Name" :. Arbitrary "Variable" :. Arbitrary "Global")+ , tokNext "[$@%#]+" (Arbitrary "Name" :. Arbitrary "Variable") (GoTo varname')+ , tok "0_?[0-7]+(_[0-7]+)*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "0x[0-9A-Fa-f]+(_[0-9A-Fa-f]+)*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "0b[01]+(_[01]+)*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Bin")+ , tok "(?i)(\\d*(_\\d*)*\\.\\d+(_\\d*)*|\\d+(_\\d*)*\\.\\d+(_\\d*)*)(e[+-]?\\d+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "(?i)\\d+(_\\d*)*e[+-]?\\d+(_\\d*)*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "\\d+(_\\d+)*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "'(\\\\\\\\|\\\\'|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "`(\\\\\\\\|\\\\`|[^`])*`" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Backtick")+ , tok "<([^\\s>]+)>" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ , tokNext "(q|qq|qw|qr|qx)\\{" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other") (GoTo cbString')+ , tokNext "(q|qq|qw|qr|qx)\\(" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other") (GoTo rbString')+ , tokNext "(q|qq|qw|qr|qx)\\[" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other") (GoTo sbString')+ , tokNext "(q|qq|qw|qr|qx)\\<" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other") (GoTo ltString')+ , tok "(q|qq|qw|qr|qx)([^a-zA-Z0-9])(.|\\n)*?\\2" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ , tokNext "package\\s+" (Arbitrary "Keyword") (GoTo modulename')+ , tokNext "sub\\s+" (Arbitrary "Keyword") (GoTo funcname')+ , tok "(\\[\\]|\\*\\*|::|<<|>>|>=|<=|<=>|={3}|!=|=\126|!\126|&&?|\\|\\||\\.{1,3})" (Arbitrary "Operator")+ , tok "[-+/*%=<>&^|!\\\\\126]=?" (Arbitrary "Operator")+ , tok "[\\(\\)\\[\\]:;,<>/\\?\\{\\}]" (Arbitrary "Punctuation")+ , tokNext "(?=\\w)" (Arbitrary "Name") (GoTo name')+ ]++cbString' :: TokenMatcher+cbString' =+ [ tok "\\\\[\\{\\}\\\\]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ , tok "\\\\" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ , tokNext "\\{" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other") (GoTo cbString')+ , tokNext "\\}" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other") Pop+ , tok "[^\\{\\}\\\\]+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ ]++ltString' :: TokenMatcher+ltString' =+ [ tok "\\\\[\\<\\>\\\\]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ , tok "\\\\" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ , tokNext "\\<" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other") (GoTo ltString')+ , tokNext "\\>" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other") Pop+ , tok "[^\\<\\>]+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ ]+
+ src/Text/Highlighter/Lexers/Php.hs view
@@ -0,0 +1,76 @@+module Text.Highlighter.Lexers.Php (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "PHP"+ , lAliases = ["php", "php3", "php4", "php5"]+ , lExtensions = [".php", ".php[345]"]+ , lMimetypes = ["text/x-php"]+ , lStart = root'+ , lFlags = [caseless, multiline, dotall]+ }++classname' :: TokenMatcher+classname' =+ [ tokNext "[a-zA-Z_][\\\\a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Class") Pop+ ]++php' :: TokenMatcher+php' =+ [ tokNext "\\?>" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ , tok "<<<(\\'?)([a-zA-Z_][a-zA-Z0-9_]*)\\1\\n.*?\\n\\2\\;?\\n" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\s+" (Arbitrary "Text")+ , tok "#.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "//.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/\\*\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "/\\*\\*.*?\\*/" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Doc")+ , tok "/\\*.*?\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "(->|::)(\\s*)([a-zA-Z_][a-zA-Z0-9_]*)" (ByGroups [(Arbitrary "Operator"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Attribute")])+ , tok "[\126!%^&*+=|:.<>/?@-]+" (Arbitrary "Operator")+ , tok "[\\[\\]{}();,]+" (Arbitrary "Punctuation")+ , tokNext "(class)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo classname')+ , tok "(function)(\\s*)(?=\\()" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")])+ , tokNext "(function)(\\s+)(&?)(\\s*)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Operator"), (Arbitrary "Text")]) (GoTo functionname')+ , tok "(const)(\\s+)([a-zA-Z_][a-zA-Z0-9_]*)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Constant")])+ , tok "(and|E_PARSE|old_function|E_ERROR|or|as|E_WARNING|parent|eval|PHP_OS|break|exit|case|extends|PHP_VERSION|cfunction|FALSE|print|for|require|continue|foreach|require_once|declare|return|default|static|do|switch|die|stdClass|echo|else|TRUE|elseif|var|empty|if|xor|enddeclare|include|virtual|endfor|include_once|while|endforeach|global|__FILE__|endif|list|__LINE__|endswitch|new|__sleep|endwhile|not|array|__wakeup|E_ALL|NULL|final|php_user_filter|interface|implements|public|private|protected|abstract|clone|try|catch|throw|this|use|namespace)\\b" (Arbitrary "Keyword")+ , tok "(true|false|null)\8" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tok "\\$\\{\\$+[a-zA-Z_][a-zA-Z0-9_]*\\}" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "\\$+[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "[\\\\a-zA-Z_][\\\\a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Other")+ , tok "(\\d+\\.\\d*|\\d*\\.\\d+)([eE][+-]?[0-9]+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "\\d+[eE][+-]?[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0[0-7]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "0[xX][a-fA-F0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "`([^`\\\\]*(?:\\\\.[^`\\\\]*)*)`" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Backtick")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") (GoTo string')+ ]++root' :: TokenMatcher+root' =+ [ tokNext "<\\?(php)?" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo php')+ , tok "[^<]+" (Arbitrary "Other")+ , tok "<" (Arbitrary "Other")+ ]++functionname' :: TokenMatcher+functionname' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Function") Pop+ ]++string' :: TokenMatcher+string' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") Pop+ , tok "[^{$\"\\\\]+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "\\\\([nrt\\\"$\\\\]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2})" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "\\$[a-zA-Z_][a-zA-Z0-9_]*(\\[\\S+\\]|->[a-zA-Z_][a-zA-Z0-9_]*)?" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol")+ , tok "(\\{\\$\\{)(.*?)(\\}\\})" (ByGroups [(Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol"), (Using lexer), (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol")])+ , tok "(\\{)(\\$.*?)(\\})" (ByGroups [(Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol"), (Using lexer), (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol")])+ , tok "(\\$\\{)(\\S+)(\\})" (ByGroups [(Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol"), (Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol")])+ , tok "[${\\\\]+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ ]+
+ src/Text/Highlighter/Lexers/PostScript.hs view
@@ -0,0 +1,48 @@+module Text.Highlighter.Lexers.PostScript (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "PostScript"+ , lAliases = ["postscript"]+ , lExtensions = [".ps", ".eps"]+ , lMimetypes = ["application/postscript"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "^%!.+\\n" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "%%.*\\n" (Arbitrary "Comment" :. Arbitrary "Special")+ , tok "(^%.*\\n){2,}" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "%.*\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tokNext "\\(" (Arbitrary "Literal" :. Arbitrary "String") (GoTo stringliteral')+ , tok "[\\{\\}(\\<\\<)(\\>\\>)\\[\\]]" (Arbitrary "Punctuation")+ , tok "<[0-9A-Fa-f]+>(?=[\\(\\)\\<\\>\\[\\]\\{\\}\\/\\%\\s])" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "[0-9]+\\#(\\-|\\+)?([0-9]+\\.?|[0-9]*\\.[0-9]+|[0-9]+\\.[0-9]*)((e|E)[0-9]+)?(?=[\\(\\)\\<\\>\\[\\]\\{\\}\\/\\%\\s])" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "(\\-|\\+)?([0-9]+\\.?|[0-9]*\\.[0-9]+|[0-9]+\\.[0-9]*)((e|E)[0-9]+)?(?=[\\(\\)\\<\\>\\[\\]\\{\\}\\/\\%\\s])" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "(\\-|\\+)?[0-9]+(?=[\\(\\)\\<\\>\\[\\]\\{\\}\\/\\%\\s])" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\\/[^\\(\\)\\<\\>\\[\\]\\{\\}\\/\\%\\s]+(?=[\\(\\)\\<\\>\\[\\]\\{\\}\\/\\%\\s])" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "[^\\(\\)\\<\\>\\[\\]\\{\\}\\/\\%\\s]+(?=[\\(\\)\\<\\>\\[\\]\\{\\}\\/\\%\\s])" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "(false|true)(?=[\\(\\)\\<\\>\\[\\]\\{\\}\\/\\%\\s])" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tok "(eq|ne|ge|gt|le|lt|and|or|not|if|ifelse|for|forall)(?=[\\(\\)\\<\\>\\[\\]\\{\\}\\/\\%\\s])" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ , tok "(abs|add|aload|arc|arcn|array|atan|begin|bind|ceiling|charpath|clip|closepath|concat|concatmatrix|copy|cos|currentlinewidth|currentmatrix|currentpoint|curveto|cvi|cvs|def|defaultmatrix|dict|dictstackoverflow|div|dtransform|dup|end|exch|exec|exit|exp|fill|findfont|floor|get|getinterval|grestore|gsave|gt|identmatrix|idiv|idtransform|index|invertmatrix|itransform|length|lineto|ln|load|log|loop|matrix|mod|moveto|mul|neg|newpath|pathforall|pathbbox|pop|print|pstack|put|quit|rand|rangecheck|rcurveto|repeat|restore|rlineto|rmoveto|roll|rotate|round|run|save|scale|scalefont|setdash|setfont|setgray|setlinecap|setlinejoin|setlinewidth|setmatrix|setrgbcolor|shfill|show|showpage|sin|sqrt|stack|stringwidth|stroke|strokepath|sub|syntaxerror|transform|translate|truncate|typecheck|undefined|undefinedfilename|undefinedresult)(?=[\\(\\)\\<\\>\\[\\]\\{\\}\\/\\%\\s])" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "\\s+" (Arbitrary "Text")+ ]++stringliteral' :: TokenMatcher+stringliteral' =+ [ tok "[^\\(\\)\\\\]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "\\\\" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape") (GoTo escape')+ , tokNext "\\(" (Arbitrary "Literal" :. Arbitrary "String") Push+ , tokNext "\\)" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]++escape' :: TokenMatcher+escape' =+ [ tokNext "([0-8]{3}|n|r|t|b|f|\\\\|\\(|\\)|)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape") Pop+ ]+
+ src/Text/Highlighter/Lexers/Povray.hs view
@@ -0,0 +1,33 @@+module Text.Highlighter.Lexers.Povray (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "POVRay"+ , lAliases = ["pov"]+ , lExtensions = [".pov", ".inc"]+ , lMimetypes = ["text/x-povray"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "/\\*[\\w\\W]*?\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "//.*\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "(?s)\"(?:\\\\.|[^\"\\\\])+\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "#(debug|default|else|end|error|fclose|fopen|if|ifdef|ifndef|include|range|read|render|statistics|switch|undef|version|warning|while|write|define|macro|local|declare)" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "\\b(aa_level|aa_threshold|abs|acos|acosh|adaptive|adc_bailout|agate|agate_turb|all|alpha|ambient|ambient_light|angle|aperture|arc_angle|area_light|asc|asin|asinh|assumed_gamma|atan|atan2|atanh|atmosphere|atmospheric_attenuation|attenuating|average|background|black_hole|blue|blur_samples|bounded_by|box_mapping|bozo|break|brick|brick_size|brightness|brilliance|bumps|bumpy1|bumpy2|bumpy3|bump_map|bump_size|case|caustics|ceil|checker|chr|clipped_by|clock|color|color_map|colour|colour_map|component|composite|concat|confidence|conic_sweep|constant|control0|control1|cos|cosh|count|crackle|crand|cube|cubic_spline|cylindrical_mapping|debug|declare|default|degrees|dents|diffuse|direction|distance|distance_maximum|div|dust|dust_type|eccentricity|else|emitting|end|error|error_bound|exp|exponent|fade_distance|fade_power|falloff|falloff_angle|false|file_exists|filter|finish|fisheye|flatness|flip|floor|focal_point|fog|fog_alt|fog_offset|fog_type|frequency|gif|global_settings|glowing|gradient|granite|gray_threshold|green|halo|hexagon|hf_gray_16|hierarchy|hollow|hypercomplex|if|ifdef|iff|image_map|incidence|include|int|interpolate|inverse|ior|irid|irid_wavelength|jitter|lambda|leopard|linear|linear_spline|linear_sweep|location|log|looks_like|look_at|low_error_factor|mandel|map_type|marble|material_map|matrix|max|max_intersections|max_iteration|max_trace_level|max_value|metallic|min|minimum_reuse|mod|mortar|nearest_count|no|normal|normal_map|no_shadow|number_of_waves|octaves|off|offset|omega|omnimax|on|once|onion|open|orthographic|panoramic|pattern1|pattern2|pattern3|perspective|pgm|phase|phong|phong_size|pi|pigment|pigment_map|planar_mapping|png|point_at|pot|pow|ppm|precision|pwr|quadratic_spline|quaternion|quick_color|quick_colour|quilted|radial|radians|radiosity|radius|rainbow|ramp_wave|rand|range|reciprocal|recursion_limit|red|reflection|refraction|render|repeat|rgb|rgbf|rgbft|rgbt|right|ripples|rotate|roughness|samples|scale|scallop_wave|scattering|seed|shadowless|sin|sine_wave|sinh|sky|sky_sphere|slice|slope_map|smooth|specular|spherical_mapping|spiral|spiral1|spiral2|spotlight|spotted|sqr|sqrt|statistics|str|strcmp|strength|strlen|strlwr|strupr|sturm|substr|switch|sys|t|tan|tanh|test_camera_1|test_camera_2|test_camera_3|test_camera_4|texture|texture_map|tga|thickness|threshold|tightness|tile2|tiles|track|transform|translate|transmit|triangle_wave|true|ttf|turbulence|turb_depth|type|ultra_wide_angle|up|use_color|use_colour|use_index|u_steps|val|variance|vaxis_rotate|vcross|vdot|version|vlength|vnormalize|volume_object|volume_rendered|vol_with_light|vrotate|v_steps|warning|warp|water_level|waves|while|width|wood|wrinkles|yes)\\b" (Arbitrary "Keyword")+ , tok "bicubic_patch|blob|box|camera|cone|cubic|cylinder|difference|disc|height_field|intersection|julia_fractal|lathe|light_source|merge|mesh|object|plane|poly|polygon|prism|quadric|quartic|smooth_triangle|sor|sphere|superellipsoid|text|torus|triangle|union" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "[\\[\\](){}<>;,]" (Arbitrary "Punctuation")+ , tok "[-+*/=]" (Arbitrary "Operator")+ , tok "\\b(x|y|z|u|v)\\b" (Arbitrary "Name" :. Arbitrary "Builtin" :. Arbitrary "Pseudo")+ , tok "[a-zA-Z_][a-zA-Z_0-9]*" (Arbitrary "Name")+ , tok "[0-9]+\\.[0-9]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "\\.[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\\s+" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Prolog.hs view
@@ -0,0 +1,45 @@+module Text.Highlighter.Lexers.Prolog (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Prolog"+ , lAliases = ["prolog"]+ , lExtensions = [".prolog", ".pro", ".pl"]+ , lMimetypes = ["text/x-prolog"]+ , lStart = root'+ , lFlags = [utf8]+ }++nestedComment' :: TokenMatcher+nestedComment' =+ [ tokNext "\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline") Pop+ , tokNext "/\\*" (Arbitrary "Comment" :. Arbitrary "Multiline") Push+ , tok "[^*/]+" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "[*/]" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]++root' :: TokenMatcher+root' =+ [ tok "^#.*" (Arbitrary "Comment" :. Arbitrary "Single")+ , tokNext "/\\*" (Arbitrary "Comment" :. Arbitrary "Multiline") (GoTo nestedComment')+ , tok "%.*" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "[\\[\\](){}|.,;!]" (Arbitrary "Punctuation")+ , tok ":-|-->" (Arbitrary "Punctuation")+ , tok "\"(?:\\\\x[0-9a-fA-F]+\\\\|\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}|\\\\[0-7]+\\\\|\\\\[\\w\\W]|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "'(?:''|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Atom")+ , tok "(is|<|>|=<|>=|==|=:=|=|/|//|\\*|\\+|-)(?=\\s|[a-zA-Z0-9\\[])" (Arbitrary "Operator")+ , tok "(mod|div|not)\\b" (Arbitrary "Operator")+ , tok "_" (Arbitrary "Keyword")+ , tok "([a-z]+)(:)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Namespace"), (Arbitrary "Punctuation")])+ , tok "([a-z\192-\8191\12352-\55295\57344-\65519][a-zA-Z0-9_$\192-\8191\12352-\55295\57344-\65519]*)(\\s*)(:-|-->)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Operator")])+ , tok "([a-z\192-\8191\12352-\55295\57344-\65519][a-zA-Z0-9_$\192-\8191\12352-\55295\57344-\65519]*)(\\s*)(\\()" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Punctuation")])+ , tok "[a-z\192-\8191\12352-\55295\57344-\65519][a-zA-Z0-9_$\192-\8191\12352-\55295\57344-\65519]*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Atom")+ , tok "[#&*+\\-./:<=>?@\\\\^\126\161-\191\8208-\12351]+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Atom")+ , tok "[A-Z_][A-Za-z0-9_]*" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "\\s+|[\8192-\8207\65520-\65534\65519]" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Properties.hs view
@@ -0,0 +1,22 @@+module Text.Highlighter.Lexers.Properties (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Properties"+ , lAliases = ["properties"]+ , lExtensions = [".properties"]+ , lMimetypes = ["text/x-java-properties"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "(?:[;#]|//).*$" (Arbitrary "Comment")+ , tok "(.*?)([ \\t]*)([=:])([ \\t]*)(.*(?:(?<=\\\\)\\n.*)*)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Attribute"), (Arbitrary "Text"), (Arbitrary "Operator"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String")])+ ]+
+ src/Text/Highlighter/Lexers/ProtoBuf.hs view
@@ -0,0 +1,54 @@+module Text.Highlighter.Lexers.ProtoBuf (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Protocol Buffer"+ , lAliases = ["protobuf"]+ , lExtensions = [".proto"]+ , lMimetypes = []+ , lStart = root'+ , lFlags = [multiline]+ }++type' :: TokenMatcher+type' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name") Pop+ ]++message' :: TokenMatcher+message' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Class") Pop+ ]++root' :: TokenMatcher+root' =+ [ tok "[ \\t]+" (Arbitrary "Text")+ , tok "[,;{}\\[\\]\\(\\)]" (Arbitrary "Punctuation")+ , tok "/(\\\\\\n)?/(\\n|(.|\\n)*?[^\\\\]\\n)" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/(\\\\\\n)?[*](.|\\n)*?[*](\\\\\\n)?/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "\\b(import|option|optional|required|repeated|default|packed|ctype|extensions|to|max|rpc|returns)\\b" (Arbitrary "Keyword")+ , tok "(int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|float|double|bool|string|bytes)\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "(true|false)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tokNext "(package)(\\s+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text")]) (GoTo package')+ , tokNext "(message|extend)(\\s+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Declaration"), (Arbitrary "Text")]) (GoTo message')+ , tokNext "(enum|group|service)(\\s+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Declaration"), (Arbitrary "Text")]) (GoTo type')+ , tok "\\\".*\\\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+)[eE][+-]?\\d+[LlUu]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+[fF])[fF]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "(\\-?(inf|nan))" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0x[0-9a-fA-F]+[LlUu]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "0[0-7]+[LlUu]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "\\d+[LlUu]*" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "[+-=]" (Arbitrary "Operator")+ , tok "([a-zA-Z_][a-zA-Z0-9_\\.]*)([ \\t]*)(=)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Attribute"), (Arbitrary "Text"), (Arbitrary "Operator")])+ , tok "[a-zA-Z_][a-zA-Z0-9_\\.]*" (Arbitrary "Name")+ ]++package' :: TokenMatcher+package' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Namespace") Pop+ ]+
+ src/Text/Highlighter/Lexers/Python.hs view
@@ -0,0 +1,149 @@+module Text.Highlighter.Lexers.Python (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Python"+ , lAliases = ["python", "py"]+ , lExtensions = [".py", ".pyw", ".sc", "SConstruct", "SConscript", ".tac"]+ , lMimetypes = ["text/x-python", "application/x-python"]+ , lStart = root'+ , lFlags = [multiline]+ }++tsqs' :: TokenMatcher+tsqs' =+ [ tokNext "'''" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , anyOf strings'+ , anyOf nl'+ ]++builtins' :: TokenMatcher+builtins' =+ [ tok "(?<!\\.)(__import__|abs|all|any|apply|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|exit|file|filter|float|frozenset|getattr|globals|hasattr|hash|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(?<!\\.)(self|None|Ellipsis|NotImplemented|False|True)\\b" (Arbitrary "Name" :. Arbitrary "Builtin" :. Arbitrary "Pseudo")+ , tok "(?<!\\.)(ArithmeticError|AssertionError|AttributeError|BaseException|DeprecationWarning|EOFError|EnvironmentError|Exception|FloatingPointError|FutureWarning|GeneratorExit|IOError|ImportError|ImportWarning|IndentationError|IndexError|KeyError|KeyboardInterrupt|LookupError|MemoryError|NameError|NotImplemented|NotImplementedError|OSError|OverflowError|OverflowWarning|PendingDeprecationWarning|ReferenceError|RuntimeError|RuntimeWarning|StandardError|StopIteration|SyntaxError|SyntaxWarning|SystemError|SystemExit|TabError|TypeError|UnboundLocalError|UnicodeDecodeError|UnicodeEncodeError|UnicodeError|UnicodeTranslateError|UnicodeWarning|UserWarning|ValueError|VMSError|Warning|WindowsError|ZeroDivisionError)\\b" (Arbitrary "Name" :. Arbitrary "Exception")+ ]++name' :: TokenMatcher+name' =+ [ tok "@[a-zA-Z0-9_.]+" (Arbitrary "Name" :. Arbitrary "Decorator")+ , tok "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name")+ ]++dqs' :: TokenMatcher+dqs' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\\\\\|\\\\\"|\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , anyOf strings'+ ]++sqs' :: TokenMatcher+sqs' =+ [ tokNext "'" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\\\\\|\\\\'|\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , anyOf strings'+ ]++tdqs' :: TokenMatcher+tdqs' =+ [ tokNext "\"\"\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , anyOf strings'+ , anyOf nl'+ ]++backtick' :: TokenMatcher+backtick' =+ [ tok "`.*?`" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Backtick")+ ]++funcname' :: TokenMatcher+funcname' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Function") Pop+ ]++classname' :: TokenMatcher+classname' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Class") Pop+ ]++stringescape' :: TokenMatcher+stringescape' =+ [ tok "\\\\([\\\\abfnrtv\"\\']|\\n|N{.*?}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ ]++numbers' :: TokenMatcher+numbers' =+ [ tok "(\\d+\\.\\d*|\\d*\\.\\d+)([eE][+-]?[0-9]+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "\\d+[eE][+-]?[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0[0-7]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "0[xX][a-fA-F0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "\\d+L" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer" :. Arbitrary "Long")+ , tok "\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ ]++keywords' :: TokenMatcher+keywords' =+ [ tok "(assert|break|continue|del|elif|else|except|exec|finally|for|global|if|lambda|pass|print|raise|return|try|while|yield|as|with)\\b" (Arbitrary "Keyword")+ ]++import' :: TokenMatcher+import' =+ [ tok "((?:\\s|\\\\\\s)+)(as)((?:\\s|\\\\\\s)+)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text")])+ , tok "[a-zA-Z_][a-zA-Z0-9_.]*" (Arbitrary "Name" :. Arbitrary "Namespace")+ , tok "(\\s*)(,)(\\s*)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Operator"), (Arbitrary "Text")])+ , tokNext "" (Arbitrary "Text") Pop+ ]++nl' :: TokenMatcher+nl' =+ [ tok "\\n" (Arbitrary "Literal" :. Arbitrary "String")+ ]++root' :: TokenMatcher+root' =+ [ tok "\\n" (Arbitrary "Text")+ , tok "^(\\s*)([rRuU]{,2}\"\"\"(?:.|\\n)*?\"\"\")" (ByGroups [(Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Doc")])+ , tok "^(\\s*)([rRuU]{,2}'''(?:.|\\n)*?''')" (ByGroups [(Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Doc")])+ , tok "[^\\S\\n]+" (Arbitrary "Text")+ , tok "#.*$" (Arbitrary "Comment")+ , tok "[]{}:(),;[]" (Arbitrary "Punctuation")+ , tok "\\\\\\n" (Arbitrary "Text")+ , tok "\\\\" (Arbitrary "Text")+ , tok "(in|is|and|or|not)\\b" (Arbitrary "Operator" :. Arbitrary "Word")+ , tok "!=|==|<<|>>|[-\126+/*%=<>&^|.]" (Arbitrary "Operator")+ , anyOf keywords'+ , tokNext "(def)((?:\\s|\\\\\\s)+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo funcname')+ , tokNext "(class)((?:\\s|\\\\\\s)+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo classname')+ , tokNext "(from)((?:\\s|\\\\\\s)+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text")]) (GoTo fromimport')+ , tokNext "(import)((?:\\s|\\\\\\s)+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text")]) (GoTo import')+ , anyOf builtins'+ , anyOf backtick'+ , tokNext "(?:[rR]|[uU][rR]|[rR][uU])\"\"\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo tdqs')+ , tokNext "(?:[rR]|[uU][rR]|[rR][uU])'''" (Arbitrary "Literal" :. Arbitrary "String") (GoTo tsqs')+ , tokNext "(?:[rR]|[uU][rR]|[rR][uU])\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo dqs')+ , tokNext "(?:[rR]|[uU][rR]|[rR][uU])'" (Arbitrary "Literal" :. Arbitrary "String") (GoTo sqs')+ , tokNext "[uU]?\"\"\"" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', tdqs'])+ , tokNext "[uU]?'''" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', tsqs'])+ , tokNext "[uU]?\"" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', dqs'])+ , tokNext "[uU]?'" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', sqs'])+ , anyOf name'+ , anyOf numbers'+ ]++strings' :: TokenMatcher+strings' =+ [ tok "%(\\([a-zA-Z0-9_]+\\))?[-#0 +]*([0-9]+|[*])?(\\.([0-9]+|[*]))?[hlL]?[diouxXeEfFgGcrs%]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol")+ , tok "[^\\\\\\'\"%\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "[\\'\"\\\\]" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "%" (Arbitrary "Literal" :. Arbitrary "String")+ ]++fromimport' :: TokenMatcher+fromimport' =+ [ tokNext "((?:\\s|\\\\\\s)+)(import)\\b" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword" :. Arbitrary "Namespace")]) Pop+ , tok "[a-zA-Z_.][a-zA-Z0-9_.]*" (Arbitrary "Name" :. Arbitrary "Namespace")+ ]+
+ src/Text/Highlighter/Lexers/Python3.hs view
@@ -0,0 +1,149 @@+module Text.Highlighter.Lexers.Python3 (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Python 3"+ , lAliases = ["python3", "py3"]+ , lExtensions = []+ , lMimetypes = ["text/x-python3", "application/x-python3"]+ , lStart = root'+ , lFlags = [multiline, utf8]+ }++tsqs' :: TokenMatcher+tsqs' =+ [ tokNext "'''" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , anyOf strings'+ , anyOf nl'+ ]++sqs' :: TokenMatcher+sqs' =+ [ tokNext "'" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\\\\\|\\\\'|\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , anyOf strings'+ ]++backtick' :: TokenMatcher+backtick' =+ [ + ]++classname' :: TokenMatcher+classname' =+ [ tokNext "[A-Z_a-z\170\181\186\192-\214\216-\246\248-\442\443\444-\447\448-\451\452-\577\592-\687\688-\705\710-\721\736-\740\750\902\904-\906\908\910-\929\931-\974\976-\1013\1015-\1153\1162-\1230\1232-\1273\1280-\1295\1329-\1366\1369\1377-\1415\1488-\1514\1520-\1522\1569-\1594\1600\1601-\1610\1646-\1647\1649-\1747\1749\1765-\1766\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1901\1920-\1957\1969\2308-\2361\2365\2384\2392-\2401\2429\2437-\2444\2447-\2448\2451-\2472\2474-\2480\2482\2486-\2489\2493\2510\2524-\2525\2527-\2529\2544-\2545\2565-\2570\2575-\2576\2579-\2600\2602-\2608\2610-\2611\2613-\2614\2616-\2617\2649-\2652\2654\2674-\2676\2693-\2701\2703-\2705\2707-\2728\2730-\2736\2738-\2739\2741-\2745\2749\2768\2784-\2785\2821-\2828\2831-\2832\2835-\2856\2858-\2864\2866-\2867\2869-\2873\2877\2908-\2909\2911-\2913\2929\2947\2949-\2954\2958-\2960\2962-\2965\2969-\2970\2972\2974-\2975\2979-\2980\2984-\2986\2990-\3001\3077-\3084\3086-\3088\3090-\3112\3114-\3123\3125-\3129\3168-\3169\3205-\3212\3214-\3216\3218-\3240\3242-\3251\3253-\3257\3261\3294\3296-\3297\3333-\3340\3342-\3344\3346-\3368\3370-\3385\3424-\3425\3461-\3478\3482-\3505\3507-\3515\3517\3520-\3526\3585-\3632\3634\3648-\3653\3654\3713-\3714\3716\3719-\3720\3722\3725\3732-\3735\3737-\3743\3745-\3747\3749\3751\3754-\3755\3757-\3760\3762\3773\3776-\3780\3782\3804-\3805\3840\3904-\3911\3913-\3946\3976-\3979\4096-\4129\4131-\4135\4137-\4138\4176-\4181\4256-\4293\4304-\4346\4348\4352-\4441\4447-\4514\4520-\4601\4608-\4680\4682-\4685\4688-\4694\4696\4698-\4701\4704-\4744\4746-\4749\4752-\4784\4786-\4789\4792-\4798\4800\4802-\4805\4808-\4822\4824-\4880\4882-\4885\4888-\4954\4992-\5007\5024-\5108\5121-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5872\5888-\5900\5902-\5905\5920-\5937\5952-\5969\5984-\5996\5998-\6000\6016-\6067\6103\6108\6176-\6210\6211\6212-\6263\6272-\6312\6400-\6428\6480-\6509\6512-\6516\6528-\6569\6593-\6599\6656-\6678\7424-\7467\7468-\7521\7522-\7543\7544\7545-\7578\7579-\7615\7680-\7835\7840-\7929\7936-\7957\7960-\7965\7968-\8005\8008-\8013\8016-\8023\8025\8027\8029\8031-\8061\8064-\8116\8118-\8124\8126\8130-\8132\8134-\8140\8144-\8147\8150-\8155\8160-\8172\8178-\8180\8182-\8188\8305\8319\8336-\8340\8450\8455\8458-\8467\8469\8472\8473-\8477\8484\8486\8488\8490-\8493\8494\8495-\8497\8499-\8500\8501-\8504\8505\8508-\8511\8517-\8521\8544-\8579\11264-\11310\11312-\11358\11392-\11492\11520-\11557\11568-\11621\11631\11648-\11670\11680-\11686\11688-\11694\11696-\11702\11704-\11710\11712-\11718\11720-\11726\11728-\11734\11736-\11742\12293\12294\12295\12321-\12329\12337-\12341\12344-\12346\12347\12348\12353-\12438\12445-\12446\12447\12449-\12538\12540-\12542\12543\12549-\12588\12593-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40891\40960-\40980\40981\40982-\42124\43008-\43009\43011-\43013\43015-\43018\43020-\43042\44032-\55203\63744-\64045\64048-\64106\64112-\64217\64256-\64262\64275-\64279\64285\64287-\64296\64298-\64310\64312-\64316\64318\64320-\64321\64323-\64324\64326-\64433\64467-\64605\64612-\64829\64848-\64911\64914-\64967\65008-\65017\65137\65139\65143\65145\65147\65149\65151-\65276\65313-\65338\65345-\65370\65382-\65391\65392\65393-\65437\65440-\65470\65474-\65479\65482-\65487\65490-\65495\65498-\65500][0-9A-Z_a-z\170\181\183\186\192-\214\216-\246\248-\442\443\444-\447\448-\451\452-\577\592-\687\688-\705\710-\721\736-\740\750\768-\879\902\904-\906\908\910-\929\931-\974\976-\1013\1015-\1153\1155-\1158\1162-\1230\1232-\1273\1280-\1295\1329-\1366\1369\1377-\1415\1425-\1465\1467-\1469\1471\1473-\1474\1476-\1477\1479\1488-\1514\1520-\1522\1552-\1557\1569-\1594\1600\1601-\1610\1611-\1630\1632-\1641\1646-\1647\1648\1649-\1747\1749\1750-\1756\1759-\1764\1765-\1766\1767-\1768\1770-\1773\1774-\1775\1776-\1785\1786-\1788\1791\1808\1809\1810-\1839\1840-\1866\1869-\1901\1920-\1957\1958-\1968\1969\2305-\2306\2307\2308-\2361\2364\2365\2366-\2368\2369-\2376\2377-\2380\2381\2384\2385-\2388\2392-\2401\2402-\2403\2406-\2415\2429\2433\2434-\2435\2437-\2444\2447-\2448\2451-\2472\2474-\2480\2482\2486-\2489\2492\2493\2494-\2496\2497-\2500\2503-\2504\2507-\2508\2509\2510\2519\2524-\2525\2527-\2529\2530-\2531\2534-\2543\2544-\2545\2561-\2562\2563\2565-\2570\2575-\2576\2579-\2600\2602-\2608\2610-\2611\2613-\2614\2616-\2617\2620\2622-\2624\2625-\2626\2631-\2632\2635-\2637\2649-\2652\2654\2662-\2671\2672-\2673\2674-\2676\2689-\2690\2691\2693-\2701\2703-\2705\2707-\2728\2730-\2736\2738-\2739\2741-\2745\2748\2749\2750-\2752\2753-\2757\2759-\2760\2761\2763-\2764\2765\2768\2784-\2785\2786-\2787\2790-\2799\2817\2818-\2819\2821-\2828\2831-\2832\2835-\2856\2858-\2864\2866-\2867\2869-\2873\2876\2877\2878\2879\2880\2881-\2883\2887-\2888\2891-\2892\2893\2902\2903\2908-\2909\2911-\2913\2918-\2927\2929\2946\2947\2949-\2954\2958-\2960\2962-\2965\2969-\2970\2972\2974-\2975\2979-\2980\2984-\2986\2990-\3001\3006-\3007\3008\3009-\3010\3014-\3016\3018-\3020\3021\3031\3046-\3055\3073-\3075\3077-\3084\3086-\3088\3090-\3112\3114-\3123\3125-\3129\3134-\3136\3137-\3140\3142-\3144\3146-\3149\3157-\3158\3168-\3169\3174-\3183\3202-\3203\3205-\3212\3214-\3216\3218-\3240\3242-\3251\3253-\3257\3260\3261\3262\3263\3264-\3268\3270\3271-\3272\3274-\3275\3276-\3277\3285-\3286\3294\3296-\3297\3302-\3311\3330-\3331\3333-\3340\3342-\3344\3346-\3368\3370-\3385\3390-\3392\3393-\3395\3398-\3400\3402-\3404\3405\3415\3424-\3425\3430-\3439\3458-\3459\3461-\3478\3482-\3505\3507-\3515\3517\3520-\3526\3530\3535-\3537\3538-\3540\3542\3544-\3551\3570-\3571\3585-\3632\3633\3634-\3635\3636-\3642\3648-\3653\3654\3655-\3662\3664-\3673\3713-\3714\3716\3719-\3720\3722\3725\3732-\3735\3737-\3743\3745-\3747\3749\3751\3754-\3755\3757-\3760\3761\3762-\3763\3764-\3769\3771-\3772\3773\3776-\3780\3782\3784-\3789\3792-\3801\3804-\3805\3840\3864-\3865\3872-\3881\3893\3895\3897\3902-\3903\3904-\3911\3913-\3946\3953-\3966\3967\3968-\3972\3974-\3975\3976-\3979\3984-\3991\3993-\4028\4038\4096-\4129\4131-\4135\4137-\4138\4140\4141-\4144\4145\4146\4150-\4151\4152\4153\4160-\4169\4176-\4181\4182-\4183\4184-\4185\4256-\4293\4304-\4346\4348\4352-\4441\4447-\4514\4520-\4601\4608-\4680\4682-\4685\4688-\4694\4696\4698-\4701\4704-\4744\4746-\4749\4752-\4784\4786-\4789\4792-\4798\4800\4802-\4805\4808-\4822\4824-\4880\4882-\4885\4888-\4954\4959\4969-\4977\4992-\5007\5024-\5108\5121-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5872\5888-\5900\5902-\5905\5906-\5908\5920-\5937\5938-\5940\5952-\5969\5970-\5971\5984-\5996\5998-\6000\6002-\6003\6016-\6067\6070\6071-\6077\6078-\6085\6086\6087-\6088\6089-\6099\6103\6108\6109\6112-\6121\6155-\6157\6160-\6169\6176-\6210\6211\6212-\6263\6272-\6312\6313\6400-\6428\6432-\6434\6435-\6438\6439-\6440\6441-\6443\6448-\6449\6450\6451-\6456\6457-\6459\6470-\6479\6480-\6509\6512-\6516\6528-\6569\6576-\6592\6593-\6599\6600-\6601\6608-\6617\6656-\6678\6679-\6680\6681-\6683\7424-\7467\7468-\7521\7522-\7543\7544\7545-\7578\7579-\7615\7616-\7619\7680-\7835\7840-\7929\7936-\7957\7960-\7965\7968-\8005\8008-\8013\8016-\8023\8025\8027\8029\8031-\8061\8064-\8116\8118-\8124\8126\8130-\8132\8134-\8140\8144-\8147\8150-\8155\8160-\8172\8178-\8180\8182-\8188\8255-\8256\8276\8305\8319\8336-\8340\8400-\8412\8417\8421-\8427\8450\8455\8458-\8467\8469\8472\8473-\8477\8484\8486\8488\8490-\8493\8494\8495-\8497\8499-\8500\8501-\8504\8505\8508-\8511\8517-\8521\8544-\8579\11264-\11310\11312-\11358\11392-\11492\11520-\11557\11568-\11621\11631\11648-\11670\11680-\11686\11688-\11694\11696-\11702\11704-\11710\11712-\11718\11720-\11726\11728-\11734\11736-\11742\12293\12294\12295\12321-\12329\12330-\12335\12337-\12341\12344-\12346\12347\12348\12353-\12438\12441-\12442\12445-\12446\12447\12449-\12538\12540-\12542\12543\12549-\12588\12593-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40891\40960-\40980\40981\40982-\42124\43008-\43009\43010\43011-\43013\43014\43015-\43018\43019\43020-\43042\43043-\43044\43045-\43046\43047\44032-\55203\63744-\64045\64048-\64106\64112-\64217\64256-\64262\64275-\64279\64285\64286\64287-\64296\64298-\64310\64312-\64316\64318\64320-\64321\64323-\64324\64326-\64433\64467-\64605\64612-\64829\64848-\64911\64914-\64967\65008-\65017\65024-\65039\65056-\65059\65075-\65076\65101-\65103\65137\65139\65143\65145\65147\65149\65151-\65276\65296-\65305\65313-\65338\65343\65345-\65370\65382-\65391\65392\65393-\65437\65438-\65439\65440-\65470\65474-\65479\65482-\65487\65490-\65495\65498-\65500]*" (Arbitrary "Name" :. Arbitrary "Class") Pop+ ]++stringescape' :: TokenMatcher+stringescape' =+ [ tok "\\\\([\\\\abfnrtv\"\\']|\\n|N{.*?}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ ]++numbers' :: TokenMatcher+numbers' =+ [ tok "(\\d+\\.\\d*|\\d*\\.\\d+)([eE][+-]?[0-9]+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0[oO][0-7]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "0[bB][01]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Bin")+ , tok "0[xX][a-fA-F0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ ]++keywords' :: TokenMatcher+keywords' =+ [ tok "(assert|break|continue|del|elif|else|except|finally|for|global|if|lambda|pass|raise|return|try|while|yield|as|with|True|False|None)\\b" (Arbitrary "Keyword")+ ]++nl' :: TokenMatcher+nl' =+ [ tok "\\n" (Arbitrary "Literal" :. Arbitrary "String")+ ]++builtins' :: TokenMatcher+builtins' =+ [ tok "(?<!\\.)(__import__|abs|all|any|bin|bool|bytearray|bytes|chr|classmethod|cmp|compile|complex|delattr|dict|dir|divmod|enumerate|eval|filter|float|format|frozenset|getattr|globals|hasattr|hash|hex|id|input|int|isinstance|issubclass|iter|len|list|locals|map|max|memoryview|min|next|object|oct|open|ord|pow|print|property|range|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|vars|zip)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(?<!\\.)(self|Ellipsis|NotImplemented)\\b" (Arbitrary "Name" :. Arbitrary "Builtin" :. Arbitrary "Pseudo")+ , tok "(?<!\\.)(ArithmeticError|AssertionError|AttributeError|BaseException|BufferError|BytesWarning|DeprecationWarning|EOFError|EnvironmentError|Exception|FloatingPointError|FutureWarning|GeneratorExit|IOError|ImportError|ImportWarning|IndentationError|IndexError|KeyError|KeyboardInterrupt|LookupError|MemoryError|NameError|NotImplementedError|OSError|OverflowError|PendingDeprecationWarning|ReferenceError|RuntimeError|RuntimeWarning|StopIteration|SyntaxError|SyntaxWarning|SystemError|SystemExit|TabError|TypeError|UnboundLocalError|UnicodeDecodeError|UnicodeEncodeError|UnicodeError|UnicodeTranslateError|UnicodeWarning|UserWarning|ValueError|VMSError|Warning|WindowsError|ZeroDivisionError)\\b" (Arbitrary "Name" :. Arbitrary "Exception")+ ]++name' :: TokenMatcher+name' =+ [ tok "@[a-zA-Z0-9_]+" (Arbitrary "Name" :. Arbitrary "Decorator")+ , tok "[A-Z_a-z\170\181\186\192-\214\216-\246\248-\442\443\444-\447\448-\451\452-\577\592-\687\688-\705\710-\721\736-\740\750\902\904-\906\908\910-\929\931-\974\976-\1013\1015-\1153\1162-\1230\1232-\1273\1280-\1295\1329-\1366\1369\1377-\1415\1488-\1514\1520-\1522\1569-\1594\1600\1601-\1610\1646-\1647\1649-\1747\1749\1765-\1766\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1901\1920-\1957\1969\2308-\2361\2365\2384\2392-\2401\2429\2437-\2444\2447-\2448\2451-\2472\2474-\2480\2482\2486-\2489\2493\2510\2524-\2525\2527-\2529\2544-\2545\2565-\2570\2575-\2576\2579-\2600\2602-\2608\2610-\2611\2613-\2614\2616-\2617\2649-\2652\2654\2674-\2676\2693-\2701\2703-\2705\2707-\2728\2730-\2736\2738-\2739\2741-\2745\2749\2768\2784-\2785\2821-\2828\2831-\2832\2835-\2856\2858-\2864\2866-\2867\2869-\2873\2877\2908-\2909\2911-\2913\2929\2947\2949-\2954\2958-\2960\2962-\2965\2969-\2970\2972\2974-\2975\2979-\2980\2984-\2986\2990-\3001\3077-\3084\3086-\3088\3090-\3112\3114-\3123\3125-\3129\3168-\3169\3205-\3212\3214-\3216\3218-\3240\3242-\3251\3253-\3257\3261\3294\3296-\3297\3333-\3340\3342-\3344\3346-\3368\3370-\3385\3424-\3425\3461-\3478\3482-\3505\3507-\3515\3517\3520-\3526\3585-\3632\3634\3648-\3653\3654\3713-\3714\3716\3719-\3720\3722\3725\3732-\3735\3737-\3743\3745-\3747\3749\3751\3754-\3755\3757-\3760\3762\3773\3776-\3780\3782\3804-\3805\3840\3904-\3911\3913-\3946\3976-\3979\4096-\4129\4131-\4135\4137-\4138\4176-\4181\4256-\4293\4304-\4346\4348\4352-\4441\4447-\4514\4520-\4601\4608-\4680\4682-\4685\4688-\4694\4696\4698-\4701\4704-\4744\4746-\4749\4752-\4784\4786-\4789\4792-\4798\4800\4802-\4805\4808-\4822\4824-\4880\4882-\4885\4888-\4954\4992-\5007\5024-\5108\5121-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5872\5888-\5900\5902-\5905\5920-\5937\5952-\5969\5984-\5996\5998-\6000\6016-\6067\6103\6108\6176-\6210\6211\6212-\6263\6272-\6312\6400-\6428\6480-\6509\6512-\6516\6528-\6569\6593-\6599\6656-\6678\7424-\7467\7468-\7521\7522-\7543\7544\7545-\7578\7579-\7615\7680-\7835\7840-\7929\7936-\7957\7960-\7965\7968-\8005\8008-\8013\8016-\8023\8025\8027\8029\8031-\8061\8064-\8116\8118-\8124\8126\8130-\8132\8134-\8140\8144-\8147\8150-\8155\8160-\8172\8178-\8180\8182-\8188\8305\8319\8336-\8340\8450\8455\8458-\8467\8469\8472\8473-\8477\8484\8486\8488\8490-\8493\8494\8495-\8497\8499-\8500\8501-\8504\8505\8508-\8511\8517-\8521\8544-\8579\11264-\11310\11312-\11358\11392-\11492\11520-\11557\11568-\11621\11631\11648-\11670\11680-\11686\11688-\11694\11696-\11702\11704-\11710\11712-\11718\11720-\11726\11728-\11734\11736-\11742\12293\12294\12295\12321-\12329\12337-\12341\12344-\12346\12347\12348\12353-\12438\12445-\12446\12447\12449-\12538\12540-\12542\12543\12549-\12588\12593-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40891\40960-\40980\40981\40982-\42124\43008-\43009\43011-\43013\43015-\43018\43020-\43042\44032-\55203\63744-\64045\64048-\64106\64112-\64217\64256-\64262\64275-\64279\64285\64287-\64296\64298-\64310\64312-\64316\64318\64320-\64321\64323-\64324\64326-\64433\64467-\64605\64612-\64829\64848-\64911\64914-\64967\65008-\65017\65137\65139\65143\65145\65147\65149\65151-\65276\65313-\65338\65345-\65370\65382-\65391\65392\65393-\65437\65440-\65470\65474-\65479\65482-\65487\65490-\65495\65498-\65500][0-9A-Z_a-z\170\181\183\186\192-\214\216-\246\248-\442\443\444-\447\448-\451\452-\577\592-\687\688-\705\710-\721\736-\740\750\768-\879\902\904-\906\908\910-\929\931-\974\976-\1013\1015-\1153\1155-\1158\1162-\1230\1232-\1273\1280-\1295\1329-\1366\1369\1377-\1415\1425-\1465\1467-\1469\1471\1473-\1474\1476-\1477\1479\1488-\1514\1520-\1522\1552-\1557\1569-\1594\1600\1601-\1610\1611-\1630\1632-\1641\1646-\1647\1648\1649-\1747\1749\1750-\1756\1759-\1764\1765-\1766\1767-\1768\1770-\1773\1774-\1775\1776-\1785\1786-\1788\1791\1808\1809\1810-\1839\1840-\1866\1869-\1901\1920-\1957\1958-\1968\1969\2305-\2306\2307\2308-\2361\2364\2365\2366-\2368\2369-\2376\2377-\2380\2381\2384\2385-\2388\2392-\2401\2402-\2403\2406-\2415\2429\2433\2434-\2435\2437-\2444\2447-\2448\2451-\2472\2474-\2480\2482\2486-\2489\2492\2493\2494-\2496\2497-\2500\2503-\2504\2507-\2508\2509\2510\2519\2524-\2525\2527-\2529\2530-\2531\2534-\2543\2544-\2545\2561-\2562\2563\2565-\2570\2575-\2576\2579-\2600\2602-\2608\2610-\2611\2613-\2614\2616-\2617\2620\2622-\2624\2625-\2626\2631-\2632\2635-\2637\2649-\2652\2654\2662-\2671\2672-\2673\2674-\2676\2689-\2690\2691\2693-\2701\2703-\2705\2707-\2728\2730-\2736\2738-\2739\2741-\2745\2748\2749\2750-\2752\2753-\2757\2759-\2760\2761\2763-\2764\2765\2768\2784-\2785\2786-\2787\2790-\2799\2817\2818-\2819\2821-\2828\2831-\2832\2835-\2856\2858-\2864\2866-\2867\2869-\2873\2876\2877\2878\2879\2880\2881-\2883\2887-\2888\2891-\2892\2893\2902\2903\2908-\2909\2911-\2913\2918-\2927\2929\2946\2947\2949-\2954\2958-\2960\2962-\2965\2969-\2970\2972\2974-\2975\2979-\2980\2984-\2986\2990-\3001\3006-\3007\3008\3009-\3010\3014-\3016\3018-\3020\3021\3031\3046-\3055\3073-\3075\3077-\3084\3086-\3088\3090-\3112\3114-\3123\3125-\3129\3134-\3136\3137-\3140\3142-\3144\3146-\3149\3157-\3158\3168-\3169\3174-\3183\3202-\3203\3205-\3212\3214-\3216\3218-\3240\3242-\3251\3253-\3257\3260\3261\3262\3263\3264-\3268\3270\3271-\3272\3274-\3275\3276-\3277\3285-\3286\3294\3296-\3297\3302-\3311\3330-\3331\3333-\3340\3342-\3344\3346-\3368\3370-\3385\3390-\3392\3393-\3395\3398-\3400\3402-\3404\3405\3415\3424-\3425\3430-\3439\3458-\3459\3461-\3478\3482-\3505\3507-\3515\3517\3520-\3526\3530\3535-\3537\3538-\3540\3542\3544-\3551\3570-\3571\3585-\3632\3633\3634-\3635\3636-\3642\3648-\3653\3654\3655-\3662\3664-\3673\3713-\3714\3716\3719-\3720\3722\3725\3732-\3735\3737-\3743\3745-\3747\3749\3751\3754-\3755\3757-\3760\3761\3762-\3763\3764-\3769\3771-\3772\3773\3776-\3780\3782\3784-\3789\3792-\3801\3804-\3805\3840\3864-\3865\3872-\3881\3893\3895\3897\3902-\3903\3904-\3911\3913-\3946\3953-\3966\3967\3968-\3972\3974-\3975\3976-\3979\3984-\3991\3993-\4028\4038\4096-\4129\4131-\4135\4137-\4138\4140\4141-\4144\4145\4146\4150-\4151\4152\4153\4160-\4169\4176-\4181\4182-\4183\4184-\4185\4256-\4293\4304-\4346\4348\4352-\4441\4447-\4514\4520-\4601\4608-\4680\4682-\4685\4688-\4694\4696\4698-\4701\4704-\4744\4746-\4749\4752-\4784\4786-\4789\4792-\4798\4800\4802-\4805\4808-\4822\4824-\4880\4882-\4885\4888-\4954\4959\4969-\4977\4992-\5007\5024-\5108\5121-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5872\5888-\5900\5902-\5905\5906-\5908\5920-\5937\5938-\5940\5952-\5969\5970-\5971\5984-\5996\5998-\6000\6002-\6003\6016-\6067\6070\6071-\6077\6078-\6085\6086\6087-\6088\6089-\6099\6103\6108\6109\6112-\6121\6155-\6157\6160-\6169\6176-\6210\6211\6212-\6263\6272-\6312\6313\6400-\6428\6432-\6434\6435-\6438\6439-\6440\6441-\6443\6448-\6449\6450\6451-\6456\6457-\6459\6470-\6479\6480-\6509\6512-\6516\6528-\6569\6576-\6592\6593-\6599\6600-\6601\6608-\6617\6656-\6678\6679-\6680\6681-\6683\7424-\7467\7468-\7521\7522-\7543\7544\7545-\7578\7579-\7615\7616-\7619\7680-\7835\7840-\7929\7936-\7957\7960-\7965\7968-\8005\8008-\8013\8016-\8023\8025\8027\8029\8031-\8061\8064-\8116\8118-\8124\8126\8130-\8132\8134-\8140\8144-\8147\8150-\8155\8160-\8172\8178-\8180\8182-\8188\8255-\8256\8276\8305\8319\8336-\8340\8400-\8412\8417\8421-\8427\8450\8455\8458-\8467\8469\8472\8473-\8477\8484\8486\8488\8490-\8493\8494\8495-\8497\8499-\8500\8501-\8504\8505\8508-\8511\8517-\8521\8544-\8579\11264-\11310\11312-\11358\11392-\11492\11520-\11557\11568-\11621\11631\11648-\11670\11680-\11686\11688-\11694\11696-\11702\11704-\11710\11712-\11718\11720-\11726\11728-\11734\11736-\11742\12293\12294\12295\12321-\12329\12330-\12335\12337-\12341\12344-\12346\12347\12348\12353-\12438\12441-\12442\12445-\12446\12447\12449-\12538\12540-\12542\12543\12549-\12588\12593-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40891\40960-\40980\40981\40982-\42124\43008-\43009\43010\43011-\43013\43014\43015-\43018\43019\43020-\43042\43043-\43044\43045-\43046\43047\44032-\55203\63744-\64045\64048-\64106\64112-\64217\64256-\64262\64275-\64279\64285\64286\64287-\64296\64298-\64310\64312-\64316\64318\64320-\64321\64323-\64324\64326-\64433\64467-\64605\64612-\64829\64848-\64911\64914-\64967\65008-\65017\65024-\65039\65056-\65059\65075-\65076\65101-\65103\65137\65139\65143\65145\65147\65149\65151-\65276\65296-\65305\65313-\65338\65343\65345-\65370\65382-\65391\65392\65393-\65437\65438-\65439\65440-\65470\65474-\65479\65482-\65487\65490-\65495\65498-\65500]*" (Arbitrary "Name")+ ]++dqs' :: TokenMatcher+dqs' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\\\\\|\\\\\"|\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , anyOf strings'+ ]++root' :: TokenMatcher+root' =+ [ tok "\\n" (Arbitrary "Text")+ , tok "^(\\s*)([rRuU]{,2}\"\"\"(?:.|\\n)*?\"\"\")" (ByGroups [(Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Doc")])+ , tok "^(\\s*)([rRuU]{,2}'''(?:.|\\n)*?''')" (ByGroups [(Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Doc")])+ , tok "[^\\S\\n]+" (Arbitrary "Text")+ , tok "#.*$" (Arbitrary "Comment")+ , tok "[]{}:(),;[]" (Arbitrary "Punctuation")+ , tok "\\\\\\n" (Arbitrary "Text")+ , tok "\\\\" (Arbitrary "Text")+ , tok "(in|is|and|or|not)\\b" (Arbitrary "Operator" :. Arbitrary "Word")+ , tok "!=|==|<<|>>|[-\126+/*%=<>&^|.]" (Arbitrary "Operator")+ , anyOf keywords'+ , tokNext "(def)((?:\\s|\\\\\\s)+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo funcname')+ , tokNext "(class)((?:\\s|\\\\\\s)+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo classname')+ , tokNext "(from)((?:\\s|\\\\\\s)+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text")]) (GoTo fromimport')+ , tokNext "(import)((?:\\s|\\\\\\s)+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text")]) (GoTo import')+ , anyOf builtins'+ , anyOf backtick'+ , tokNext "(?:[rR]|[uU][rR]|[rR][uU])\"\"\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo tdqs')+ , tokNext "(?:[rR]|[uU][rR]|[rR][uU])'''" (Arbitrary "Literal" :. Arbitrary "String") (GoTo tsqs')+ , tokNext "(?:[rR]|[uU][rR]|[rR][uU])\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo dqs')+ , tokNext "(?:[rR]|[uU][rR]|[rR][uU])'" (Arbitrary "Literal" :. Arbitrary "String") (GoTo sqs')+ , tokNext "[uU]?\"\"\"" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', tdqs'])+ , tokNext "[uU]?'''" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', tsqs'])+ , tokNext "[uU]?\"" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', dqs'])+ , tokNext "[uU]?'" (Arbitrary "Literal" :. Arbitrary "String") (Combined [stringescape', sqs'])+ , anyOf name'+ , anyOf numbers'+ ]++funcname' :: TokenMatcher+funcname' =+ [ tokNext "[A-Z_a-z\170\181\186\192-\214\216-\246\248-\442\443\444-\447\448-\451\452-\577\592-\687\688-\705\710-\721\736-\740\750\902\904-\906\908\910-\929\931-\974\976-\1013\1015-\1153\1162-\1230\1232-\1273\1280-\1295\1329-\1366\1369\1377-\1415\1488-\1514\1520-\1522\1569-\1594\1600\1601-\1610\1646-\1647\1649-\1747\1749\1765-\1766\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1901\1920-\1957\1969\2308-\2361\2365\2384\2392-\2401\2429\2437-\2444\2447-\2448\2451-\2472\2474-\2480\2482\2486-\2489\2493\2510\2524-\2525\2527-\2529\2544-\2545\2565-\2570\2575-\2576\2579-\2600\2602-\2608\2610-\2611\2613-\2614\2616-\2617\2649-\2652\2654\2674-\2676\2693-\2701\2703-\2705\2707-\2728\2730-\2736\2738-\2739\2741-\2745\2749\2768\2784-\2785\2821-\2828\2831-\2832\2835-\2856\2858-\2864\2866-\2867\2869-\2873\2877\2908-\2909\2911-\2913\2929\2947\2949-\2954\2958-\2960\2962-\2965\2969-\2970\2972\2974-\2975\2979-\2980\2984-\2986\2990-\3001\3077-\3084\3086-\3088\3090-\3112\3114-\3123\3125-\3129\3168-\3169\3205-\3212\3214-\3216\3218-\3240\3242-\3251\3253-\3257\3261\3294\3296-\3297\3333-\3340\3342-\3344\3346-\3368\3370-\3385\3424-\3425\3461-\3478\3482-\3505\3507-\3515\3517\3520-\3526\3585-\3632\3634\3648-\3653\3654\3713-\3714\3716\3719-\3720\3722\3725\3732-\3735\3737-\3743\3745-\3747\3749\3751\3754-\3755\3757-\3760\3762\3773\3776-\3780\3782\3804-\3805\3840\3904-\3911\3913-\3946\3976-\3979\4096-\4129\4131-\4135\4137-\4138\4176-\4181\4256-\4293\4304-\4346\4348\4352-\4441\4447-\4514\4520-\4601\4608-\4680\4682-\4685\4688-\4694\4696\4698-\4701\4704-\4744\4746-\4749\4752-\4784\4786-\4789\4792-\4798\4800\4802-\4805\4808-\4822\4824-\4880\4882-\4885\4888-\4954\4992-\5007\5024-\5108\5121-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5872\5888-\5900\5902-\5905\5920-\5937\5952-\5969\5984-\5996\5998-\6000\6016-\6067\6103\6108\6176-\6210\6211\6212-\6263\6272-\6312\6400-\6428\6480-\6509\6512-\6516\6528-\6569\6593-\6599\6656-\6678\7424-\7467\7468-\7521\7522-\7543\7544\7545-\7578\7579-\7615\7680-\7835\7840-\7929\7936-\7957\7960-\7965\7968-\8005\8008-\8013\8016-\8023\8025\8027\8029\8031-\8061\8064-\8116\8118-\8124\8126\8130-\8132\8134-\8140\8144-\8147\8150-\8155\8160-\8172\8178-\8180\8182-\8188\8305\8319\8336-\8340\8450\8455\8458-\8467\8469\8472\8473-\8477\8484\8486\8488\8490-\8493\8494\8495-\8497\8499-\8500\8501-\8504\8505\8508-\8511\8517-\8521\8544-\8579\11264-\11310\11312-\11358\11392-\11492\11520-\11557\11568-\11621\11631\11648-\11670\11680-\11686\11688-\11694\11696-\11702\11704-\11710\11712-\11718\11720-\11726\11728-\11734\11736-\11742\12293\12294\12295\12321-\12329\12337-\12341\12344-\12346\12347\12348\12353-\12438\12445-\12446\12447\12449-\12538\12540-\12542\12543\12549-\12588\12593-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40891\40960-\40980\40981\40982-\42124\43008-\43009\43011-\43013\43015-\43018\43020-\43042\44032-\55203\63744-\64045\64048-\64106\64112-\64217\64256-\64262\64275-\64279\64285\64287-\64296\64298-\64310\64312-\64316\64318\64320-\64321\64323-\64324\64326-\64433\64467-\64605\64612-\64829\64848-\64911\64914-\64967\65008-\65017\65137\65139\65143\65145\65147\65149\65151-\65276\65313-\65338\65345-\65370\65382-\65391\65392\65393-\65437\65440-\65470\65474-\65479\65482-\65487\65490-\65495\65498-\65500][0-9A-Z_a-z\170\181\183\186\192-\214\216-\246\248-\442\443\444-\447\448-\451\452-\577\592-\687\688-\705\710-\721\736-\740\750\768-\879\902\904-\906\908\910-\929\931-\974\976-\1013\1015-\1153\1155-\1158\1162-\1230\1232-\1273\1280-\1295\1329-\1366\1369\1377-\1415\1425-\1465\1467-\1469\1471\1473-\1474\1476-\1477\1479\1488-\1514\1520-\1522\1552-\1557\1569-\1594\1600\1601-\1610\1611-\1630\1632-\1641\1646-\1647\1648\1649-\1747\1749\1750-\1756\1759-\1764\1765-\1766\1767-\1768\1770-\1773\1774-\1775\1776-\1785\1786-\1788\1791\1808\1809\1810-\1839\1840-\1866\1869-\1901\1920-\1957\1958-\1968\1969\2305-\2306\2307\2308-\2361\2364\2365\2366-\2368\2369-\2376\2377-\2380\2381\2384\2385-\2388\2392-\2401\2402-\2403\2406-\2415\2429\2433\2434-\2435\2437-\2444\2447-\2448\2451-\2472\2474-\2480\2482\2486-\2489\2492\2493\2494-\2496\2497-\2500\2503-\2504\2507-\2508\2509\2510\2519\2524-\2525\2527-\2529\2530-\2531\2534-\2543\2544-\2545\2561-\2562\2563\2565-\2570\2575-\2576\2579-\2600\2602-\2608\2610-\2611\2613-\2614\2616-\2617\2620\2622-\2624\2625-\2626\2631-\2632\2635-\2637\2649-\2652\2654\2662-\2671\2672-\2673\2674-\2676\2689-\2690\2691\2693-\2701\2703-\2705\2707-\2728\2730-\2736\2738-\2739\2741-\2745\2748\2749\2750-\2752\2753-\2757\2759-\2760\2761\2763-\2764\2765\2768\2784-\2785\2786-\2787\2790-\2799\2817\2818-\2819\2821-\2828\2831-\2832\2835-\2856\2858-\2864\2866-\2867\2869-\2873\2876\2877\2878\2879\2880\2881-\2883\2887-\2888\2891-\2892\2893\2902\2903\2908-\2909\2911-\2913\2918-\2927\2929\2946\2947\2949-\2954\2958-\2960\2962-\2965\2969-\2970\2972\2974-\2975\2979-\2980\2984-\2986\2990-\3001\3006-\3007\3008\3009-\3010\3014-\3016\3018-\3020\3021\3031\3046-\3055\3073-\3075\3077-\3084\3086-\3088\3090-\3112\3114-\3123\3125-\3129\3134-\3136\3137-\3140\3142-\3144\3146-\3149\3157-\3158\3168-\3169\3174-\3183\3202-\3203\3205-\3212\3214-\3216\3218-\3240\3242-\3251\3253-\3257\3260\3261\3262\3263\3264-\3268\3270\3271-\3272\3274-\3275\3276-\3277\3285-\3286\3294\3296-\3297\3302-\3311\3330-\3331\3333-\3340\3342-\3344\3346-\3368\3370-\3385\3390-\3392\3393-\3395\3398-\3400\3402-\3404\3405\3415\3424-\3425\3430-\3439\3458-\3459\3461-\3478\3482-\3505\3507-\3515\3517\3520-\3526\3530\3535-\3537\3538-\3540\3542\3544-\3551\3570-\3571\3585-\3632\3633\3634-\3635\3636-\3642\3648-\3653\3654\3655-\3662\3664-\3673\3713-\3714\3716\3719-\3720\3722\3725\3732-\3735\3737-\3743\3745-\3747\3749\3751\3754-\3755\3757-\3760\3761\3762-\3763\3764-\3769\3771-\3772\3773\3776-\3780\3782\3784-\3789\3792-\3801\3804-\3805\3840\3864-\3865\3872-\3881\3893\3895\3897\3902-\3903\3904-\3911\3913-\3946\3953-\3966\3967\3968-\3972\3974-\3975\3976-\3979\3984-\3991\3993-\4028\4038\4096-\4129\4131-\4135\4137-\4138\4140\4141-\4144\4145\4146\4150-\4151\4152\4153\4160-\4169\4176-\4181\4182-\4183\4184-\4185\4256-\4293\4304-\4346\4348\4352-\4441\4447-\4514\4520-\4601\4608-\4680\4682-\4685\4688-\4694\4696\4698-\4701\4704-\4744\4746-\4749\4752-\4784\4786-\4789\4792-\4798\4800\4802-\4805\4808-\4822\4824-\4880\4882-\4885\4888-\4954\4959\4969-\4977\4992-\5007\5024-\5108\5121-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5872\5888-\5900\5902-\5905\5906-\5908\5920-\5937\5938-\5940\5952-\5969\5970-\5971\5984-\5996\5998-\6000\6002-\6003\6016-\6067\6070\6071-\6077\6078-\6085\6086\6087-\6088\6089-\6099\6103\6108\6109\6112-\6121\6155-\6157\6160-\6169\6176-\6210\6211\6212-\6263\6272-\6312\6313\6400-\6428\6432-\6434\6435-\6438\6439-\6440\6441-\6443\6448-\6449\6450\6451-\6456\6457-\6459\6470-\6479\6480-\6509\6512-\6516\6528-\6569\6576-\6592\6593-\6599\6600-\6601\6608-\6617\6656-\6678\6679-\6680\6681-\6683\7424-\7467\7468-\7521\7522-\7543\7544\7545-\7578\7579-\7615\7616-\7619\7680-\7835\7840-\7929\7936-\7957\7960-\7965\7968-\8005\8008-\8013\8016-\8023\8025\8027\8029\8031-\8061\8064-\8116\8118-\8124\8126\8130-\8132\8134-\8140\8144-\8147\8150-\8155\8160-\8172\8178-\8180\8182-\8188\8255-\8256\8276\8305\8319\8336-\8340\8400-\8412\8417\8421-\8427\8450\8455\8458-\8467\8469\8472\8473-\8477\8484\8486\8488\8490-\8493\8494\8495-\8497\8499-\8500\8501-\8504\8505\8508-\8511\8517-\8521\8544-\8579\11264-\11310\11312-\11358\11392-\11492\11520-\11557\11568-\11621\11631\11648-\11670\11680-\11686\11688-\11694\11696-\11702\11704-\11710\11712-\11718\11720-\11726\11728-\11734\11736-\11742\12293\12294\12295\12321-\12329\12330-\12335\12337-\12341\12344-\12346\12347\12348\12353-\12438\12441-\12442\12445-\12446\12447\12449-\12538\12540-\12542\12543\12549-\12588\12593-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40891\40960-\40980\40981\40982-\42124\43008-\43009\43010\43011-\43013\43014\43015-\43018\43019\43020-\43042\43043-\43044\43045-\43046\43047\44032-\55203\63744-\64045\64048-\64106\64112-\64217\64256-\64262\64275-\64279\64285\64286\64287-\64296\64298-\64310\64312-\64316\64318\64320-\64321\64323-\64324\64326-\64433\64467-\64605\64612-\64829\64848-\64911\64914-\64967\65008-\65017\65024-\65039\65056-\65059\65075-\65076\65101-\65103\65137\65139\65143\65145\65147\65149\65151-\65276\65296-\65305\65313-\65338\65343\65345-\65370\65382-\65391\65392\65393-\65437\65438-\65439\65440-\65470\65474-\65479\65482-\65487\65490-\65495\65498-\65500]*" (Arbitrary "Name" :. Arbitrary "Function") Pop+ ]++import' :: TokenMatcher+import' =+ [ tok "(\\s+)(as)(\\s+)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text")])+ , tok "\\." (Arbitrary "Name" :. Arbitrary "Namespace")+ , tok "[A-Z_a-z\170\181\186\192-\214\216-\246\248-\442\443\444-\447\448-\451\452-\577\592-\687\688-\705\710-\721\736-\740\750\902\904-\906\908\910-\929\931-\974\976-\1013\1015-\1153\1162-\1230\1232-\1273\1280-\1295\1329-\1366\1369\1377-\1415\1488-\1514\1520-\1522\1569-\1594\1600\1601-\1610\1646-\1647\1649-\1747\1749\1765-\1766\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1901\1920-\1957\1969\2308-\2361\2365\2384\2392-\2401\2429\2437-\2444\2447-\2448\2451-\2472\2474-\2480\2482\2486-\2489\2493\2510\2524-\2525\2527-\2529\2544-\2545\2565-\2570\2575-\2576\2579-\2600\2602-\2608\2610-\2611\2613-\2614\2616-\2617\2649-\2652\2654\2674-\2676\2693-\2701\2703-\2705\2707-\2728\2730-\2736\2738-\2739\2741-\2745\2749\2768\2784-\2785\2821-\2828\2831-\2832\2835-\2856\2858-\2864\2866-\2867\2869-\2873\2877\2908-\2909\2911-\2913\2929\2947\2949-\2954\2958-\2960\2962-\2965\2969-\2970\2972\2974-\2975\2979-\2980\2984-\2986\2990-\3001\3077-\3084\3086-\3088\3090-\3112\3114-\3123\3125-\3129\3168-\3169\3205-\3212\3214-\3216\3218-\3240\3242-\3251\3253-\3257\3261\3294\3296-\3297\3333-\3340\3342-\3344\3346-\3368\3370-\3385\3424-\3425\3461-\3478\3482-\3505\3507-\3515\3517\3520-\3526\3585-\3632\3634\3648-\3653\3654\3713-\3714\3716\3719-\3720\3722\3725\3732-\3735\3737-\3743\3745-\3747\3749\3751\3754-\3755\3757-\3760\3762\3773\3776-\3780\3782\3804-\3805\3840\3904-\3911\3913-\3946\3976-\3979\4096-\4129\4131-\4135\4137-\4138\4176-\4181\4256-\4293\4304-\4346\4348\4352-\4441\4447-\4514\4520-\4601\4608-\4680\4682-\4685\4688-\4694\4696\4698-\4701\4704-\4744\4746-\4749\4752-\4784\4786-\4789\4792-\4798\4800\4802-\4805\4808-\4822\4824-\4880\4882-\4885\4888-\4954\4992-\5007\5024-\5108\5121-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5872\5888-\5900\5902-\5905\5920-\5937\5952-\5969\5984-\5996\5998-\6000\6016-\6067\6103\6108\6176-\6210\6211\6212-\6263\6272-\6312\6400-\6428\6480-\6509\6512-\6516\6528-\6569\6593-\6599\6656-\6678\7424-\7467\7468-\7521\7522-\7543\7544\7545-\7578\7579-\7615\7680-\7835\7840-\7929\7936-\7957\7960-\7965\7968-\8005\8008-\8013\8016-\8023\8025\8027\8029\8031-\8061\8064-\8116\8118-\8124\8126\8130-\8132\8134-\8140\8144-\8147\8150-\8155\8160-\8172\8178-\8180\8182-\8188\8305\8319\8336-\8340\8450\8455\8458-\8467\8469\8472\8473-\8477\8484\8486\8488\8490-\8493\8494\8495-\8497\8499-\8500\8501-\8504\8505\8508-\8511\8517-\8521\8544-\8579\11264-\11310\11312-\11358\11392-\11492\11520-\11557\11568-\11621\11631\11648-\11670\11680-\11686\11688-\11694\11696-\11702\11704-\11710\11712-\11718\11720-\11726\11728-\11734\11736-\11742\12293\12294\12295\12321-\12329\12337-\12341\12344-\12346\12347\12348\12353-\12438\12445-\12446\12447\12449-\12538\12540-\12542\12543\12549-\12588\12593-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40891\40960-\40980\40981\40982-\42124\43008-\43009\43011-\43013\43015-\43018\43020-\43042\44032-\55203\63744-\64045\64048-\64106\64112-\64217\64256-\64262\64275-\64279\64285\64287-\64296\64298-\64310\64312-\64316\64318\64320-\64321\64323-\64324\64326-\64433\64467-\64605\64612-\64829\64848-\64911\64914-\64967\65008-\65017\65137\65139\65143\65145\65147\65149\65151-\65276\65313-\65338\65345-\65370\65382-\65391\65392\65393-\65437\65440-\65470\65474-\65479\65482-\65487\65490-\65495\65498-\65500][0-9A-Z_a-z\170\181\183\186\192-\214\216-\246\248-\442\443\444-\447\448-\451\452-\577\592-\687\688-\705\710-\721\736-\740\750\768-\879\902\904-\906\908\910-\929\931-\974\976-\1013\1015-\1153\1155-\1158\1162-\1230\1232-\1273\1280-\1295\1329-\1366\1369\1377-\1415\1425-\1465\1467-\1469\1471\1473-\1474\1476-\1477\1479\1488-\1514\1520-\1522\1552-\1557\1569-\1594\1600\1601-\1610\1611-\1630\1632-\1641\1646-\1647\1648\1649-\1747\1749\1750-\1756\1759-\1764\1765-\1766\1767-\1768\1770-\1773\1774-\1775\1776-\1785\1786-\1788\1791\1808\1809\1810-\1839\1840-\1866\1869-\1901\1920-\1957\1958-\1968\1969\2305-\2306\2307\2308-\2361\2364\2365\2366-\2368\2369-\2376\2377-\2380\2381\2384\2385-\2388\2392-\2401\2402-\2403\2406-\2415\2429\2433\2434-\2435\2437-\2444\2447-\2448\2451-\2472\2474-\2480\2482\2486-\2489\2492\2493\2494-\2496\2497-\2500\2503-\2504\2507-\2508\2509\2510\2519\2524-\2525\2527-\2529\2530-\2531\2534-\2543\2544-\2545\2561-\2562\2563\2565-\2570\2575-\2576\2579-\2600\2602-\2608\2610-\2611\2613-\2614\2616-\2617\2620\2622-\2624\2625-\2626\2631-\2632\2635-\2637\2649-\2652\2654\2662-\2671\2672-\2673\2674-\2676\2689-\2690\2691\2693-\2701\2703-\2705\2707-\2728\2730-\2736\2738-\2739\2741-\2745\2748\2749\2750-\2752\2753-\2757\2759-\2760\2761\2763-\2764\2765\2768\2784-\2785\2786-\2787\2790-\2799\2817\2818-\2819\2821-\2828\2831-\2832\2835-\2856\2858-\2864\2866-\2867\2869-\2873\2876\2877\2878\2879\2880\2881-\2883\2887-\2888\2891-\2892\2893\2902\2903\2908-\2909\2911-\2913\2918-\2927\2929\2946\2947\2949-\2954\2958-\2960\2962-\2965\2969-\2970\2972\2974-\2975\2979-\2980\2984-\2986\2990-\3001\3006-\3007\3008\3009-\3010\3014-\3016\3018-\3020\3021\3031\3046-\3055\3073-\3075\3077-\3084\3086-\3088\3090-\3112\3114-\3123\3125-\3129\3134-\3136\3137-\3140\3142-\3144\3146-\3149\3157-\3158\3168-\3169\3174-\3183\3202-\3203\3205-\3212\3214-\3216\3218-\3240\3242-\3251\3253-\3257\3260\3261\3262\3263\3264-\3268\3270\3271-\3272\3274-\3275\3276-\3277\3285-\3286\3294\3296-\3297\3302-\3311\3330-\3331\3333-\3340\3342-\3344\3346-\3368\3370-\3385\3390-\3392\3393-\3395\3398-\3400\3402-\3404\3405\3415\3424-\3425\3430-\3439\3458-\3459\3461-\3478\3482-\3505\3507-\3515\3517\3520-\3526\3530\3535-\3537\3538-\3540\3542\3544-\3551\3570-\3571\3585-\3632\3633\3634-\3635\3636-\3642\3648-\3653\3654\3655-\3662\3664-\3673\3713-\3714\3716\3719-\3720\3722\3725\3732-\3735\3737-\3743\3745-\3747\3749\3751\3754-\3755\3757-\3760\3761\3762-\3763\3764-\3769\3771-\3772\3773\3776-\3780\3782\3784-\3789\3792-\3801\3804-\3805\3840\3864-\3865\3872-\3881\3893\3895\3897\3902-\3903\3904-\3911\3913-\3946\3953-\3966\3967\3968-\3972\3974-\3975\3976-\3979\3984-\3991\3993-\4028\4038\4096-\4129\4131-\4135\4137-\4138\4140\4141-\4144\4145\4146\4150-\4151\4152\4153\4160-\4169\4176-\4181\4182-\4183\4184-\4185\4256-\4293\4304-\4346\4348\4352-\4441\4447-\4514\4520-\4601\4608-\4680\4682-\4685\4688-\4694\4696\4698-\4701\4704-\4744\4746-\4749\4752-\4784\4786-\4789\4792-\4798\4800\4802-\4805\4808-\4822\4824-\4880\4882-\4885\4888-\4954\4959\4969-\4977\4992-\5007\5024-\5108\5121-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5872\5888-\5900\5902-\5905\5906-\5908\5920-\5937\5938-\5940\5952-\5969\5970-\5971\5984-\5996\5998-\6000\6002-\6003\6016-\6067\6070\6071-\6077\6078-\6085\6086\6087-\6088\6089-\6099\6103\6108\6109\6112-\6121\6155-\6157\6160-\6169\6176-\6210\6211\6212-\6263\6272-\6312\6313\6400-\6428\6432-\6434\6435-\6438\6439-\6440\6441-\6443\6448-\6449\6450\6451-\6456\6457-\6459\6470-\6479\6480-\6509\6512-\6516\6528-\6569\6576-\6592\6593-\6599\6600-\6601\6608-\6617\6656-\6678\6679-\6680\6681-\6683\7424-\7467\7468-\7521\7522-\7543\7544\7545-\7578\7579-\7615\7616-\7619\7680-\7835\7840-\7929\7936-\7957\7960-\7965\7968-\8005\8008-\8013\8016-\8023\8025\8027\8029\8031-\8061\8064-\8116\8118-\8124\8126\8130-\8132\8134-\8140\8144-\8147\8150-\8155\8160-\8172\8178-\8180\8182-\8188\8255-\8256\8276\8305\8319\8336-\8340\8400-\8412\8417\8421-\8427\8450\8455\8458-\8467\8469\8472\8473-\8477\8484\8486\8488\8490-\8493\8494\8495-\8497\8499-\8500\8501-\8504\8505\8508-\8511\8517-\8521\8544-\8579\11264-\11310\11312-\11358\11392-\11492\11520-\11557\11568-\11621\11631\11648-\11670\11680-\11686\11688-\11694\11696-\11702\11704-\11710\11712-\11718\11720-\11726\11728-\11734\11736-\11742\12293\12294\12295\12321-\12329\12330-\12335\12337-\12341\12344-\12346\12347\12348\12353-\12438\12441-\12442\12445-\12446\12447\12449-\12538\12540-\12542\12543\12549-\12588\12593-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40891\40960-\40980\40981\40982-\42124\43008-\43009\43010\43011-\43013\43014\43015-\43018\43019\43020-\43042\43043-\43044\43045-\43046\43047\44032-\55203\63744-\64045\64048-\64106\64112-\64217\64256-\64262\64275-\64279\64285\64286\64287-\64296\64298-\64310\64312-\64316\64318\64320-\64321\64323-\64324\64326-\64433\64467-\64605\64612-\64829\64848-\64911\64914-\64967\65008-\65017\65024-\65039\65056-\65059\65075-\65076\65101-\65103\65137\65139\65143\65145\65147\65149\65151-\65276\65296-\65305\65313-\65338\65343\65345-\65370\65382-\65391\65392\65393-\65437\65438-\65439\65440-\65470\65474-\65479\65482-\65487\65490-\65495\65498-\65500]*" (Arbitrary "Name" :. Arbitrary "Namespace")+ , tok "(\\s*)(,)(\\s*)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Operator"), (Arbitrary "Text")])+ , tokNext "" (Arbitrary "Text") Pop+ ]++tdqs' :: TokenMatcher+tdqs' =+ [ tokNext "\"\"\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , anyOf strings'+ , anyOf nl'+ ]++strings' :: TokenMatcher+strings' =+ [ tok "[^\\\\\\'\"%\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "[\\'\"\\\\]" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "%" (Arbitrary "Literal" :. Arbitrary "String")+ ]++fromimport' :: TokenMatcher+fromimport' =+ [ tokNext "(\\s+)(import)\\b" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword")]) Pop+ , tok "\\." (Arbitrary "Name" :. Arbitrary "Namespace")+ , tok "[A-Z_a-z\170\181\186\192-\214\216-\246\248-\442\443\444-\447\448-\451\452-\577\592-\687\688-\705\710-\721\736-\740\750\902\904-\906\908\910-\929\931-\974\976-\1013\1015-\1153\1162-\1230\1232-\1273\1280-\1295\1329-\1366\1369\1377-\1415\1488-\1514\1520-\1522\1569-\1594\1600\1601-\1610\1646-\1647\1649-\1747\1749\1765-\1766\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1901\1920-\1957\1969\2308-\2361\2365\2384\2392-\2401\2429\2437-\2444\2447-\2448\2451-\2472\2474-\2480\2482\2486-\2489\2493\2510\2524-\2525\2527-\2529\2544-\2545\2565-\2570\2575-\2576\2579-\2600\2602-\2608\2610-\2611\2613-\2614\2616-\2617\2649-\2652\2654\2674-\2676\2693-\2701\2703-\2705\2707-\2728\2730-\2736\2738-\2739\2741-\2745\2749\2768\2784-\2785\2821-\2828\2831-\2832\2835-\2856\2858-\2864\2866-\2867\2869-\2873\2877\2908-\2909\2911-\2913\2929\2947\2949-\2954\2958-\2960\2962-\2965\2969-\2970\2972\2974-\2975\2979-\2980\2984-\2986\2990-\3001\3077-\3084\3086-\3088\3090-\3112\3114-\3123\3125-\3129\3168-\3169\3205-\3212\3214-\3216\3218-\3240\3242-\3251\3253-\3257\3261\3294\3296-\3297\3333-\3340\3342-\3344\3346-\3368\3370-\3385\3424-\3425\3461-\3478\3482-\3505\3507-\3515\3517\3520-\3526\3585-\3632\3634\3648-\3653\3654\3713-\3714\3716\3719-\3720\3722\3725\3732-\3735\3737-\3743\3745-\3747\3749\3751\3754-\3755\3757-\3760\3762\3773\3776-\3780\3782\3804-\3805\3840\3904-\3911\3913-\3946\3976-\3979\4096-\4129\4131-\4135\4137-\4138\4176-\4181\4256-\4293\4304-\4346\4348\4352-\4441\4447-\4514\4520-\4601\4608-\4680\4682-\4685\4688-\4694\4696\4698-\4701\4704-\4744\4746-\4749\4752-\4784\4786-\4789\4792-\4798\4800\4802-\4805\4808-\4822\4824-\4880\4882-\4885\4888-\4954\4992-\5007\5024-\5108\5121-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5872\5888-\5900\5902-\5905\5920-\5937\5952-\5969\5984-\5996\5998-\6000\6016-\6067\6103\6108\6176-\6210\6211\6212-\6263\6272-\6312\6400-\6428\6480-\6509\6512-\6516\6528-\6569\6593-\6599\6656-\6678\7424-\7467\7468-\7521\7522-\7543\7544\7545-\7578\7579-\7615\7680-\7835\7840-\7929\7936-\7957\7960-\7965\7968-\8005\8008-\8013\8016-\8023\8025\8027\8029\8031-\8061\8064-\8116\8118-\8124\8126\8130-\8132\8134-\8140\8144-\8147\8150-\8155\8160-\8172\8178-\8180\8182-\8188\8305\8319\8336-\8340\8450\8455\8458-\8467\8469\8472\8473-\8477\8484\8486\8488\8490-\8493\8494\8495-\8497\8499-\8500\8501-\8504\8505\8508-\8511\8517-\8521\8544-\8579\11264-\11310\11312-\11358\11392-\11492\11520-\11557\11568-\11621\11631\11648-\11670\11680-\11686\11688-\11694\11696-\11702\11704-\11710\11712-\11718\11720-\11726\11728-\11734\11736-\11742\12293\12294\12295\12321-\12329\12337-\12341\12344-\12346\12347\12348\12353-\12438\12445-\12446\12447\12449-\12538\12540-\12542\12543\12549-\12588\12593-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40891\40960-\40980\40981\40982-\42124\43008-\43009\43011-\43013\43015-\43018\43020-\43042\44032-\55203\63744-\64045\64048-\64106\64112-\64217\64256-\64262\64275-\64279\64285\64287-\64296\64298-\64310\64312-\64316\64318\64320-\64321\64323-\64324\64326-\64433\64467-\64605\64612-\64829\64848-\64911\64914-\64967\65008-\65017\65137\65139\65143\65145\65147\65149\65151-\65276\65313-\65338\65345-\65370\65382-\65391\65392\65393-\65437\65440-\65470\65474-\65479\65482-\65487\65490-\65495\65498-\65500][0-9A-Z_a-z\170\181\183\186\192-\214\216-\246\248-\442\443\444-\447\448-\451\452-\577\592-\687\688-\705\710-\721\736-\740\750\768-\879\902\904-\906\908\910-\929\931-\974\976-\1013\1015-\1153\1155-\1158\1162-\1230\1232-\1273\1280-\1295\1329-\1366\1369\1377-\1415\1425-\1465\1467-\1469\1471\1473-\1474\1476-\1477\1479\1488-\1514\1520-\1522\1552-\1557\1569-\1594\1600\1601-\1610\1611-\1630\1632-\1641\1646-\1647\1648\1649-\1747\1749\1750-\1756\1759-\1764\1765-\1766\1767-\1768\1770-\1773\1774-\1775\1776-\1785\1786-\1788\1791\1808\1809\1810-\1839\1840-\1866\1869-\1901\1920-\1957\1958-\1968\1969\2305-\2306\2307\2308-\2361\2364\2365\2366-\2368\2369-\2376\2377-\2380\2381\2384\2385-\2388\2392-\2401\2402-\2403\2406-\2415\2429\2433\2434-\2435\2437-\2444\2447-\2448\2451-\2472\2474-\2480\2482\2486-\2489\2492\2493\2494-\2496\2497-\2500\2503-\2504\2507-\2508\2509\2510\2519\2524-\2525\2527-\2529\2530-\2531\2534-\2543\2544-\2545\2561-\2562\2563\2565-\2570\2575-\2576\2579-\2600\2602-\2608\2610-\2611\2613-\2614\2616-\2617\2620\2622-\2624\2625-\2626\2631-\2632\2635-\2637\2649-\2652\2654\2662-\2671\2672-\2673\2674-\2676\2689-\2690\2691\2693-\2701\2703-\2705\2707-\2728\2730-\2736\2738-\2739\2741-\2745\2748\2749\2750-\2752\2753-\2757\2759-\2760\2761\2763-\2764\2765\2768\2784-\2785\2786-\2787\2790-\2799\2817\2818-\2819\2821-\2828\2831-\2832\2835-\2856\2858-\2864\2866-\2867\2869-\2873\2876\2877\2878\2879\2880\2881-\2883\2887-\2888\2891-\2892\2893\2902\2903\2908-\2909\2911-\2913\2918-\2927\2929\2946\2947\2949-\2954\2958-\2960\2962-\2965\2969-\2970\2972\2974-\2975\2979-\2980\2984-\2986\2990-\3001\3006-\3007\3008\3009-\3010\3014-\3016\3018-\3020\3021\3031\3046-\3055\3073-\3075\3077-\3084\3086-\3088\3090-\3112\3114-\3123\3125-\3129\3134-\3136\3137-\3140\3142-\3144\3146-\3149\3157-\3158\3168-\3169\3174-\3183\3202-\3203\3205-\3212\3214-\3216\3218-\3240\3242-\3251\3253-\3257\3260\3261\3262\3263\3264-\3268\3270\3271-\3272\3274-\3275\3276-\3277\3285-\3286\3294\3296-\3297\3302-\3311\3330-\3331\3333-\3340\3342-\3344\3346-\3368\3370-\3385\3390-\3392\3393-\3395\3398-\3400\3402-\3404\3405\3415\3424-\3425\3430-\3439\3458-\3459\3461-\3478\3482-\3505\3507-\3515\3517\3520-\3526\3530\3535-\3537\3538-\3540\3542\3544-\3551\3570-\3571\3585-\3632\3633\3634-\3635\3636-\3642\3648-\3653\3654\3655-\3662\3664-\3673\3713-\3714\3716\3719-\3720\3722\3725\3732-\3735\3737-\3743\3745-\3747\3749\3751\3754-\3755\3757-\3760\3761\3762-\3763\3764-\3769\3771-\3772\3773\3776-\3780\3782\3784-\3789\3792-\3801\3804-\3805\3840\3864-\3865\3872-\3881\3893\3895\3897\3902-\3903\3904-\3911\3913-\3946\3953-\3966\3967\3968-\3972\3974-\3975\3976-\3979\3984-\3991\3993-\4028\4038\4096-\4129\4131-\4135\4137-\4138\4140\4141-\4144\4145\4146\4150-\4151\4152\4153\4160-\4169\4176-\4181\4182-\4183\4184-\4185\4256-\4293\4304-\4346\4348\4352-\4441\4447-\4514\4520-\4601\4608-\4680\4682-\4685\4688-\4694\4696\4698-\4701\4704-\4744\4746-\4749\4752-\4784\4786-\4789\4792-\4798\4800\4802-\4805\4808-\4822\4824-\4880\4882-\4885\4888-\4954\4959\4969-\4977\4992-\5007\5024-\5108\5121-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5872\5888-\5900\5902-\5905\5906-\5908\5920-\5937\5938-\5940\5952-\5969\5970-\5971\5984-\5996\5998-\6000\6002-\6003\6016-\6067\6070\6071-\6077\6078-\6085\6086\6087-\6088\6089-\6099\6103\6108\6109\6112-\6121\6155-\6157\6160-\6169\6176-\6210\6211\6212-\6263\6272-\6312\6313\6400-\6428\6432-\6434\6435-\6438\6439-\6440\6441-\6443\6448-\6449\6450\6451-\6456\6457-\6459\6470-\6479\6480-\6509\6512-\6516\6528-\6569\6576-\6592\6593-\6599\6600-\6601\6608-\6617\6656-\6678\6679-\6680\6681-\6683\7424-\7467\7468-\7521\7522-\7543\7544\7545-\7578\7579-\7615\7616-\7619\7680-\7835\7840-\7929\7936-\7957\7960-\7965\7968-\8005\8008-\8013\8016-\8023\8025\8027\8029\8031-\8061\8064-\8116\8118-\8124\8126\8130-\8132\8134-\8140\8144-\8147\8150-\8155\8160-\8172\8178-\8180\8182-\8188\8255-\8256\8276\8305\8319\8336-\8340\8400-\8412\8417\8421-\8427\8450\8455\8458-\8467\8469\8472\8473-\8477\8484\8486\8488\8490-\8493\8494\8495-\8497\8499-\8500\8501-\8504\8505\8508-\8511\8517-\8521\8544-\8579\11264-\11310\11312-\11358\11392-\11492\11520-\11557\11568-\11621\11631\11648-\11670\11680-\11686\11688-\11694\11696-\11702\11704-\11710\11712-\11718\11720-\11726\11728-\11734\11736-\11742\12293\12294\12295\12321-\12329\12330-\12335\12337-\12341\12344-\12346\12347\12348\12353-\12438\12441-\12442\12445-\12446\12447\12449-\12538\12540-\12542\12543\12549-\12588\12593-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40891\40960-\40980\40981\40982-\42124\43008-\43009\43010\43011-\43013\43014\43015-\43018\43019\43020-\43042\43043-\43044\43045-\43046\43047\44032-\55203\63744-\64045\64048-\64106\64112-\64217\64256-\64262\64275-\64279\64285\64286\64287-\64296\64298-\64310\64312-\64316\64318\64320-\64321\64323-\64324\64326-\64433\64467-\64605\64612-\64829\64848-\64911\64914-\64967\65008-\65017\65024-\65039\65056-\65059\65075-\65076\65101-\65103\65137\65139\65143\65145\65147\65149\65151-\65276\65296-\65305\65313-\65338\65343\65345-\65370\65382-\65391\65392\65393-\65437\65438-\65439\65440-\65470\65474-\65479\65482-\65487\65490-\65495\65498-\65500]*" (Arbitrary "Name" :. Arbitrary "Namespace")+ ]+
+ src/Text/Highlighter/Lexers/Python3Traceback.hs view
@@ -0,0 +1,32 @@+module Text.Highlighter.Lexers.Python3Traceback (lexer) where+import qualified Text.Highlighter.Lexers.Python3 as Python3+import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Python 3.0 Traceback"+ , lAliases = ["py3tb"]+ , lExtensions = [".py3tb"]+ , lMimetypes = ["text/x-python3-traceback"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "\\n" (Arbitrary "Text")+ , tokNext "^Traceback \\(most recent call last\\):\\n" (Arbitrary "Generic" :. Arbitrary "Traceback") (GoTo intb')+ , tok "^During handling of the above exception, another exception occurred:\\n\\n" (Arbitrary "Generic" :. Arbitrary "Traceback")+ , tok "^The above exception was the direct cause of the following exception:\\n\\n" (Arbitrary "Generic" :. Arbitrary "Traceback")+ ]++intb' :: TokenMatcher+intb' =+ [ tok "^( File )(\"[^\"]+\")(, line )(\\d+)(, in )(.+)(\\n)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Builtin"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "Number"), (Arbitrary "Text"), (Arbitrary "Name"), (Arbitrary "Text")])+ , tok "^( )(.+)(\\n)" (ByGroups [(Arbitrary "Text"), (Using Python3.lexer), (Arbitrary "Text")])+ , tok "^([ \\t]*)(...)(\\n)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Comment"), (Arbitrary "Text")])+ , tokNext "^(.+)(: )(.+)(\\n)" (ByGroups [(Arbitrary "Generic" :. Arbitrary "Error"), (Arbitrary "Text"), (Arbitrary "Name"), (Arbitrary "Text")]) Pop+ , tokNext "^([a-zA-Z_][a-zA-Z0-9_]*)(:?\\n)" (ByGroups [(Arbitrary "Generic" :. Arbitrary "Error"), (Arbitrary "Text")]) Pop+ ]+
+ src/Text/Highlighter/Lexers/PythonTraceback.hs view
@@ -0,0 +1,32 @@+module Text.Highlighter.Lexers.PythonTraceback (lexer) where+import qualified Text.Highlighter.Lexers.Python as Python+import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Python Traceback"+ , lAliases = ["pytb"]+ , lExtensions = [".pytb"]+ , lMimetypes = ["text/x-python-traceback"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tokNext "^Traceback \\(most recent call last\\):\\n" (Arbitrary "Generic" :. Arbitrary "Traceback") (GoTo intb')+ , tokNext "^(?= File \"[^\"]+\", line \\d+)" (Arbitrary "Generic" :. Arbitrary "Traceback") (GoTo intb')+ , tok "^.*\\n" (Arbitrary "Other")+ ]++intb' :: TokenMatcher+intb' =+ [ tok "^( File )(\"[^\"]+\")(, line )(\\d+)(, in )(.+)(\\n)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Builtin"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "Number"), (Arbitrary "Text"), (Arbitrary "Name"), (Arbitrary "Text")])+ , tok "^( File )(\"[^\"]+\")(, line )(\\d+)(\\n)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Builtin"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "Number"), (Arbitrary "Text")])+ , tok "^( )(.+)(\\n)" (ByGroups [(Arbitrary "Text"), (Using Python.lexer), (Arbitrary "Text")])+ , tok "^([ \\t]*)(...)(\\n)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Comment"), (Arbitrary "Text")])+ , tokNext "^(.+)(: )(.+)(\\n)" (ByGroups [(Arbitrary "Generic" :. Arbitrary "Error"), (Arbitrary "Text"), (Arbitrary "Name"), (Arbitrary "Text")]) Pop+ , tokNext "^([a-zA-Z_][a-zA-Z0-9_]*)(:?\\n)" (ByGroups [(Arbitrary "Generic" :. Arbitrary "Error"), (Arbitrary "Text")]) Pop+ ]+
+ src/Text/Highlighter/Lexers/Ragel.hs view
@@ -0,0 +1,91 @@+module Text.Highlighter.Lexers.Ragel (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Ragel"+ , lAliases = ["ragel"]+ , lExtensions = []+ , lMimetypes = []+ , lStart = root'+ , lFlags = [multiline]+ }++host' :: TokenMatcher+host' =+ [ tok "([^{}\\'\"/#]+|[^\\\\][\\\\][{}]|\"(\\\\\\\\|\\\\\"|[^\"])*\"|'(\\\\\\\\|\\\\'|[^'])*'|//.*$\\n?|/\\*(.|\\n)*?\\*/|\\#.*$\\n?|/(?!\\*)(\\\\\\\\|\\\\/|[^/])*/|/)+" (Arbitrary "Other")+ , tokNext "{" (Arbitrary "Punctuation") Push+ , tokNext "}" (Arbitrary "Punctuation") Pop+ ]++literals' :: TokenMatcher+literals' =+ [ tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "'(\\\\\\\\|\\\\'|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\[(\\\\\\\\|\\\\\\]|[^\\]])*\\]" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "/(?!\\*)(\\\\\\\\|\\\\/|[^/])*/" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ ]++whitespace' :: TokenMatcher+whitespace' =+ [ tok "\\s+" (Arbitrary "Text" :. Arbitrary "Whitespace")+ ]++keywords' :: TokenMatcher+keywords' =+ [ tok "(access|action|alphtype)\\b" (Arbitrary "Keyword")+ , tok "(getkey|write|machine|include)\\b" (Arbitrary "Keyword")+ , tok "(any|ascii|extend|alpha|digit|alnum|lower|upper)\\b" (Arbitrary "Keyword")+ , tok "(xdigit|cntrl|graph|print|punct|space|zlen|empty)\\b" (Arbitrary "Keyword")+ ]++operators' :: TokenMatcher+operators' =+ [ tok "," (Arbitrary "Operator")+ , tok "\\||&|-|--" (Arbitrary "Operator")+ , tok "\\.|<:|:>|:>>" (Arbitrary "Operator")+ , tok ":" (Arbitrary "Operator")+ , tok "->" (Arbitrary "Operator")+ , tok "(>|\\$|%|<|@|<>)(/|eof\\b)" (Arbitrary "Operator")+ , tok "(>|\\$|%|<|@|<>)(!|err\\b)" (Arbitrary "Operator")+ , tok "(>|\\$|%|<|@|<>)(\\^|lerr\\b)" (Arbitrary "Operator")+ , tok "(>|\\$|%|<|@|<>)(\126|to\\b)" (Arbitrary "Operator")+ , tok "(>|\\$|%|<|@|<>)(\\*|from\\b)" (Arbitrary "Operator")+ , tok ">|@|\\$|%" (Arbitrary "Operator")+ , tok "\\*|\\?|\\+|{[0-9]*,[0-9]*}" (Arbitrary "Operator")+ , tok "!|\\^" (Arbitrary "Operator")+ , tok "\\(|\\)" (Arbitrary "Operator")+ ]++identifiers' :: TokenMatcher+identifiers' =+ [ tok "[a-zA-Z_][a-zA-Z_0-9]*" (Arbitrary "Name" :. Arbitrary "Variable")+ ]++root' :: TokenMatcher+root' =+ [ anyOf literals'+ , anyOf whitespace'+ , anyOf comments'+ , anyOf keywords'+ , anyOf numbers'+ , anyOf identifiers'+ , anyOf operators'+ , tokNext "{" (Arbitrary "Punctuation") (GoTo host')+ , tok "=" (Arbitrary "Operator")+ , tok ";" (Arbitrary "Punctuation")+ ]++comments' :: TokenMatcher+comments' =+ [ tok "\\#.*$" (Arbitrary "Comment")+ ]++numbers' :: TokenMatcher+numbers' =+ [ tok "0x[0-9A-Fa-f]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "[+-]?[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ ]+
+ src/Text/Highlighter/Lexers/RagelEmbedded.hs view
@@ -0,0 +1,29 @@+module Text.Highlighter.Lexers.RagelEmbedded (lexer) where+import qualified Text.Highlighter.Lexers.Ragel as Ragel+import qualified Text.Highlighter.Lexers.Ragel as Ragel+import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Embedded Ragel"+ , lAliases = ["ragel-em"]+ , lExtensions = [".rl"]+ , lMimetypes = []+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "([^%\\'\"/#]+|%(?=[^%]|$)|\"(\\\\\\\\|\\\\\"|[^\"])*\"|'(\\\\\\\\|\\\\'|[^'])*'|/\\*(.|\\n)*?\\*/|//.*$\\n?|\\#.*$\\n?|/(?!\\*)(\\\\\\\\|\\\\/|[^/])*/|/)+" (Arbitrary "Other")+ , tok "(%%)(?![{%])(.*)($|;)(\\n?)" (ByGroups [(Arbitrary "Punctuation"), (Using Ragel.lexer), (Arbitrary "Punctuation"), (Arbitrary "Text")])+ , tokNext "(%%%%|%%){" (Arbitrary "Punctuation") (GoTo multiLineFsm')+ ]++multiLineFsm' :: TokenMatcher+multiLineFsm' =+ [ tok "(([^}\\'\"\\[/#]|}(?=[^%]|$)|}%(?=[^%]|$)|[^\\\\][\\\\][{}]|(>|\\$|%|<|@|<>)/|/(?!\\*)(\\\\\\\\|\\\\/|[^/])*/\\*|/(?=[^/\\*]|$))+|\"(\\\\\\\\|\\\\\"|[^\"])*\"|'(\\\\\\\\|\\\\'|[^'])*'|\\[(\\\\\\\\|\\\\\\]|[^\\]])*\\]|/\\*(.|\\n)*?\\*/|//.*$\\n?|\\#.*$\\n?)+" (Using Ragel.lexer)+ , tokNext "}%%" (Arbitrary "Punctuation") Pop+ ]+
+ src/Text/Highlighter/Lexers/Redcode.hs view
@@ -0,0 +1,28 @@+module Text.Highlighter.Lexers.Redcode (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Redcode"+ , lAliases = ["redcode"]+ , lExtensions = [".cw"]+ , lMimetypes = []+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok ";.*$" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "\\b(DAT|MOV|ADD|SUB|MUL|DIV|MOD|JMP|JMZ|JMN|DJN|CMP|SLT|SPL|ORG|EQU|END)\\b" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "\\b(A|B|AB|BA|F|X|I)\\b" (Arbitrary "Name" :. Arbitrary "Decorator")+ , tok "[A-Za-z_][A-Za-z_0-9]+" (Arbitrary "Name")+ , tok "[-+*/%]" (Arbitrary "Operator")+ , tok "[#$@<>]" (Arbitrary "Operator")+ , tok "[.,]" (Arbitrary "Punctuation")+ , tok "[-+]?\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ ]+
+ src/Text/Highlighter/Lexers/S.hs view
@@ -0,0 +1,86 @@+module Text.Highlighter.Lexers.S (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "S"+ , lAliases = ["splus", "s", "r"]+ , lExtensions = [".S", ".R"]+ , lMimetypes = ["text/S-plus", "text/S", "text/R"]+ , lStart = root'+ , lFlags = [multiline]+ }++statements' :: TokenMatcher+statements' =+ [ anyOf comments'+ , tok "\\s+" (Arbitrary "Text")+ , tokNext "\\'" (Arbitrary "Literal" :. Arbitrary "String") (GoTo string_squote')+ , tokNext "\\\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo string_dquote')+ , anyOf builtin_symbols'+ , anyOf numbers'+ , anyOf keywords'+ , anyOf punctuation'+ , anyOf operators'+ , anyOf valid_name'+ ]++string_dquote' :: TokenMatcher+string_dquote' =+ [ tokNext "[^\\\"]*\\\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]++operators' :: TokenMatcher+operators' =+ [ tok "<-|-|==|<=|>=|<|>|&&|&|!=|\\|\\|?" (Arbitrary "Operator")+ , tok "\\*|\\+|\\^|/|%%|%/%|=" (Arbitrary "Operator")+ , tok "%in%|%*%" (Arbitrary "Operator")+ ]++keywords' :: TokenMatcher+keywords' =+ [ tok "for(?=\\s*\\()|while(?=\\s*\\()|if(?=\\s*\\()|(?<=\\s)else|(?<=\\s)break(?=;|$)|return(?=\\s*\\()|function(?=\\s*\\()" (Arbitrary "Keyword" :. Arbitrary "Reserved")+ ]++numbers' :: TokenMatcher+numbers' =+ [ tok "(?<![0-9a-zA-Z\\)\\}\\]`\\\"])(?=\\s*)[-\\+]?[0-9]+(\\.[0-9]*)?(E[0-9][-\\+]?(\\.[0-9]*)?)?" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "\\.[0-9]*(E[0-9][-\\+]?(\\.[0-9]*)?)?" (Arbitrary "Literal" :. Arbitrary "Number")+ ]++valid_name' :: TokenMatcher+valid_name' =+ [ tok "[a-zA-Z][0-9a-zA-Z\\._]+" (Arbitrary "Text")+ , tok "`.+`" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Backtick")+ ]++builtin_symbols' :: TokenMatcher+builtin_symbols' =+ [ tok "(NULL|NA|TRUE|FALSE|NaN)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tok "(T|F)\\b" (Arbitrary "Keyword" :. Arbitrary "Variable")+ ]++punctuation' :: TokenMatcher+punctuation' =+ [ tok "\\[|\\]|\\[\\[|\\]\\]|\\$|\\(|\\)|@|:::?|;|," (Arbitrary "Punctuation")+ ]++comments' :: TokenMatcher+comments' =+ [ tok "#.*$" (Arbitrary "Comment" :. Arbitrary "Single")+ ]++root' :: TokenMatcher+root' =+ [ anyOf statements'+ , tok "\\{|\\}" (Arbitrary "Punctuation")+ , tok "." (Arbitrary "Text")+ ]++string_squote' :: TokenMatcher+string_squote' =+ [ tokNext "[^\\']*\\'" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]+
+ src/Text/Highlighter/Lexers/Scala.hs view
@@ -0,0 +1,85 @@+module Text.Highlighter.Lexers.Scala (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Scala"+ , lAliases = ["scala"]+ , lExtensions = [".scala"]+ , lMimetypes = ["text/x-scala"]+ , lStart = root'+ , lFlags = [multiline, dotall]+ }++comment' :: TokenMatcher+comment' =+ [ tok "[^/\\*]+" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "/\\*" (Arbitrary "Comment" :. Arbitrary "Multiline") Push+ , tokNext "\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline") Pop+ , tok "[*/]" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]++root' :: TokenMatcher+root' =+ [ tokNext "(class|trait|object)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo class')+ , tok "'[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500](?:[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500]|[0-9])*(?:(?<=_)[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+)?" (Arbitrary "Text" :. Arbitrary "Symbol")+ , tok "[^\\S\\n]+" (Arbitrary "Text")+ , tok "//.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tokNext "/\\*" (Arbitrary "Comment" :. Arbitrary "Multiline") (GoTo comment')+ , tok "@[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500](?:[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500]|[0-9])*(?:(?<=_)[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+)?" (Arbitrary "Name" :. Arbitrary "Decorator")+ , tok "(abstract|ca(?:se|tch)|d(?:ef|o)|e(?:lse|xtends)|f(?:inal(?:ly)?|or(?:Some)?)|i(?:f|mplicit)|lazy|match|new|override|pr(?:ivate|otected)|re(?:quires|turn)|s(?:ealed|uper)|t(?:h(?:is|row)|ry)|va[lr]|w(?:hile|ith)|yield)\\b|(<[%:-]|=>|>:|[#=@_\8658\8592])(\8|(?=\\s)|$)" (Arbitrary "Keyword")+ , tokNext ":(?![-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+)" (Arbitrary "Keyword") (GoTo type')+ , tok "[A-Z\\$_\192-\214\216-\222\256\258\260\262\264\266\268\270\272\274\276\278\280\282\284\286\288\290\292\294\296\298\300\302\304\306\308\310\313\315\317\319\321\323\325\327\330\332\334\336\338\340\342\344\346\348\350\352\354\356\358\360\362\364\366\368\370\372\374\376-\377\379\381\385-\386\388\390-\391\393-\395\398-\401\403-\404\406-\408\412-\413\415-\416\418\420\422-\423\425\428\430-\431\433-\435\437\439-\440\444\452\455\458\461\463\465\467\469\471\473\475\478\480\482\484\486\488\490\492\494\497\500\502-\504\506\508\510\512\514\516\518\520\522\524\526\528\530\532\534\536\538\540\542\544\546\548\550\552\554\556\558\560\562\570-\571\573-\574\577\579-\582\584\586\588\590\880\882\886\902\904-\911\913-\939\975\978-\980\984\986\988\990\992\994\996\998\1000\1002\1004\1006\1012\1015\1017-\1018\1021-\1071\1120\1122\1124\1126\1128\1130\1132\1134\1136\1138\1140\1142\1144\1146\1148\1150\1152\1162\1164\1166\1168\1170\1172\1174\1176\1178\1180\1182\1184\1186\1188\1190\1192\1194\1196\1198\1200\1202\1204\1206\1208\1210\1212\1214\1216-\1217\1219\1221\1223\1225\1227\1229\1232\1234\1236\1238\1240\1242\1244\1246\1248\1250\1252\1254\1256\1258\1260\1262\1264\1266\1268\1270\1272\1274\1276\1278\1280\1282\1284\1286\1288\1290\1292\1294\1296\1298\1300\1302\1304\1306\1308\1310\1312\1314\1329-\1366\4256-\4293\7680\7682\7684\7686\7688\7690\7692\7694\7696\7698\7700\7702\7704\7706\7708\7710\7712\7714\7716\7718\7720\7722\7724\7726\7728\7730\7732\7734\7736\7738\7740\7742\7744\7746\7748\7750\7752\7754\7756\7758\7760\7762\7764\7766\7768\7770\7772\7774\7776\7778\7780\7782\7784\7786\7788\7790\7792\7794\7796\7798\7800\7802\7804\7806\7808\7810\7812\7814\7816\7818\7820\7822\7824\7826\7828\7838\7840\7842\7844\7846\7848\7850\7852\7854\7856\7858\7860\7862\7864\7866\7868\7870\7872\7874\7876\7878\7880\7882\7884\7886\7888\7890\7892\7894\7896\7898\7900\7902\7904\7906\7908\7910\7912\7914\7916\7918\7920\7922\7924\7926\7928\7930\7932\7934\7944-\7951\7960-\7965\7976-\7983\7992-\7999\8008-\8013\8025-\8031\8040-\8047\8120-\8123\8136-\8139\8152-\8155\8168-\8172\8184-\8187\8450\8455\8459-\8461\8464-\8466\8469\8473-\8477\8484\8486\8488\8490-\8493\8496-\8499\8510-\8511\8517\8579\11264-\11310\11360\11362-\11364\11367\11369\11371\11373-\11375\11378\11381\11392\11394\11396\11398\11400\11402\11404\11406\11408\11410\11412\11414\11416\11418\11420\11422\11424\11426\11428\11430\11432\11434\11436\11438\11440\11442\11444\11446\11448\11450\11452\11454\11456\11458\11460\11462\11464\11466\11468\11470\11472\11474\11476\11478\11480\11482\11484\11486\11488\11490\42560\42562\42564\42566\42568\42570\42572\42574\42576\42578\42580\42582\42584\42586\42588\42590\42594\42596\42598\42600\42602\42604\42624\42626\42628\42630\42632\42634\42636\42638\42640\42642\42644\42646\42786\42788\42790\42792\42794\42796\42798\42802\42804\42806\42808\42810\42812\42814\42816\42818\42820\42822\42824\42826\42828\42830\42832\42834\42836\42838\42840\42842\42844\42846\42848\42850\42852\42854\42856\42858\42860\42862\42873\42875\42877-\42878\42880\42882\42884\42886\42891\65313-\65338][a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500](?:[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500]|[0-9])*(?:(?<=_)[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+)?\\b" (Arbitrary "Name" :. Arbitrary "Class")+ , tok "(true|false|null)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tokNext "(import|package)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo import')+ , tokNext "(type)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo type')+ , tok "\"\"\"(?:.|\\n)*?\"\"\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "'\\\\.'|'[^\\\\]'|'\\\\u[0-9a-f]{4}'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500](?:[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500]|[0-9])*(?:(?<=_)[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+)?" (Arbitrary "Name")+ , tok "`[^`]+`" (Arbitrary "Name")+ , tokNext "\\[" (Arbitrary "Operator") (GoTo typeparam')+ , tok "[\\(\\)\\{\\};,.]" (Arbitrary "Operator")+ , tok "[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+" (Arbitrary "Operator")+ , tok "([0-9][0-9]*\\.[0-9]*|\\.[0-9]+)([eE][+-]?[0-9]+)?[fFdD]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0x[0-9a-f]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "[0-9]+L?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\\n" (Arbitrary "Text")+ ]++typeparam' :: TokenMatcher+typeparam' =+ [ tok "[\\s\\n,]+" (Arbitrary "Text")+ , tok "<[%:]|=>|>:|[#_\8658]|forSome|type" (Arbitrary "Keyword")+ , tokNext "([\\]\\)\\}])" (Arbitrary "Operator") Pop+ , tokNext "[\\(\\[\\{]" (Arbitrary "Operator") Push+ , tok "\\.|[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500](?:[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500]|[0-9])*(?:(?<=_)[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+)?|[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+|`[^`]+`" (Arbitrary "Keyword" :. Arbitrary "Type")+ ]++import' :: TokenMatcher+import' =+ [ tokNext "([a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500](?:[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500]|[0-9])*(?:(?<=_)[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+)?|\\.)+" (Arbitrary "Name" :. Arbitrary "Namespace") Pop+ ]++type' :: TokenMatcher+type' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "<[%:]|>:|[#_\8658]|forSome|type" (Arbitrary "Keyword")+ , tokNext "([,\\);}]|=>|=)([\\s\\n]*)" (ByGroups [(Arbitrary "Operator"), (Arbitrary "Text")]) Pop+ , tokNext "[\\(\\{]" (Arbitrary "Operator") Push+ , tokNext "((?:[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500](?:[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500]|[0-9])*(?:(?<=_)[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+)?|[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+|`[^`]+`)(?:\\.(?:[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500](?:[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500]|[0-9])*(?:(?<=_)[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+)?|[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+|`[^`]+`))*)(\\s*)(\\[)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Type"), (Arbitrary "Text"), (Arbitrary "Operator")]) (DoAll [Pop, (GoTo typeparam')])+ , tokNext "((?:[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500](?:[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500]|[0-9])*(?:(?<=_)[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+)?|[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+|`[^`]+`)(?:\\.(?:[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500](?:[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500]|[0-9])*(?:(?<=_)[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+)?|[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+|`[^`]+`))*)(\\s*)$" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Type"), (Arbitrary "Text")]) Pop+ , tok "\\.|[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500](?:[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500]|[0-9])*(?:(?<=_)[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+)?|[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+|`[^`]+`" (Arbitrary "Keyword" :. Arbitrary "Type")+ ]++class' :: TokenMatcher+class' =+ [ tokNext "([a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500](?:[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500]|[0-9])*(?:(?<=_)[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+)?|[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+|`[^`]+`)(\\s*)(\\[)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Text"), (Arbitrary "Operator")]) (GoTo typeparam')+ , tok "[\\s\\n]+" (Arbitrary "Text")+ , tokNext "{" (Arbitrary "Operator") Pop+ , tokNext "\\(" (Arbitrary "Operator") Pop+ , tokNext "[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500](?:[a-zA-Z\\$_\170\181\186\192-\214\216-\246\248-\687\880-\883\886-\887\891-\893\902\904-\1013\1015-\1153\1162-\1366\1377-\1415\1488-\1522\1569-\1599\1601-\1610\1646-\1647\1649-\1747\1749\1774-\1775\1786-\1788\1791\1808\1810-\1839\1869-\1957\1969\1994-\2026\2308-\2361\2365\2384\2392-\2401\2418-\2431\2437-\2489\2493\2510\2524-\2529\2544-\2545\2565-\2617\2649-\2654\2674-\2676\2693-\2745\2749\2768-\2785\2821-\2873\2877\2908-\2913\2929\2947-\3001\3024\3077-\3133\3160-\3169\3205-\3257\3261\3294-\3297\3333-\3389\3424-\3425\3450-\3455\3461-\3526\3585-\3632\3634-\3635\3648-\3653\3713-\3760\3762-\3763\3773-\3780\3804-\3840\3904-\3948\3976-\3979\4096-\4138\4159\4176-\4181\4186-\4189\4193\4197-\4198\4206-\4208\4213-\4225\4238\4256-\4346\4352-\4954\4992-\5007\5024-\5740\5743-\5750\5761-\5786\5792-\5866\5870-\5905\5920-\5937\5952-\5969\5984-\6000\6016-\6067\6108\6176-\6210\6212-\6312\6314-\6428\6480-\6569\6593-\6599\6656-\6678\6917-\6963\6981-\6987\7043-\7072\7086-\7087\7168-\7203\7245-\7247\7258-\7287\7424-\7467\7522-\7543\7545-\7578\7680-\8124\8126\8130-\8140\8144-\8155\8160-\8172\8178-\8188\8305\8319\8450\8455\8458-\8467\8469\8473-\8477\8484\8486\8488\8490-\8493\8495-\8505\8508-\8511\8517-\8521\8526\8544-\8584\11264-\11388\11392-\11492\11520-\11621\11648-\11742\12294-\12295\12321-\12329\12344-\12346\12348\12353-\12438\12447\12449-\12538\12543-\12686\12704-\12727\12784-\12799\13312-\19893\19968-\40980\40982-\42124\42240-\42507\42512-\42527\42538-\42606\42624-\42647\42786-\42863\42865-\42887\42891-\43009\43011-\43013\43015-\43018\43020-\43042\43072-\43123\43138-\43187\43274-\43301\43312-\43334\43520-\43560\43584-\43586\43588-\43595\44032-\55203\63744-\64285\64287-\64296\64298-\64829\64848-\65019\65136-\65276\65313-\65338\65345-\65370\65382-\65391\65393-\65437\65440-\65500]|[0-9])*(?:(?<=_)[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+)?|[-\126\\^\\*!%&\\\\<>\\|+=:/?@\166-\167\169\172\174\176-\177\182\215\247\1014\1154\1542-\1544\1550-\1551\1769\1789-\1790\2038\2554\2928\3059-\3064\3066\3199\3313-\3314\3449\3841-\3843\3859-\3863\3866-\3871\3892\3894\3896\4030-\4037\4039-\4047\4254-\4255\4960\5008-\5017\6464\6624-\6655\7009-\7018\7028-\7036\8260\8274\8314-\8316\8330-\8332\8448-\8449\8451-\8454\8456-\8457\8468\8470-\8472\8478-\8483\8485\8487\8489\8494\8506-\8507\8512-\8516\8522-\8525\8527\8592-\9000\9003-\9290\9372-\9449\9472-\10087\10132-\10180\10183-\10213\10224-\10626\10649-\10711\10716-\10747\10750-\11092\11493-\11498\11904-\12283\12292\12306-\12307\12320\12342-\12343\12350-\12351\12688-\12689\12694-\12703\12736-\12771\12800-\12830\12842-\12880\12896-\12927\12938-\12976\12992-\13311\19904-\19967\42128-\42182\43048-\43051\64297\65021\65122\65124-\65126\65291\65308-\65310\65372\65374\65506\65508\65512-\65518\65532-\65533]+|`[^`]+`" (Arbitrary "Name" :. Arbitrary "Class") Pop+ ]+
+ src/Text/Highlighter/Lexers/Scheme.hs view
@@ -0,0 +1,35 @@+module Text.Highlighter.Lexers.Scheme (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Scheme"+ , lAliases = ["scheme", "scm"]+ , lExtensions = [".scm"]+ , lMimetypes = ["text/x-scheme", "application/x-scheme"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok ";.*$" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "\\s+" (Arbitrary "Text")+ , tok "-?\\d+\\.\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "-?\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "'[a-zA-Z0-9!$%&*+,/:<=>?@^_\126|-]+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol")+ , tok "#\\\\([()/'\\\".'_!\194\167$%& ?=+-]{1}|[a-zA-Z0-9]+)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "(#t|#f)" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "('|#|`|,@|,|\\.)" (Arbitrary "Operator")+ , tok "(lambda |define |if |else |cond |and |or |case |let |let\\* |letrec |begin |do |delay |set\\! |\\=\\> |quote |quasiquote |unquote |unquote\\-splicing |define\\-syntax |let\\-syntax |letrec\\-syntax |syntax\\-rules )" (Arbitrary "Keyword")+ , tok "(?<='\\()[a-zA-Z0-9!$%&*+,/:<=>?@^_\126|-]+" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "(?<=#\\()[a-zA-Z0-9!$%&*+,/:<=>?@^_\126|-]+" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "(?<=\\()(\\* |\\+ |\\- |\\/ |\\< |\\<\\= |\\= |\\> |\\>\\= |abs |acos |angle |append |apply |asin |assoc |assq |assv |atan |boolean\\? |caaaar |caaadr |caaar |caadar |caaddr |caadr |caar |cadaar |cadadr |cadar |caddar |cadddr |caddr |cadr |call\\-with\\-current\\-continuation |call\\-with\\-input\\-file |call\\-with\\-output\\-file |call\\-with\\-values |call\\/cc |car |cdaaar |cdaadr |cdaar |cdadar |cdaddr |cdadr |cdar |cddaar |cddadr |cddar |cdddar |cddddr |cdddr |cddr |cdr |ceiling |char\\-\\>integer |char\\-alphabetic\\? |char\\-ci\\<\\=\\? |char\\-ci\\<\\? |char\\-ci\\=\\? |char\\-ci\\>\\=\\? |char\\-ci\\>\\? |char\\-downcase |char\\-lower\\-case\\? |char\\-numeric\\? |char\\-ready\\? |char\\-upcase |char\\-upper\\-case\\? |char\\-whitespace\\? |char\\<\\=\\? |char\\<\\? |char\\=\\? |char\\>\\=\\? |char\\>\\? |char\\? |close\\-input\\-port |close\\-output\\-port |complex\\? |cons |cos |current\\-input\\-port |current\\-output\\-port |denominator |display |dynamic\\-wind |eof\\-object\\? |eq\\? |equal\\? |eqv\\? |eval |even\\? |exact\\-\\>inexact |exact\\? |exp |expt |floor |for\\-each |force |gcd |imag\\-part |inexact\\-\\>exact |inexact\\? |input\\-port\\? |integer\\-\\>char |integer\\? |interaction\\-environment |lcm |length |list |list\\-\\>string |list\\-\\>vector |list\\-ref |list\\-tail |list\\? |load |log |magnitude |make\\-polar |make\\-rectangular |make\\-string |make\\-vector |map |max |member |memq |memv |min |modulo |negative\\? |newline |not |null\\-environment |null\\? |number\\-\\>string |number\\? |numerator |odd\\? |open\\-input\\-file |open\\-output\\-file |output\\-port\\? |pair\\? |peek\\-char |port\\? |positive\\? |procedure\\? |quotient |rational\\? |rationalize |read |read\\-char |real\\-part |real\\? |remainder |reverse |round |scheme\\-report\\-environment |set\\-car\\! |set\\-cdr\\! |sin |sqrt |string |string\\-\\>list |string\\-\\>number |string\\-\\>symbol |string\\-append |string\\-ci\\<\\=\\? |string\\-ci\\<\\? |string\\-ci\\=\\? |string\\-ci\\>\\=\\? |string\\-ci\\>\\? |string\\-copy |string\\-fill\\! |string\\-length |string\\-ref |string\\-set\\! |string\\<\\=\\? |string\\<\\? |string\\=\\? |string\\>\\=\\? |string\\>\\? |string\\? |substring |symbol\\-\\>string |symbol\\? |tan |transcript\\-off |transcript\\-on |truncate |values |vector |vector\\-\\>list |vector\\-fill\\! |vector\\-length |vector\\-ref |vector\\-set\\! |vector\\? |with\\-input\\-from\\-file |with\\-output\\-to\\-file |write |write\\-char |zero\\? )" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "(?<=\\()[a-zA-Z0-9!$%&*+,/:<=>?@^_\126|-]+" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "[a-zA-Z0-9!$%&*+,/:<=>?@^_\126|-]+" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "(\\(|\\))" (Arbitrary "Punctuation")+ ]+
+ src/Text/Highlighter/Lexers/Scss.hs view
@@ -0,0 +1,144 @@+module Text.Highlighter.Lexers.Scss (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "SCSS"+ , lAliases = ["scss"]+ , lExtensions = [".scss"]+ , lMimetypes = ["text/x-scss"]+ , lStart = root'+ , lFlags = [caseless, dotall]+ }++stringUrl' :: TokenMatcher+stringUrl' =+ [ tok "(\\\\#|#(?=[^\\n{])|[^\\n#)])+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ , tokNext "#\\{" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol") (GoTo interpolation')+ , tokNext "\\)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other") Pop+ ]++attr' :: TokenMatcher+attr' =+ [ tok "[^\\s:=\"\\[]+" (Arbitrary "Name" :. Arbitrary "Attribute")+ , tokNext "#{" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol") (GoTo interpolation')+ , tokNext "[ \\t]*:" (Arbitrary "Operator") (GoTo value')+ ]++stringDouble' :: TokenMatcher+stringDouble' =+ [ tok "(\\\\.|#(?=[^\\n{])|[^\\n\"#])+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tokNext "#\\{" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol") (GoTo interpolation')+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") Pop+ ]++class' :: TokenMatcher+class' =+ [ tok "[\\w-]+" (Arbitrary "Name" :. Arbitrary "Class")+ , tokNext "#\\{" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol") (GoTo interpolation')+ , tokNext "" (Arbitrary "Text") Pop+ ]++pseudoClass' :: TokenMatcher+pseudoClass' =+ [ tok "[\\w-]+" (Arbitrary "Name" :. Arbitrary "Decorator")+ , tokNext "#\\{" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol") (GoTo interpolation')+ , tokNext "" (Arbitrary "Text") Pop+ ]++value' :: TokenMatcher+value' =+ [ tok "[ \\t]+" (Arbitrary "Text")+ , tok "[!$][\\w-]+" (Arbitrary "Name" :. Arbitrary "Variable")+ , tokNext "url\\(" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other") (GoTo stringUrl')+ , tok "[a-z_-][\\w-]*(?=\\()" (Arbitrary "Name" :. Arbitrary "Function")+ , tok "(azimuth|background-attachment|background-color|background-image|background-position|background-repeat|background|border-bottom-color|border-bottom-style|border-bottom-width|border-left-color|border-left-style|border-left-width|border-right|border-right-color|border-right-style|border-right-width|border-top-color|border-top-style|border-top-width|border-bottom|border-collapse|border-left|border-width|border-color|border-spacing|border-style|border-top|border|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|height|letter-spacing|line-height|list-style-type|list-style-image|list-style-position|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|marker-offset|marks|max-height|max-width|min-height|min-width|opacity|orphans|outline|outline-color|outline-style|outline-width|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page|page-break-after|page-break-before|page-break-inside|pause-after|pause-before|pause|pitch|pitch-range|play-during|position|quotes|richness|right|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|z-index|bottom|left|above|absolute|always|armenian|aural|auto|avoid|baseline|behind|below|bidi-override|blink|block|bold|bolder|both|capitalize|center-left|center-right|center|circle|cjk-ideographic|close-quote|collapse|condensed|continuous|crop|crosshair|cross|cursive|dashed|decimal-leading-zero|decimal|default|digits|disc|dotted|double|e-resize|embed|extra-condensed|extra-expanded|expanded|fantasy|far-left|far-right|faster|fast|fixed|georgian|groove|hebrew|help|hidden|hide|higher|high|hiragana-iroha|hiragana|icon|inherit|inline-table|inline|inset|inside|invert|italic|justify|katakana-iroha|katakana|landscape|larger|large|left-side|leftwards|level|lighter|line-through|list-item|loud|lower-alpha|lower-greek|lower-roman|lowercase|ltr|lower|low|medium|message-box|middle|mix|monospace|n-resize|narrower|ne-resize|no-close-quote|no-open-quote|no-repeat|none|normal|nowrap|nw-resize|oblique|once|open-quote|outset|outside|overline|pointer|portrait|px|relative|repeat-x|repeat-y|repeat|rgb|ridge|right-side|rightwards|s-resize|sans-serif|scroll|se-resize|semi-condensed|semi-expanded|separate|serif|show|silent|slow|slower|small-caps|small-caption|smaller|soft|solid|spell-out|square|static|status-bar|super|sw-resize|table-caption|table-cell|table-column|table-column-group|table-footer-group|table-header-group|table-row|table-row-group|text|text-bottom|text-top|thick|thin|transparent|ultra-condensed|ultra-expanded|underline|upper-alpha|upper-latin|upper-roman|uppercase|url|visible|w-resize|wait|wider|x-fast|x-high|x-large|x-loud|x-low|x-small|x-soft|xx-large|xx-small|yes)\\b" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "(indigo|gold|firebrick|indianred|darkolivegreen|darkseagreen|mediumvioletred|mediumorchid|chartreuse|mediumslateblue|springgreen|crimson|lightsalmon|brown|turquoise|olivedrab|cyan|skyblue|darkturquoise|goldenrod|darkgreen|darkviolet|darkgray|lightpink|darkmagenta|lightgoldenrodyellow|lavender|yellowgreen|thistle|violet|orchid|ghostwhite|honeydew|cornflowerblue|darkblue|darkkhaki|mediumpurple|cornsilk|bisque|slategray|darkcyan|khaki|wheat|deepskyblue|darkred|steelblue|aliceblue|gainsboro|mediumturquoise|floralwhite|coral|lightgrey|lightcyan|darksalmon|beige|azure|lightsteelblue|oldlace|greenyellow|royalblue|lightseagreen|mistyrose|sienna|lightcoral|orangered|navajowhite|palegreen|burlywood|seashell|mediumspringgreen|papayawhip|blanchedalmond|peru|aquamarine|darkslategray|ivory|dodgerblue|lemonchiffon|chocolate|orange|forestgreen|slateblue|mintcream|antiquewhite|darkorange|cadetblue|moccasin|limegreen|saddlebrown|darkslateblue|lightskyblue|deeppink|plum|darkgoldenrod|sandybrown|magenta|tan|rosybrown|pink|lightblue|palevioletred|mediumseagreen|dimgray|powderblue|seagreen|snow|mediumblue|midnightblue|paleturquoise|palegoldenrod|whitesmoke|darkorchid|salmon|lightslategray|lawngreen|lightgreen|tomato|hotpink|lightyellow|lavenderblush|linen|mediumaquamarine|blueviolet|peachpuff)\\b" (Arbitrary "Name" :. Arbitrary "Entity")+ , tok "(black|silver|gray|white|maroon|red|purple|fuchsia|green|lime|olive|yellow|navy|blue|teal|aqua)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "\\!(important|default)" (Arbitrary "Name" :. Arbitrary "Exception")+ , tok "(true|false)" (Arbitrary "Name" :. Arbitrary "Pseudo")+ , tok "(and|or|not)" (Arbitrary "Operator" :. Arbitrary "Word")+ , tokNext "/\\*" (Arbitrary "Comment" :. Arbitrary "Multiline") (GoTo inlineComment')+ , tok "//[^\\n]*" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "\\#[a-z0-9]{1,6}" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "(-?\\d+)(\\%|[a-z]+)?" (ByGroups [(Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer"), (Arbitrary "Keyword" :. Arbitrary "Type")])+ , tok "(-?\\d*\\.\\d+)(\\%|[a-z]+)?" (ByGroups [(Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float"), (Arbitrary "Keyword" :. Arbitrary "Type")])+ , tokNext "#{" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol") (GoTo interpolation')+ , tok "[\126\\^\\*!&%<>\\|+=@:,./?-]+" (Arbitrary "Operator")+ , tok "[\\[\\]()]+" (Arbitrary "Punctuation")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") (GoTo stringDouble')+ , tokNext "'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single") (GoTo stringSingle')+ , tok "[a-z_-][\\w-]*" (Arbitrary "Name")+ , tok "\\n" (Arbitrary "Text")+ , tokNext "[;{}]" (Arbitrary "Punctuation") (GoTo root')+ ]++for' :: TokenMatcher+for' =+ [ tok "(from|to|through)" (Arbitrary "Operator" :. Arbitrary "Word")+ , anyOf value'+ ]++stringSingle' :: TokenMatcher+stringSingle' =+ [ tok "(\\\\.|#(?=[^\\n{])|[^\\n'#])+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tokNext "#\\{" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol") (GoTo interpolation')+ , tokNext "'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") Pop+ ]++inlineComment' :: TokenMatcher+inlineComment' =+ [ tok "(\\\\#|#(?=[^{])|\\*(?=[^/])|[^#*])+" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "#\\{" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol") (GoTo interpolation')+ , tokNext "\\*/" (Arbitrary "Comment") Pop+ ]++selector' :: TokenMatcher+selector' =+ [ tok "[ \\t]+" (Arbitrary "Text")+ , tokNext "\\:" (Arbitrary "Name" :. Arbitrary "Decorator") (GoTo pseudoClass')+ , tokNext "\\." (Arbitrary "Name" :. Arbitrary "Class") (GoTo class')+ , tokNext "\\#" (Arbitrary "Name" :. Arbitrary "Namespace") (GoTo id')+ , tok "[a-zA-Z0-9_-]+" (Arbitrary "Name" :. Arbitrary "Tag")+ , tokNext "#\\{" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol") (GoTo interpolation')+ , tok "&" (Arbitrary "Keyword")+ , tok "[\126\\^\\*!&\\[\\]\\(\\)<>\\|+=@:;,./?-]" (Arbitrary "Operator")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") (GoTo stringDouble')+ , tokNext "'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single") (GoTo stringSingle')+ , tok "\\n" (Arbitrary "Text")+ , tokNext "[;{}]" (Arbitrary "Punctuation") (GoTo root')+ ]++root' :: TokenMatcher+root' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "//.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/\\*.*?\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "@import" (Arbitrary "Keyword") (GoTo value')+ , tokNext "@for" (Arbitrary "Keyword") (GoTo for')+ , tokNext "@(debug|warn|if|while)" (Arbitrary "Keyword") (GoTo value')+ , tokNext "(@mixin)( [\\w-]+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Name" :. Arbitrary "Function")]) (GoTo value')+ , tokNext "(@include)( [\\w-]+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Name" :. Arbitrary "Decorator")]) (GoTo value')+ , tokNext "@extend" (Arbitrary "Keyword") (GoTo selector')+ , tokNext "@[a-z0-9_-]+" (Arbitrary "Keyword") (GoTo selector')+ , tokNext "(\\$[\\w-]\\w*)([ \\t]*:)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Operator")]) (GoTo value')+ , tokNext "(?=[^;{}][;}])" (Arbitrary "Name" :. Arbitrary "Attribute") (GoTo attr')+ , tokNext "(?=[^;{}:]+:[^a-z])" (Arbitrary "Name" :. Arbitrary "Attribute") (GoTo attr')+ , tokNext "" (Arbitrary "Text") (GoTo selector')+ ]++id' :: TokenMatcher+id' =+ [ tok "[\\w-]+" (Arbitrary "Name" :. Arbitrary "Namespace")+ , tokNext "#\\{" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol") (GoTo interpolation')+ , tokNext "" (Arbitrary "Text") Pop+ ]++interpolation' :: TokenMatcher+interpolation' =+ [ tokNext "\\}" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Interpol") Pop+ , anyOf value'+ ]+
+ src/Text/Highlighter/Lexers/Smalltalk.hs view
@@ -0,0 +1,118 @@+module Text.Highlighter.Lexers.Smalltalk (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Smalltalk"+ , lAliases = ["smalltalk", "squeak"]+ , lExtensions = [".st"]+ , lMimetypes = ["text/x-smalltalk"]+ , lStart = root'+ , lFlags = [multiline]+ }++objects' :: TokenMatcher+objects' =+ [ tokNext "\\[" (Arbitrary "Text") (GoTo blockvariables')+ , tokNext "\\]" (Arbitrary "Text") (GoTo afterobject')+ , tokNext "\\b(self|super|true|false|nil|thisContext)\\b" (Arbitrary "Name" :. Arbitrary "Builtin" :. Arbitrary "Pseudo") (GoTo afterobject')+ , tokNext "\\b[A-Z]\\w*(?!:)\\b" (Arbitrary "Name" :. Arbitrary "Class") (GoTo afterobject')+ , tokNext "\\b[a-z]\\w*(?!:)\\b" (Arbitrary "Name" :. Arbitrary "Variable") (GoTo afterobject')+ , tokNext "#(\"[^\"]*\"|[-+*/\\\\\126<>=|&!?,@%]+|[\\w:]+)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol") (GoTo afterobject')+ , anyOf literals'+ ]++blockvariables' :: TokenMatcher+blockvariables' =+ [ anyOf whitespaces'+ , tok "(:)(\\s*)([A-Za-z\\w]+)" (ByGroups [(Arbitrary "Operator"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Variable")])+ , tokNext "\\|" (Arbitrary "Operator") Pop+ , tokNext "" (Arbitrary "Text") Pop+ ]++_parenth_helper' :: TokenMatcher+_parenth_helper' =+ [ anyOf whitespaces'+ , tok "(\\d+r)?-?\\d+(\\.\\d+)?(e-?\\d+)?" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "[-+*/\\\\\126<>=|&#!?,@%\\w+:]+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol")+ , tok "\\'[^\\']*\\'" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\$." (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tokNext "#*\\(" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol") (GoTo inner_parenth')+ ]++afterobject' :: TokenMatcher+afterobject' =+ [ tokNext "! !$" (Arbitrary "Keyword") Pop+ , anyOf whitespaces'+ , tokNext "\\b(ifTrue:|ifFalse:|whileTrue:|whileFalse:|timesRepeat:)" (Arbitrary "Name" :. Arbitrary "Builtin") Pop+ , tok "\\b(new\\b(?!:))" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tokNext "\\:=|\\_" (Arbitrary "Operator") Pop+ , tokNext "\\b[a-zA-Z]+\\w*:" (Arbitrary "Name" :. Arbitrary "Function") Pop+ , tok "\\b[a-zA-Z]+\\w*" (Arbitrary "Name" :. Arbitrary "Function")+ , tokNext "\\w+:?|[-+*/\\\\\126<>=|&!?,@%]+" (Arbitrary "Name" :. Arbitrary "Function") Pop+ , tokNext "\\." (Arbitrary "Punctuation") Pop+ , tok ";" (Arbitrary "Punctuation")+ , tok "[\\])}]" (Arbitrary "Text")+ , tokNext "[\\[({]" (Arbitrary "Text") Pop+ ]++literals' :: TokenMatcher+literals' =+ [ tokNext "\\'[^\\']*\\'" (Arbitrary "Literal" :. Arbitrary "String") (GoTo afterobject')+ , tokNext "\\$." (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char") (GoTo afterobject')+ , tokNext "#\\(" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol") (GoTo parenth')+ , tokNext "\\)" (Arbitrary "Text") (GoTo afterobject')+ , tokNext "(\\d+r)?-?\\d+(\\.\\d+)?(e-?\\d+)?" (Arbitrary "Literal" :. Arbitrary "Number") (GoTo afterobject')+ ]++methodDefinition' :: TokenMatcher+methodDefinition' =+ [ tok "([a-zA-Z]+\\w*:)(\\s*)(\\w+)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Variable")])+ , tok "^(\\b[a-zA-Z]+\\w*\\b)(\\s*)$" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text")])+ , tok "^([-+*/\\\\\126<>=|&!?,@%]+)(\\s*)(\\w+)(\\s*)$" (ByGroups [(Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Text")])+ ]++parenth' :: TokenMatcher+parenth' =+ [ tokNext "\\)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol") (DoAll [(GoTo root'), (GoTo afterobject')])+ , anyOf _parenth_helper'+ ]++inner_parenth' :: TokenMatcher+inner_parenth' =+ [ tokNext "\\)" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol") Pop+ , anyOf _parenth_helper'+ ]++whitespaces' :: TokenMatcher+whitespaces' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "\"[^\"]*\"" (Arbitrary "Comment")+ ]++squeakFileout' :: TokenMatcher+squeakFileout' =+ [ tok "^\"[^\"]*\"!" (Arbitrary "Keyword")+ , tok "^'[^']*'!" (Arbitrary "Keyword")+ , tok "^(!)(\\w+)( commentStamp: )(.*?)( prior: .*?!\\n)(.*?)(!)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Keyword"), (Arbitrary "Literal" :. Arbitrary "String"), (Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Keyword")])+ , tok "^(!)(\\w+(?: class)?)( methodsFor: )(\\'[^\\']*\\')(.*?!)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Keyword"), (Arbitrary "Literal" :. Arbitrary "String"), (Arbitrary "Keyword")])+ , tok "^(\\w+)( subclass: )(#\\w+)(\\s+instanceVariableNames: )(.*?)(\\s+classVariableNames: )(.*?)(\\s+poolDictionaries: )(.*?)(\\s+category: )(.*?)(!)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Keyword"), (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol"), (Arbitrary "Keyword"), (Arbitrary "Literal" :. Arbitrary "String"), (Arbitrary "Keyword"), (Arbitrary "Literal" :. Arbitrary "String"), (Arbitrary "Keyword"), (Arbitrary "Literal" :. Arbitrary "String"), (Arbitrary "Keyword"), (Arbitrary "Literal" :. Arbitrary "String"), (Arbitrary "Keyword")])+ , tok "^(\\w+(?: class)?)(\\s+instanceVariableNames: )(.*?)(!)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Class"), (Arbitrary "Keyword"), (Arbitrary "Literal" :. Arbitrary "String"), (Arbitrary "Keyword")])+ , tok "(!\\n)(\\].*)(! !)$" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Keyword")])+ , tok "! !$" (Arbitrary "Keyword")+ ]++root' :: TokenMatcher+root' =+ [ tok "(<)(\\w+:)(.*?)(>)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Keyword"), (Arbitrary "Text"), (Arbitrary "Text")])+ , anyOf squeakFileout'+ , anyOf whitespaces'+ , anyOf methodDefinition'+ , tok "(\\|)([\\w\\s]*)(\\|)" (ByGroups [(Arbitrary "Operator"), (Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Operator")])+ , anyOf objects'+ , tok "\\^|\\:=|\\_" (Arbitrary "Operator")+ , tok "[\\]({}.;!]" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Smarty.hs view
@@ -0,0 +1,38 @@+module Text.Highlighter.Lexers.Smarty (lexer) where+import qualified Text.Highlighter.Lexers.Php as Php+import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Smarty"+ , lAliases = ["smarty"]+ , lExtensions = [".tpl"]+ , lMimetypes = ["application/x-smarty"]+ , lStart = root'+ , lFlags = [multiline, dotall]+ }++root' :: TokenMatcher+root' =+ [ tok "[^{]+" (Arbitrary "Other")+ , tok "(\\{)(\\*.*?\\*)(\\})" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Comment"), (Arbitrary "Comment" :. Arbitrary "Preproc")])+ , tok "(\\{php\\})(.*?)(\\{/php\\})" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Using Php.lexer), (Arbitrary "Comment" :. Arbitrary "Preproc")])+ , tokNext "(\\{)(/?[a-zA-Z_][a-zA-Z0-9_]*)(\\s*)" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Text")]) (GoTo smarty')+ , tokNext "\\{" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo smarty')+ ]++smarty' :: TokenMatcher+smarty' =+ [ tok "\\s+" (Arbitrary "Text")+ , tokNext "\\}" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ , tok "#[a-zA-Z_][a-zA-Z0-9_]*#" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "\\$[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z0-9_]+)*" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "[\126!%^&*()+=|\\[\\]:;,.<>/?{}@-]" (Arbitrary "Operator")+ , tok "(true|false|null)\8" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tok "[0-9](\\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "'(\\\\\\\\|\\\\'|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Attribute")+ ]+
+ src/Text/Highlighter/Lexers/SourcesList.hs view
@@ -0,0 +1,48 @@+module Text.Highlighter.Lexers.SourcesList (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Debian Sourcelist"+ , lAliases = ["sourceslist", "sources.list"]+ , lExtensions = ["sources.list"]+ , lMimetypes = []+ , lStart = root'+ , lFlags = [multiline]+ }++distribution' :: TokenMatcher+distribution' =+ [ tokNext "#.*?$" (Arbitrary "Comment") Pop+ , tok "\\$\\(ARCH\\)" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "[^\\s$[]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "\\[" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other") (GoTo escapedDistribution')+ , tok "\\$" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "\\s+" (Arbitrary "Text") (GoTo components')+ ]++root' :: TokenMatcher+root' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "#.*?$" (Arbitrary "Comment")+ , tokNext "^(deb(?:-src)?)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo distribution')+ ]++escapedDistribution' :: TokenMatcher+escapedDistribution' =+ [ tokNext "\\]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other") Pop+ , tok "\\$\\(ARCH\\)" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "[^\\]$]+" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ , tok "\\$" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Other")+ ]++components' :: TokenMatcher+components' =+ [ tokNext "#.*?$" (Arbitrary "Comment") (PopNum 2)+ , tokNext "$" (Arbitrary "Text") (PopNum 2)+ , tok "\\s+" (Arbitrary "Text")+ , tok "\\S+" (Arbitrary "Keyword" :. Arbitrary "Pseudo")+ ]+
+ src/Text/Highlighter/Lexers/Sql.hs view
@@ -0,0 +1,38 @@+module Text.Highlighter.Lexers.Sql (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "SQL"+ , lAliases = ["sql"]+ , lExtensions = [".sql"]+ , lMimetypes = ["text/x-sql"]+ , lStart = root'+ , lFlags = [caseless]+ }++multilineComments' :: TokenMatcher+multilineComments' =+ [ tokNext "/\\*" (Arbitrary "Comment" :. Arbitrary "Multiline") (GoTo multilineComments')+ , tokNext "\\*/" (Arbitrary "Comment" :. Arbitrary "Multiline") Pop+ , tok "[^/\\*]+" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "[/*]" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]++root' :: TokenMatcher+root' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "--.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single")+ , tokNext "/\\*" (Arbitrary "Comment" :. Arbitrary "Multiline") (GoTo multilineComments')+ , tok "(ABORT|ABS|ABSOLUTE|ACCESS|ADA|ADD|ADMIN|AFTER|AGGREGATE|ALIAS|ALL|ALLOCATE|ALTER|ANALYSE|ANALYZE|AND|ANY|ARE|AS|ASC|ASENSITIVE|ASSERTION|ASSIGNMENT|ASYMMETRIC|AT|ATOMIC|AUTHORIZATION|AVG|BACKWARD|BEFORE|BEGIN|BETWEEN|BITVAR|BIT_LENGTH|BOTH|BREADTH|BY|C|CACHE|CALL|CALLED|CARDINALITY|CASCADE|CASCADED|CASE|CAST|CATALOG|CATALOG_NAME|CHAIN|CHARACTERISTICS|CHARACTER_LENGTH|CHARACTER_SET_CATALOG|CHARACTER_SET_NAME|CHARACTER_SET_SCHEMA|CHAR_LENGTH|CHECK|CHECKED|CHECKPOINT|CLASS|CLASS_ORIGIN|CLOB|CLOSE|CLUSTER|COALSECE|COBOL|COLLATE|COLLATION|COLLATION_CATALOG|COLLATION_NAME|COLLATION_SCHEMA|COLUMN|COLUMN_NAME|COMMAND_FUNCTION|COMMAND_FUNCTION_CODE|COMMENT|COMMIT|COMMITTED|COMPLETION|CONDITION_NUMBER|CONNECT|CONNECTION|CONNECTION_NAME|CONSTRAINT|CONSTRAINTS|CONSTRAINT_CATALOG|CONSTRAINT_NAME|CONSTRAINT_SCHEMA|CONSTRUCTOR|CONTAINS|CONTINUE|CONVERSION|CONVERT|COPY|CORRESPONTING|COUNT|CREATE|CREATEDB|CREATEUSER|CROSS|CUBE|CURRENT|CURRENT_DATE|CURRENT_PATH|CURRENT_ROLE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|CURSOR_NAME|CYCLE|DATA|DATABASE|DATETIME_INTERVAL_CODE|DATETIME_INTERVAL_PRECISION|DAY|DEALLOCATE|DECLARE|DEFAULT|DEFAULTS|DEFERRABLE|DEFERRED|DEFINED|DEFINER|DELETE|DELIMITER|DELIMITERS|DEREF|DESC|DESCRIBE|DESCRIPTOR|DESTROY|DESTRUCTOR|DETERMINISTIC|DIAGNOSTICS|DICTIONARY|DISCONNECT|DISPATCH|DISTINCT|DO|DOMAIN|DROP|DYNAMIC|DYNAMIC_FUNCTION|DYNAMIC_FUNCTION_CODE|EACH|ELSE|ENCODING|ENCRYPTED|END|END-EXEC|EQUALS|ESCAPE|EVERY|EXCEPT|ESCEPTION|EXCLUDING|EXCLUSIVE|EXEC|EXECUTE|EXISTING|EXISTS|EXPLAIN|EXTERNAL|EXTRACT|FALSE|FETCH|FINAL|FIRST|FOR|FORCE|FOREIGN|FORTRAN|FORWARD|FOUND|FREE|FREEZE|FROM|FULL|FUNCTION|G|GENERAL|GENERATED|GET|GLOBAL|GO|GOTO|GRANT|GRANTED|GROUP|GROUPING|HANDLER|HAVING|HIERARCHY|HOLD|HOST|IDENTITY|IGNORE|ILIKE|IMMEDIATE|IMMUTABLE|IMPLEMENTATION|IMPLICIT|IN|INCLUDING|INCREMENT|INDEX|INDITCATOR|INFIX|INHERITS|INITIALIZE|INITIALLY|INNER|INOUT|INPUT|INSENSITIVE|INSERT|INSTANTIABLE|INSTEAD|INTERSECT|INTO|INVOKER|IS|ISNULL|ISOLATION|ITERATE|JOIN|KEY|KEY_MEMBER|KEY_TYPE|LANCOMPILER|LANGUAGE|LARGE|LAST|LATERAL|LEADING|LEFT|LENGTH|LESS|LEVEL|LIKE|LIMIT|LISTEN|LOAD|LOCAL|LOCALTIME|LOCALTIMESTAMP|LOCATION|LOCATOR|LOCK|LOWER|MAP|MATCH|MAX|MAXVALUE|MESSAGE_LENGTH|MESSAGE_OCTET_LENGTH|MESSAGE_TEXT|METHOD|MIN|MINUTE|MINVALUE|MOD|MODE|MODIFIES|MODIFY|MONTH|MORE|MOVE|MUMPS|NAMES|NATIONAL|NATURAL|NCHAR|NCLOB|NEW|NEXT|NO|NOCREATEDB|NOCREATEUSER|NONE|NOT|NOTHING|NOTIFY|NOTNULL|NULL|NULLABLE|NULLIF|OBJECT|OCTET_LENGTH|OF|OFF|OFFSET|OIDS|OLD|ON|ONLY|OPEN|OPERATION|OPERATOR|OPTION|OPTIONS|OR|ORDER|ORDINALITY|OUT|OUTER|OUTPUT|OVERLAPS|OVERLAY|OVERRIDING|OWNER|PAD|PARAMETER|PARAMETERS|PARAMETER_MODE|PARAMATER_NAME|PARAMATER_ORDINAL_POSITION|PARAMETER_SPECIFIC_CATALOG|PARAMETER_SPECIFIC_NAME|PARAMATER_SPECIFIC_SCHEMA|PARTIAL|PASCAL|PENDANT|PLACING|PLI|POSITION|POSTFIX|PRECISION|PREFIX|PREORDER|PREPARE|PRESERVE|PRIMARY|PRIOR|PRIVILEGES|PROCEDURAL|PROCEDURE|PUBLIC|READ|READS|RECHECK|RECURSIVE|REF|REFERENCES|REFERENCING|REINDEX|RELATIVE|RENAME|REPEATABLE|REPLACE|RESET|RESTART|RESTRICT|RESULT|RETURN|RETURNED_LENGTH|RETURNED_OCTET_LENGTH|RETURNED_SQLSTATE|RETURNS|REVOKE|RIGHT|ROLE|ROLLBACK|ROLLUP|ROUTINE|ROUTINE_CATALOG|ROUTINE_NAME|ROUTINE_SCHEMA|ROW|ROWS|ROW_COUNT|RULE|SAVE_POINT|SCALE|SCHEMA|SCHEMA_NAME|SCOPE|SCROLL|SEARCH|SECOND|SECURITY|SELECT|SELF|SENSITIVE|SERIALIZABLE|SERVER_NAME|SESSION|SESSION_USER|SET|SETOF|SETS|SHARE|SHOW|SIMILAR|SIMPLE|SIZE|SOME|SOURCE|SPACE|SPECIFIC|SPECIFICTYPE|SPECIFIC_NAME|SQL|SQLCODE|SQLERROR|SQLEXCEPTION|SQLSTATE|SQLWARNINIG|STABLE|START|STATE|STATEMENT|STATIC|STATISTICS|STDIN|STDOUT|STORAGE|STRICT|STRUCTURE|STYPE|SUBCLASS_ORIGIN|SUBLIST|SUBSTRING|SUM|SYMMETRIC|SYSID|SYSTEM|SYSTEM_USER|TABLE|TABLE_NAME| TEMP|TEMPLATE|TEMPORARY|TERMINATE|THAN|THEN|TIMESTAMP|TIMEZONE_HOUR|TIMEZONE_MINUTE|TO|TOAST|TRAILING|TRANSATION|TRANSACTIONS_COMMITTED|TRANSACTIONS_ROLLED_BACK|TRANSATION_ACTIVE|TRANSFORM|TRANSFORMS|TRANSLATE|TRANSLATION|TREAT|TRIGGER|TRIGGER_CATALOG|TRIGGER_NAME|TRIGGER_SCHEMA|TRIM|TRUE|TRUNCATE|TRUSTED|TYPE|UNCOMMITTED|UNDER|UNENCRYPTED|UNION|UNIQUE|UNKNOWN|UNLISTEN|UNNAMED|UNNEST|UNTIL|UPDATE|UPPER|USAGE|USER|USER_DEFINED_TYPE_CATALOG|USER_DEFINED_TYPE_NAME|USER_DEFINED_TYPE_SCHEMA|USING|VACUUM|VALID|VALIDATOR|VALUES|VARIABLE|VERBOSE|VERSION|VIEW|VOLATILE|WHEN|WHENEVER|WHERE|WITH|WITHOUT|WORK|WRITE|YEAR|ZONE)\\b" (Arbitrary "Keyword")+ , tok "(ARRAY|BIGINT|BINARY|BIT|BLOB|BOOLEAN|CHAR|CHARACTER|DATE|DEC|DECIMAL|FLOAT|INT|INTEGER|INTERVAL|NUMBER|NUMERIC|REAL|SERIAL|SMALLINT|VARCHAR|VARYING|INT8|SERIAL8|TEXT)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "[+*/<>=\126!@#%^&|`?^-]" (Arbitrary "Operator")+ , tok "[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "'(''|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "\"(\"\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Symbol")+ , tok "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name")+ , tok "[;:()\\[\\],\\.]" (Arbitrary "Punctuation")+ ]+
+ src/Text/Highlighter/Lexers/SquidConf.hs view
@@ -0,0 +1,36 @@+module Text.Highlighter.Lexers.SquidConf (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "SquidConf"+ , lAliases = ["squidconf", "squid.conf", "squid"]+ , lExtensions = ["squid.conf"]+ , lMimetypes = ["text/x-squidconf"]+ , lStart = root'+ , lFlags = [caseless]+ }++comment' :: TokenMatcher+comment' =+ [ tokNext "\\s*TAG:.*" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape") Pop+ , tokNext ".*" (Arbitrary "Comment") Pop+ ]++root' :: TokenMatcher+root' =+ [ tok "\\s+" (Arbitrary "Text")+ , tokNext "#" (Arbitrary "Comment") (GoTo comment')+ , tok "\\b(?:acl|always_direct|announce_host|announce_period|announce_port|announce_to|anonymize_headers|append_domain|as_whois_server|auth_param_basic|authenticate_children|authenticate_program|authenticate_ttl|broken_posts|buffered_logs|cache_access_log|cache_announce|cache_dir|cache_dns_program|cache_effective_group|cache_effective_user|cache_host|cache_host_acl|cache_host_domain|cache_log|cache_mem|cache_mem_high|cache_mem_low|cache_mgr|cachemgr_passwd|cache_peer|cache_peer_access|cahce_replacement_policy|cache_stoplist|cache_stoplist_pattern|cache_store_log|cache_swap|cache_swap_high|cache_swap_log|cache_swap_low|client_db|client_lifetime|client_netmask|connect_timeout|coredump_dir|dead_peer_timeout|debug_options|delay_access|delay_class|delay_initial_bucket_level|delay_parameters|delay_pools|deny_info|dns_children|dns_defnames|dns_nameservers|dns_testnames|emulate_httpd_log|err_html_text|fake_user_agent|firewall_ip|forwarded_for|forward_snmpd_port|fqdncache_size|ftpget_options|ftpget_program|ftp_list_width|ftp_passive|ftp_user|half_closed_clients|header_access|header_replace|hierarchy_stoplist|high_response_time_warning|high_page_fault_warning|htcp_port|http_access|http_anonymizer|httpd_accel|httpd_accel_host|httpd_accel_port|httpd_accel_uses_host_header|httpd_accel_with_proxy|http_port|http_reply_access|icp_access|icp_hit_stale|icp_port|icp_query_timeout|ident_lookup|ident_lookup_access|ident_timeout|incoming_http_average|incoming_icp_average|inside_firewall|ipcache_high|ipcache_low|ipcache_size|local_domain|local_ip|logfile_rotate|log_fqdn|log_icp_queries|log_mime_hdrs|maximum_object_size|maximum_single_addr_tries|mcast_groups|mcast_icp_query_timeout|mcast_miss_addr|mcast_miss_encode_key|mcast_miss_port|memory_pools|memory_pools_limit|memory_replacement_policy|mime_table|min_http_poll_cnt|min_icp_poll_cnt|minimum_direct_hops|minimum_object_size|minimum_retry_timeout|miss_access|negative_dns_ttl|negative_ttl|neighbor_timeout|neighbor_type_domain|netdb_high|netdb_low|netdb_ping_period|netdb_ping_rate|never_direct|no_cache|passthrough_proxy|pconn_timeout|pid_filename|pinger_program|positive_dns_ttl|prefer_direct|proxy_auth|proxy_auth_realm|query_icmp|quick_abort|quick_abort|quick_abort_max|quick_abort_min|quick_abort_pct|range_offset_limit|read_timeout|redirect_children|redirect_program|redirect_rewrites_host_header|reference_age|reference_age|refresh_pattern|reload_into_ims|request_body_max_size|request_size|request_timeout|shutdown_lifetime|single_parent_bypass|siteselect_timeout|snmp_access|snmp_incoming_address|snmp_port|source_ping|ssl_proxy|store_avg_object_size|store_objects_per_bucket|strip_query_terms|swap_level1_dirs|swap_level2_dirs|tcp_incoming_address|tcp_outgoing_address|tcp_recv_bufsize|test_reachability|udp_hit_obj|udp_hit_obj_size|udp_incoming_address|udp_outgoing_address|unique_hostname|unlinkd_program|uri_whitespace|useragent_log|visible_hostname|wais_relay|wais_relay_host|wais_relay_port)\\b" (Arbitrary "Keyword")+ , tok "\\b(?:proxy-only|weight|ttl|no-query|default|round-robin|multicast-responder|on|off|all|deny|allow|via|parent|no-digest|heap|lru|realm|children|credentialsttl|none|disable|offline_toggle|diskd|q1|q2)\\b" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "\\b(?:shutdown|info|parameter|server_list|client_list|squid\\.conf)\\b" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "stats/\\b(?:shutdown|info|parameter|server_list|client_list|squid\\.conf)\\b" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "log/\\b(?:shutdown|info|parameter|server_list|client_list|squid\\.conf)\\b=" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\b(?:url_regex|urlpath_regex|referer_regex|port|proto|req_mime_type|rep_mime_type|method|browser|user|src|dst|time|dstdomain|ident|snmp_community)\\b" (Arbitrary "Keyword")+ , tok "\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b(?:/(?:\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b)|\\d+)?" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "\\b\\d+\\b" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "\\S+" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Tcl.hs view
@@ -0,0 +1,147 @@+module Text.Highlighter.Lexers.Tcl (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Tcl"+ , lAliases = ["tcl"]+ , lExtensions = [".tcl"]+ , lMimetypes = ["text/x-tcl", "text/x-script.tcl", "application/x-tcl"]+ , lStart = root'+ , lFlags = [multiline]+ }++comment' :: TokenMatcher+comment' =+ [ tokNext ".*[^\\\\]\\n" (Arbitrary "Comment") Pop+ , tok ".*\\\\\\n" (Arbitrary "Comment")+ ]++stringSquare' :: TokenMatcher+stringSquare' =+ [ tokNext "\\[" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") (GoTo stringSquare')+ , tok "(?s)(\\\\\\\\|\\\\[0-7]+|\\\\.|\\\\\\n|[^\\]\\\\])" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tokNext "\\]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") Pop+ ]++string' :: TokenMatcher+string' =+ [ tokNext "\\[" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") (GoTo stringSquare')+ , tok "(?s)(\\\\\\\\|\\\\[0-7]+|\\\\.|[^\"\\\\])" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") Pop+ ]++commandInParen' :: TokenMatcher+commandInParen' =+ [ tokNext "\\b(after|apply|array|break|catch|continue|elseif|else|error|eval|expr|for|foreach|global|if|namespace|proc|rename|return|set|switch|then|trace|unset|update|uplevel|upvar|variable|vwait|while)\\b" (Arbitrary "Keyword") (GoTo paramsInParen')+ , tokNext "\\b(append|bgerror|binary|cd|chan|clock|close|concat|dde|dict|encoding|eof|exec|exit|fblocked|fconfigure|fcopy|file|fileevent|flush|format|gets|glob|history|http|incr|info|interp|join|lappend|lassign|lindex|linsert|list|llength|load|loadTk|lrange|lrepeat|lreplace|lreverse|lsearch|lset|lsort|mathfunc|mathop|memory|msgcat|open|package|pid|pkg::create|pkg_mkIndex|platform|platform::shell|puts|pwd|re_syntax|read|refchan|regexp|registry|regsub|scan|seek|socket|source|split|string|subst|tell|time|tm|unknown|unload)\\b" (Arbitrary "Name" :. Arbitrary "Builtin") (GoTo paramsInParen')+ , tokNext "([\\w\\.\\-]+)" (Arbitrary "Name" :. Arbitrary "Variable") (GoTo paramsInParen')+ , tokNext "#" (Arbitrary "Comment") (GoTo comment')+ ]++data' :: TokenMatcher+data' =+ [ tok "\\s+" (Arbitrary "Text")+ , tok "0x[a-fA-F0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "0[0-7]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "\\d+\\.\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "\\d+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\\$([\\w\\.\\-\\:]+)" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "([\\w\\.\\-\\:]+)" (Arbitrary "Text")+ ]++brace' :: TokenMatcher+brace' =+ [ tokNext "}" (Arbitrary "Keyword") Pop+ , anyOf commandInBrace'+ , anyOf basic'+ , anyOf data'+ ]++paren' :: TokenMatcher+paren' =+ [ tokNext "\\)" (Arbitrary "Keyword") Pop+ , anyOf commandInParen'+ , anyOf basic'+ , anyOf data'+ ]++paramsInParen' :: TokenMatcher+paramsInParen' =+ [ tokNext "\\)" (Arbitrary "Keyword") (DoAll [Pop, Pop])+ , anyOf params'+ ]++bracket' :: TokenMatcher+bracket' =+ [ tokNext "\\]" (Arbitrary "Keyword") Pop+ , anyOf commandInBracket'+ , anyOf basic'+ , anyOf data'+ ]++command' :: TokenMatcher+command' =+ [ tokNext "\\b(after|apply|array|break|catch|continue|elseif|else|error|eval|expr|for|foreach|global|if|namespace|proc|rename|return|set|switch|then|trace|unset|update|uplevel|upvar|variable|vwait|while)\\b" (Arbitrary "Keyword") (GoTo params')+ , tokNext "\\b(append|bgerror|binary|cd|chan|clock|close|concat|dde|dict|encoding|eof|exec|exit|fblocked|fconfigure|fcopy|file|fileevent|flush|format|gets|glob|history|http|incr|info|interp|join|lappend|lassign|lindex|linsert|list|llength|load|loadTk|lrange|lrepeat|lreplace|lreverse|lsearch|lset|lsort|mathfunc|mathop|memory|msgcat|open|package|pid|pkg::create|pkg_mkIndex|platform|platform::shell|puts|pwd|re_syntax|read|refchan|regexp|registry|regsub|scan|seek|socket|source|split|string|subst|tell|time|tm|unknown|unload)\\b" (Arbitrary "Name" :. Arbitrary "Builtin") (GoTo params')+ , tokNext "([\\w\\.\\-]+)" (Arbitrary "Name" :. Arbitrary "Variable") (GoTo params')+ , tokNext "#" (Arbitrary "Comment") (GoTo comment')+ ]++params' :: TokenMatcher+params' =+ [ tokNext ";" (Arbitrary "Keyword") Pop+ , tokNext "\\n" (Arbitrary "Text") Pop+ , tok "(else|elseif|then)" (Arbitrary "Keyword")+ , anyOf basic'+ , anyOf data'+ ]++basic' :: TokenMatcher+basic' =+ [ tokNext "\\(" (Arbitrary "Keyword") (GoTo paren')+ , tokNext "\\[" (Arbitrary "Keyword") (GoTo bracket')+ , tokNext "\\{" (Arbitrary "Keyword") (GoTo brace')+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double") (GoTo string')+ , tok "(eq|ne|in|ni)\\b" (Arbitrary "Operator" :. Arbitrary "Word")+ , tok "!=|==|<<|>>|<=|>=|&&|\\|\\||\\*\\*|[-+\126!*/%<>&^|?:]" (Arbitrary "Operator")+ ]++paramsInBracket' :: TokenMatcher+paramsInBracket' =+ [ tokNext "\\]" (Arbitrary "Keyword") (DoAll [Pop, Pop])+ , anyOf params'+ ]++commandInBracket' :: TokenMatcher+commandInBracket' =+ [ tokNext "\\b(after|apply|array|break|catch|continue|elseif|else|error|eval|expr|for|foreach|global|if|namespace|proc|rename|return|set|switch|then|trace|unset|update|uplevel|upvar|variable|vwait|while)\\b" (Arbitrary "Keyword") (GoTo paramsInBracket')+ , tokNext "\\b(append|bgerror|binary|cd|chan|clock|close|concat|dde|dict|encoding|eof|exec|exit|fblocked|fconfigure|fcopy|file|fileevent|flush|format|gets|glob|history|http|incr|info|interp|join|lappend|lassign|lindex|linsert|list|llength|load|loadTk|lrange|lrepeat|lreplace|lreverse|lsearch|lset|lsort|mathfunc|mathop|memory|msgcat|open|package|pid|pkg::create|pkg_mkIndex|platform|platform::shell|puts|pwd|re_syntax|read|refchan|regexp|registry|regsub|scan|seek|socket|source|split|string|subst|tell|time|tm|unknown|unload)\\b" (Arbitrary "Name" :. Arbitrary "Builtin") (GoTo paramsInBracket')+ , tokNext "([\\w\\.\\-]+)" (Arbitrary "Name" :. Arbitrary "Variable") (GoTo paramsInBracket')+ , tokNext "#" (Arbitrary "Comment") (GoTo comment')+ ]++paramsInBrace' :: TokenMatcher+paramsInBrace' =+ [ tokNext "}" (Arbitrary "Keyword") (DoAll [Pop, Pop])+ , anyOf params'+ ]++root' :: TokenMatcher+root' =+ [ anyOf command'+ , anyOf basic'+ , anyOf data'+ , tok "}" (Arbitrary "Keyword")+ ]++commandInBrace' :: TokenMatcher+commandInBrace' =+ [ tokNext "\\b(after|apply|array|break|catch|continue|elseif|else|error|eval|expr|for|foreach|global|if|namespace|proc|rename|return|set|switch|then|trace|unset|update|uplevel|upvar|variable|vwait|while)\\b" (Arbitrary "Keyword") (GoTo paramsInBrace')+ , tokNext "\\b(append|bgerror|binary|cd|chan|clock|close|concat|dde|dict|encoding|eof|exec|exit|fblocked|fconfigure|fcopy|file|fileevent|flush|format|gets|glob|history|http|incr|info|interp|join|lappend|lassign|lindex|linsert|list|llength|load|loadTk|lrange|lrepeat|lreplace|lreverse|lsearch|lset|lsort|mathfunc|mathop|memory|msgcat|open|package|pid|pkg::create|pkg_mkIndex|platform|platform::shell|puts|pwd|re_syntax|read|refchan|regexp|registry|regsub|scan|seek|socket|source|split|string|subst|tell|time|tm|unknown|unload)\\b" (Arbitrary "Name" :. Arbitrary "Builtin") (GoTo paramsInBrace')+ , tokNext "([\\w\\.\\-]+)" (Arbitrary "Name" :. Arbitrary "Variable") (GoTo paramsInBrace')+ , tokNext "#" (Arbitrary "Comment") (GoTo comment')+ ]+
+ src/Text/Highlighter/Lexers/Tcsh.hs view
@@ -0,0 +1,67 @@+module Text.Highlighter.Lexers.Tcsh (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Tcsh"+ , lAliases = ["tcsh", "csh"]+ , lExtensions = [".tcsh", ".csh"]+ , lMimetypes = ["application/x-csh"]+ , lStart = root'+ , lFlags = [multiline]+ }++curly' :: TokenMatcher+curly' =+ [ tokNext "}" (Arbitrary "Keyword") Pop+ , tok ":-" (Arbitrary "Keyword")+ , tok "[a-zA-Z0-9_]+" (Arbitrary "Name" :. Arbitrary "Variable")+ , tok "[^}:\"\\'`$]+" (Arbitrary "Punctuation")+ , tok ":" (Arbitrary "Punctuation")+ , anyOf root'+ ]++backticks' :: TokenMatcher+backticks' =+ [ tokNext "`" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Backtick") Pop+ , anyOf root'+ ]++root' :: TokenMatcher+root' =+ [ anyOf basic'+ , tokNext "\\$\\(" (Arbitrary "Keyword") (GoTo paren')+ , tokNext "\\${#?" (Arbitrary "Keyword") (GoTo curly')+ , tokNext "`" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Backtick") (GoTo backticks')+ , anyOf data'+ ]++basic' :: TokenMatcher+basic' =+ [ tok "\\b(if|endif|else|while|then|foreach|case|default|continue|goto|breaksw|end|switch|endsw)\\s*\\b" (Arbitrary "Keyword")+ , tok "\\b(alias|alloc|bg|bindkey|break|builtins|bye|caller|cd|chdir|complete|dirs|echo|echotc|eval|exec|exit|fg|filetest|getxvers|glob|getspath|hashstat|history|hup|inlib|jobs|kill|limit|log|login|logout|ls-F|migrate|newgrp|nice|nohup|notify|onintr|popd|printenv|pushd|rehash|repeat|rootnode|popd|pushd|set|shift|sched|setenv|setpath|settc|setty|setxvers|shift|source|stop|suspend|source|suspend|telltc|time|umask|unalias|uncomplete|unhash|universe|unlimit|unset|unsetenv|ver|wait|warp|watchlog|where|which)\\s*\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "#.*\\n" (Arbitrary "Comment")+ , tok "\\\\[\\w\\W]" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "(\\b\\w+)(\\s*)(=)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Variable"), (Arbitrary "Text"), (Arbitrary "Operator")])+ , tok "[\\[\\]{}()=]+" (Arbitrary "Operator")+ , tok "<<\\s*(\\'?)\\\\?(\\w+)[\\w\\W]+?\\2" (Arbitrary "Literal" :. Arbitrary "String")+ ]++paren' :: TokenMatcher+paren' =+ [ tokNext "\\)" (Arbitrary "Keyword") Pop+ , anyOf root'+ ]++data' :: TokenMatcher+data' =+ [ tok "(?s)\"(\\\\\\\\|\\\\[0-7]+|\\\\.|[^\"\\\\])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "(?s)'(\\\\\\\\|\\\\[0-7]+|\\\\.|[^'\\\\])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "\\s+" (Arbitrary "Text")+ , tok "[^=\\s\\n\\[\\]{}()$\"\\'`\\\\]+" (Arbitrary "Text")+ , tok "\\d+(?= |\\Z)" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "\\$#?(\\w+|.)" (Arbitrary "Name" :. Arbitrary "Variable")+ ]+
+ src/Text/Highlighter/Lexers/Tex.hs view
@@ -0,0 +1,64 @@+module Text.Highlighter.Lexers.Tex (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "TeX"+ , lAliases = ["tex", "latex"]+ , lExtensions = [".tex", ".aux", ".toc"]+ , lMimetypes = ["text/x-tex", "text/x-latex"]+ , lStart = root'+ , lFlags = [multiline]+ }++displaymath' :: TokenMatcher+displaymath' =+ [ tokNext "\\\\\\]" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tokNext "\\$\\$" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\$" (Arbitrary "Name" :. Arbitrary "Builtin")+ , anyOf math'+ ]++general' :: TokenMatcher+general' =+ [ tok "%.*?\\n" (Arbitrary "Comment")+ , tok "[{}]" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "[&_^]" (Arbitrary "Name" :. Arbitrary "Builtin")+ ]++command' :: TokenMatcher+command' =+ [ tok "\\[.*?\\]" (Arbitrary "Name" :. Arbitrary "Attribute")+ , tok "\\*" (Arbitrary "Keyword")+ , tokNext "" (Arbitrary "Text") Pop+ ]++inlinemath' :: TokenMatcher+inlinemath' =+ [ tokNext "\\\\\\)" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tokNext "\\$" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , anyOf math'+ ]++root' :: TokenMatcher+root' =+ [ tokNext "\\\\\\[" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Backtick") (GoTo displaymath')+ , tokNext "\\\\\\(" (Arbitrary "Literal" :. Arbitrary "String") (GoTo inlinemath')+ , tokNext "\\$\\$" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Backtick") (GoTo displaymath')+ , tokNext "\\$" (Arbitrary "Literal" :. Arbitrary "String") (GoTo inlinemath')+ , tokNext "\\\\([a-zA-Z]+|.)" (Arbitrary "Keyword") (GoTo command')+ , anyOf general'+ , tok "[^\\\\$%&_^{}]+" (Arbitrary "Text")+ ]++math' :: TokenMatcher+math' =+ [ tok "\\\\([a-zA-Z]+|.)" (Arbitrary "Name" :. Arbitrary "Variable")+ , anyOf general'+ , tok "[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "[-=!+*/()\\[\\]]" (Arbitrary "Operator")+ , tok "[^=!+*/()\\[\\]\\\\$%&_^{}0-9-]+" (Arbitrary "Name" :. Arbitrary "Builtin")+ ]+
+ src/Text/Highlighter/Lexers/Vala.hs view
@@ -0,0 +1,89 @@+module Text.Highlighter.Lexers.Vala (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Vala"+ , lAliases = ["vala", "vapi"]+ , lExtensions = [".vala", ".vapi"]+ , lMimetypes = ["text/x-vala"]+ , lStart = root'+ , lFlags = [multiline]+ }++statements' :: TokenMatcher+statements' =+ [ tokNext "L?\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo string')+ , tok "L?'(\\\\.|\\\\[0-7]{1,3}|\\\\x[a-fA-F0-9]{1,2}|[^\\\\\\'\\n])'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+)[eE][+-]?\\d+[lL]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+[fF])[fF]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "0x[0-9a-fA-F]+[Ll]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "0[0-7]+[Ll]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "\\d+[Ll]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "[\126!%^&*+=|?:<>/-]" (Arbitrary "Operator")+ , tok "(\\[)(Compact|Immutable|(?:Boolean|Simple)Type)(\\])" (ByGroups [(Arbitrary "Punctuation"), (Arbitrary "Name" :. Arbitrary "Decorator"), (Arbitrary "Punctuation")])+ , tok "(\\[)(CCode|(?:Integer|Floating)Type)" (ByGroups [(Arbitrary "Punctuation"), (Arbitrary "Name" :. Arbitrary "Decorator")])+ , tok "[()\\[\\],.]" (Arbitrary "Punctuation")+ , tok "(as|base|break|case|catch|construct|continue|default|delete|do|else|enum|finally|for|foreach|get|if|in|is|lock|new|out|params|return|set|sizeof|switch|this|throw|try|typeof|while|yield)\\b" (Arbitrary "Keyword")+ , tok "(abstract|const|delegate|dynamic|ensures|extern|inline|internal|override|owned|private|protected|public|ref|requires|signal|static|throws|unowned|var|virtual|volatile|weak|yields)\\b" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , tokNext "(namespace|using)(\\s+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text")]) (GoTo namespace')+ , tokNext "(class|errordomain|interface|struct)(\\s+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Declaration"), (Arbitrary "Text")]) (GoTo class')+ , tok "(\\.)([a-zA-Z_][a-zA-Z0-9_]*)" (ByGroups [(Arbitrary "Operator"), (Arbitrary "Name" :. Arbitrary "Attribute")])+ , tok "(void|bool|char|double|float|int|int8|int16|int32|int64|long|short|size_t|ssize_t|string|time_t|uchar|uint|uint8|uint16|uint32|uint64|ulong|unichar|ushort)\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "(true|false|null)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name")+ ]++whitespace' :: TokenMatcher+whitespace' =+ [ tokNext "^\\s*#if\\s+0" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo if0')+ , tok "\\n" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ , tok "\\\\\\n" (Arbitrary "Text")+ , tok "//(\\n|(.|\\n)*?[^\\\\]\\n)" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/(\\\\\\n)?[*](.|\\n)*?[*](\\\\\\n)?/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ ]++statement' :: TokenMatcher+statement' =+ [ anyOf whitespace'+ , anyOf statements'+ , tok "[{}]" (Arbitrary "Punctuation")+ , tokNext ";" (Arbitrary "Punctuation") Pop+ ]++if0' :: TokenMatcher+if0' =+ [ tokNext "^\\s*#if.*?(?<!\\\\)\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Push+ , tokNext "^\\s*#el(?:se|if).*\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ , tokNext "^\\s*#endif.*?(?<!\\\\)\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ , tok ".*?\\n" (Arbitrary "Comment")+ ]++namespace' :: TokenMatcher+namespace' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_.]*" (Arbitrary "Name" :. Arbitrary "Namespace") Pop+ ]++root' :: TokenMatcher+root' =+ [ anyOf whitespace'+ , tokNext "" (Arbitrary "Text") (GoTo statement')+ ]++class' :: TokenMatcher+class' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Class") Pop+ ]++string' :: TokenMatcher+string' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\([\\\\abfnrtv\"\\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "[^\\\\\"\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\" (Arbitrary "Literal" :. Arbitrary "String")+ ]+
+ src/Text/Highlighter/Lexers/VbNet.hs view
@@ -0,0 +1,79 @@+module Text.Highlighter.Lexers.VbNet (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "VB.net"+ , lAliases = ["vb.net", "vbnet"]+ , lExtensions = [".vb", ".bas"]+ , lMimetypes = ["text/x-vbnet", "text/x-vba"]+ , lStart = root'+ , lFlags = [caseless, multiline]+ }++dim' :: TokenMatcher+dim' =+ [ tokNext "[a-z_][a-z0-9_]*" (Arbitrary "Name" :. Arbitrary "Variable") Pop+ , tokNext "" (Arbitrary "Text") Pop+ ]++end' :: TokenMatcher+end' =+ [ tok "\\s+" (Arbitrary "Text")+ , tokNext "(Function|Sub|Property|Class|Structure|Enum|Module|Namespace)\\b" (Arbitrary "Keyword") Pop+ , tokNext "" (Arbitrary "Text") Pop+ ]++string' :: TokenMatcher+string' =+ [ tok "\"\"" (Arbitrary "Literal" :. Arbitrary "String")+ , tokNext "\"C?" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "[^\"]+" (Arbitrary "Literal" :. Arbitrary "String")+ ]++namespace' :: TokenMatcher+namespace' =+ [ tokNext "[a-z_][a-z0-9_.]*" (Arbitrary "Name" :. Arbitrary "Namespace") Pop+ ]++funcname' :: TokenMatcher+funcname' =+ [ tokNext "[a-z_][a-z0-9_]*" (Arbitrary "Name" :. Arbitrary "Function") Pop+ ]++classname' :: TokenMatcher+classname' =+ [ tokNext "[a-z_][a-z0-9_]*" (Arbitrary "Name" :. Arbitrary "Class") Pop+ ]++root' :: TokenMatcher+root' =+ [ tok "^\\s*<.*?>" (Arbitrary "Name" :. Arbitrary "Attribute")+ , tok "\\s+" (Arbitrary "Text")+ , tok "\\n" (Arbitrary "Text")+ , tok "rem\\b.*?\\n" (Arbitrary "Comment")+ , tok "'.*?\\n" (Arbitrary "Comment")+ , tok "#If\\s.*?\\sThen|#ElseIf\\s.*?\\sThen|#End\\s+If|#Const|#ExternalSource.*?\\n|#End\\s+ExternalSource|#Region.*?\\n|#End\\s+Region|#ExternalChecksum" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "[\\(\\){}!#,.:]" (Arbitrary "Punctuation")+ , tok "Option\\s+(Strict|Explicit|Compare)\\s+(On|Off|Binary|Text)" (Arbitrary "Keyword" :. Arbitrary "Declaration")+ , tok "(?<!\\.)(AddHandler|Alias|ByRef|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDec|CDbl|CInt|CLng|CObj|Continue|CSByte|CShort|CSng|CStr|CType|CUInt|CULng|CUShort|Declare|Default|Delegate|DirectCast|Do|Each|Else|ElseIf|EndIf|Erase|Error|Event|Exit|False|Finally|For|Friend|Get|Global|GoSub|GoTo|Handles|If|Implements|Inherits|Interface|Let|Lib|Loop|Me|MustInherit|MustOverride|MyBase|MyClass|Narrowing|New|Next|Not|Nothing|NotInheritable|NotOverridable|Of|On|Operator|Option|Optional|Overloads|Overridable|Overrides|ParamArray|Partial|Private|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|Select|Set|Shadows|Shared|Single|Static|Step|Stop|SyncLock|Then|Throw|To|True|Try|TryCast|Wend|Using|When|While|Widening|With|WithEvents|WriteOnly)\\b" (Arbitrary "Keyword")+ , tokNext "(?<!\\.)End\\b" (Arbitrary "Keyword") (GoTo end')+ , tokNext "(?<!\\.)(Dim|Const)\\b" (Arbitrary "Keyword") (GoTo dim')+ , tokNext "(?<!\\.)(Function|Sub|Property)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo funcname')+ , tokNext "(?<!\\.)(Class|Structure|Enum)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo classname')+ , tokNext "(?<!\\.)(Module|Namespace|Imports)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo namespace')+ , tok "(?<!\\.)(Boolean|Byte|Char|Date|Decimal|Double|Integer|Long|Object|SByte|Short|Single|String|Variant|UInteger|ULong|UShort)\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "(?<!\\.)(AddressOf|And|AndAlso|As|GetType|In|Is|IsNot|Like|Mod|Or|OrElse|TypeOf|Xor)\\b" (Arbitrary "Operator" :. Arbitrary "Word")+ , tok "&=|[*]=|/=|\\\\=|\\^=|\\+=|-=|<<=|>>=|<<|>>|:=|<=|>=|<>|[-&*/\\\\^+=<>]" (Arbitrary "Operator")+ , tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo string')+ , tok "[a-zA-Z_][a-zA-Z0-9_]*[%&@!#$]?" (Arbitrary "Name")+ , tok "#.*?#" (Arbitrary "Literal" :. Arbitrary "Date")+ , tok "(\\d+\\.\\d*|\\d*\\.\\d+)([fF][+-]?[0-9]+)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "\\d+([SILDFR]|US|UI|UL)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "&H[0-9a-f]+([SILDFR]|US|UI|UL)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "&O[0-7]+([SILDFR]|US|UI|UL)?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "_\\n" (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Velocity.hs view
@@ -0,0 +1,63 @@+module Text.Highlighter.Lexers.Velocity (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "Velocity"+ , lAliases = ["velocity"]+ , lExtensions = [".vm", ".fhtml"]+ , lMimetypes = []+ , lStart = root'+ , lFlags = [multiline, dotall]+ }++variable' :: TokenMatcher+variable' =+ [ tok "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Variable")+ , tokNext "\\(" (Arbitrary "Punctuation") (GoTo funcparams')+ , tokNext "(\\.)([a-zA-Z_][a-zA-Z0-9_]*)" (ByGroups [(Arbitrary "Punctuation"), (Arbitrary "Name" :. Arbitrary "Variable")]) Push+ , tokNext "\\}" (Arbitrary "Punctuation") Pop+ , tokNext "" (Arbitrary "Other") Pop+ ]++rangeoperator' :: TokenMatcher+rangeoperator' =+ [ tok "\\.\\." (Arbitrary "Operator")+ , anyOf funcparams'+ , tokNext "\\]" (Arbitrary "Operator") Pop+ ]++root' :: TokenMatcher+root' =+ [ tok "[^{#$]+" (Arbitrary "Other")+ , tok "(#)(\\*.*?\\*)(#)" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Comment"), (Arbitrary "Comment" :. Arbitrary "Preproc")])+ , tok "(##)(.*?$)" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Comment")])+ , tokNext "(#\\{?)([a-zA-Z_][a-zA-Z0-9_]*)(\\}?)(\\s?\\()" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Punctuation")]) (GoTo directiveparams')+ , tok "(#\\{?)([a-zA-Z_][a-zA-Z0-9_]*)(\\}|\\b)" (ByGroups [(Arbitrary "Comment" :. Arbitrary "Preproc"), (Arbitrary "Name" :. Arbitrary "Function"), (Arbitrary "Comment" :. Arbitrary "Preproc")])+ , tokNext "\\$\\{?" (Arbitrary "Punctuation") (GoTo variable')+ ]++funcparams' :: TokenMatcher+funcparams' =+ [ tokNext "\\$\\{?" (Arbitrary "Punctuation") (GoTo variable')+ , tok "\\s+" (Arbitrary "Text")+ , tok "," (Arbitrary "Punctuation")+ , tok "\"(\\\\\\\\|\\\\\"|[^\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "'(\\\\\\\\|\\\\'|[^'])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "0[xX][0-9a-fA-F]+[Ll]?" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "\\b[0-9]+\\b" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "(true|false|null)\\b" (Arbitrary "Keyword" :. Arbitrary "Constant")+ , tokNext "\\(" (Arbitrary "Punctuation") Push+ , tokNext "\\)" (Arbitrary "Punctuation") Pop+ ]++directiveparams' :: TokenMatcher+directiveparams' =+ [ tok "(&&|\\|\\||==?|!=?|[-<>+*%&\\|\\^/])|\\b(eq|ne|gt|lt|ge|le|not|in)\\b" (Arbitrary "Operator")+ , tokNext "\\[" (Arbitrary "Operator") (GoTo rangeoperator')+ , tok "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b" (Arbitrary "Name" :. Arbitrary "Function")+ , anyOf funcparams'+ ]+
+ src/Text/Highlighter/Lexers/Verilog.hs view
@@ -0,0 +1,78 @@+module Text.Highlighter.Lexers.Verilog (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "verilog"+ , lAliases = ["v"]+ , lExtensions = [".v", ".sv"]+ , lMimetypes = ["text/x-verilog"]+ , lStart = root'+ , lFlags = [multiline]+ }++classname' :: TokenMatcher+classname' =+ [ tokNext "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Class") Pop+ ]++macro' :: TokenMatcher+macro' =+ [ tok "[^/\\n]+" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "/[*](.|\\n)*?[*]/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tokNext "//.*?\\n" (Arbitrary "Comment" :. Arbitrary "Single") Pop+ , tok "/" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "(?<=\\\\)\\n" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tokNext "\\n" (Arbitrary "Comment" :. Arbitrary "Preproc") Pop+ ]++root' :: TokenMatcher+root' =+ [ tokNext "^\\s*`define" (Arbitrary "Comment" :. Arbitrary "Preproc") (GoTo macro')+ , tok "\\n" (Arbitrary "Text")+ , tok "\\s+" (Arbitrary "Text")+ , tok "\\\\\\n" (Arbitrary "Text")+ , tok "/(\\\\\\n)?/(\\n|(.|\\n)*?[^\\\\]\\n)" (Arbitrary "Comment" :. Arbitrary "Single")+ , tok "/(\\\\\\n)?[*](.|\\n)*?[*](\\\\\\n)?/" (Arbitrary "Comment" :. Arbitrary "Multiline")+ , tok "[{}#@]" (Arbitrary "Punctuation")+ , tokNext "L?\"" (Arbitrary "Literal" :. Arbitrary "String") (GoTo string')+ , tok "L?'(\\\\.|\\\\[0-7]{1,3}|\\\\x[a-fA-F0-9]{1,2}|[^\\\\\\'\\n])'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Char")+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+)[eE][+-]?\\d+[lL]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "(\\d+\\.\\d*|\\.\\d+|\\d+[fF])[fF]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Float")+ , tok "([0-9]+)|(\\'h)[0-9a-fA-F]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "([0-9]+)|(\\'b)[0-1]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "([0-9]+)|(\\'d)[0-9]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "([0-9]+)|(\\'o)[0-7]+" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Oct")+ , tok "\\'[01xz]" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "\\d+[Ll]?" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Integer")+ , tok "\\*/" (Arbitrary "Error")+ , tok "[\126!%^&*+=|?:<>/-]" (Arbitrary "Operator")+ , tok "[()\\[\\],.;\\']" (Arbitrary "Punctuation")+ , tok "`[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name" :. Arbitrary "Constant")+ , tok "^\\s*(package)(\\s+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text")])+ , tokNext "^\\s*(import)(\\s+)" (ByGroups [(Arbitrary "Keyword" :. Arbitrary "Namespace"), (Arbitrary "Text")]) (GoTo import')+ , tok "(always|always_comb|always_ff|always_latch|and|assign|automatic|begin|break|buf|bufif0|bufif1|case|casex|casez|cmos|const|continue|deassign|default|defparam|disable|do|edge|else|end|endcase|endfunction|endgenerate|endmodule|endpackage|endprimitive|endspecify|endtable|endtask|enum|event|final|for|force|forever|fork|function|generate|genvar|highz0|highz1|if|initial|inout|input|integer|join|large|localparam|macromodule|medium|module|nand|negedge|nmos|nor|not|notif0|notif1|or|output|packed|parameter|pmos|posedge|primitive|pull0|pull1|pulldown|pullup|rcmos|ref|release|repeat|return|rnmos|rpmos|rtran|rtranif0|rtranif1|scalared|signed|small|specify|specparam|strength|string|strong0|strong1|struct|table|task|tran|tranif0|tranif1|type|typedef|unsigned|var|vectored|void|wait|weak0|weak1|while|xnor|xor)\\b" (Arbitrary "Keyword")+ , tok "(`accelerate|`autoexpand_vectornets|`celldefine|`default_nettype|`else|`elsif|`endcelldefine|`endif|`endprotect|`endprotected|`expand_vectornets|`ifdef|`ifndef|`include|`noaccelerate|`noexpand_vectornets|`noremove_gatenames|`noremove_netnames|`nounconnected_drive|`protect|`protected|`remove_gatenames|`remove_netnames|`resetall|`timescale|`unconnected_drive|`undef)\\b" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "(\\$bits|\\$bitstoreal|\\$bitstoshortreal|\\$countdrivers|\\$display|\\$fclose|\\$fdisplay|\\$finish|\\$floor|\\$fmonitor|\\$fopen|\\$fstrobe|\\$fwrite|\\$getpattern|\\$history|\\$incsave|\\$input|\\$itor|\\$key|\\$list|\\$log|\\$monitor|\\$monitoroff|\\$monitoron|\\$nokey|\\$nolog|\\$printtimescale|\\$random|\\$readmemb|\\$readmemh|\\$realtime|\\$realtobits|\\$reset|\\$reset_count|\\$reset_value|\\$restart|\\$rtoi|\\$save|\\$scale|\\$scope|\\$shortrealtobits|\\$showscopes|\\$showvariables|\\$showvars|\\$sreadmemb|\\$sreadmemh|\\$stime|\\$stop|\\$strobe|\\$time|\\$timeformat|\\$write)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tokNext "(class)(\\s+)" (ByGroups [(Arbitrary "Keyword"), (Arbitrary "Text")]) (GoTo classname')+ , tok "(byte|shortint|int|longint|interger|time|bit|logic|reg|supply0|supply1|tri|triand|trior|tri0|tri1|trireg|uwire|wire|wand|worshortreal|real|realtime)\\b" (Arbitrary "Keyword" :. Arbitrary "Type")+ , tok "[a-zA-Z_][a-zA-Z0-9_]*:(?!:)" (Arbitrary "Name" :. Arbitrary "Label")+ , tok "[a-zA-Z_][a-zA-Z0-9_]*" (Arbitrary "Name")+ ]++string' :: TokenMatcher+string' =+ [ tokNext "\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tok "\\\\([\\\\abfnrtv\"\\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Escape")+ , tok "[^\\\\\"\\n]+" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\\\n" (Arbitrary "Literal" :. Arbitrary "String")+ , tok "\\\\" (Arbitrary "Literal" :. Arbitrary "String")+ ]++import' :: TokenMatcher+import' =+ [ tokNext "[a-zA-Z0-9_:]+\\*?" (Arbitrary "Name" :. Arbitrary "Namespace") Pop+ ]+
+ src/Text/Highlighter/Lexers/Vim.hs view
@@ -0,0 +1,33 @@+module Text.Highlighter.Lexers.Vim (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "VimL"+ , lAliases = ["vim"]+ , lExtensions = [".vim", ".vimrc"]+ , lMimetypes = ["text/x-vim"]+ , lStart = root'+ , lFlags = [multiline]+ }++root' :: TokenMatcher+root' =+ [ tok "^\\s*\".*" (Arbitrary "Comment")+ , tok "(?<=\\s)\"[^\\-:.%#=*].*" (Arbitrary "Comment")+ , tok "[ \\t]+" (Arbitrary "Text")+ , tok "/(\\\\\\\\|\\\\/|[^\\n/])*/" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Regex")+ , tok "\"(\\\\\\\\|\\\\\"|[^\\n\"])*\"" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Double")+ , tok "'(\\\\\\\\|\\\\'|[^\\n'])*'" (Arbitrary "Literal" :. Arbitrary "String" :. Arbitrary "Single")+ , tok "-?\\d+" (Arbitrary "Literal" :. Arbitrary "Number")+ , tok "#[0-9a-f]{6}" (Arbitrary "Literal" :. Arbitrary "Number" :. Arbitrary "Hex")+ , tok "^:" (Arbitrary "Punctuation")+ , tok "[()<>+=!|,\126-]" (Arbitrary "Punctuation")+ , tok "\\b(let|if|else|endif|elseif|fun|function|endfunction)\\b" (Arbitrary "Keyword")+ , tok "\\b(NONE|bold|italic|underline|dark|light)\\b" (Arbitrary "Name" :. Arbitrary "Builtin")+ , tok "\\b\\w+\\b" (Arbitrary "Name" :. Arbitrary "Other")+ , tok "." (Arbitrary "Text")+ ]+
+ src/Text/Highlighter/Lexers/Xml.hs view
@@ -0,0 +1,49 @@+module Text.Highlighter.Lexers.Xml (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "XML"+ , lAliases = ["xml"]+ , lExtensions = [".xml", ".xsl", ".rss", ".xslt", ".xsd", ".wsdl"]+ , lMimetypes = ["text/xml", "application/xml", "image/svg+xml", "application/rss+xml", "application/atom+xml", "application/xsl+xml", "application/xslt+xml"]+ , 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\\[.*?\\]\\]\\>" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tokNext "<!--" (Arbitrary "Comment") (GoTo comment')+ , tok "<\\?.*?\\?>" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "<![^>]*>" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tokNext "<\\s*[a-zA-Z0-9:._-]+" (Arbitrary "Name" :. Arbitrary "Tag") (GoTo tag')+ , tok "<\\s*/\\s*[a-zA-Z0-9:._-]+\\s*>" (Arbitrary "Name" :. Arbitrary "Tag")+ ]++attr' :: TokenMatcher+attr' =+ [ tok "\\s+" (Arbitrary "Text")+ , tokNext "\".*?\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tokNext "'.*?'" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tokNext "[^\\s>]+" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]+
+ src/Text/Highlighter/Lexers/Xslt.hs view
@@ -0,0 +1,49 @@+module Text.Highlighter.Lexers.Xslt (lexer) where++import Text.Regex.PCRE.Light+import Text.Highlighter.Types++lexer :: Lexer+lexer = Lexer+ { lName = "XSLT"+ , lAliases = ["xslt"]+ , lExtensions = [".xsl", ".xslt"]+ , lMimetypes = ["text/xml", "application/xml", "image/svg+xml", "application/rss+xml", "application/atom+xml", "application/xsl+xml", "application/xslt+xml"]+ , 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\\[.*?\\]\\]\\>" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tokNext "<!--" (Arbitrary "Comment") (GoTo comment')+ , tok "<\\?.*?\\?>" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tok "<![^>]*>" (Arbitrary "Comment" :. Arbitrary "Preproc")+ , tokNext "<\\s*[a-zA-Z0-9:._-]+" (Arbitrary "Name" :. Arbitrary "Tag") (GoTo tag')+ , tok "<\\s*/\\s*[a-zA-Z0-9:._-]+\\s*>" (Arbitrary "Name" :. Arbitrary "Tag")+ ]++attr' :: TokenMatcher+attr' =+ [ tok "\\s+" (Arbitrary "Text")+ , tokNext "\".*?\"" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tokNext "'.*?'" (Arbitrary "Literal" :. Arbitrary "String") Pop+ , tokNext "[^\\s>]+" (Arbitrary "Literal" :. Arbitrary "String") Pop+ ]+
+ src/Text/Highlighter/Types.hs view
@@ -0,0 +1,215 @@+{-# LANGUAGE BangPatterns, TypeSynonymInstances, FlexibleInstances #-}+module Text.Highlighter.Types where++import Data.Char (toLower)+import Text.Regex.PCRE.Light+import qualified Data.ByteString as BS++data Match+ = Match+ { mRegexp :: String+ , mType :: TokenType+ , mNextState :: NextState+ }+ | AnyOf TokenMatcher+ deriving Show++type TokenMatcher = [Match]++data Lexer =+ Lexer+ { lName :: String+ , lAliases :: [String]+ , lExtensions :: [String]+ , lMimetypes :: [String]+ , lStart :: TokenMatcher+ , lFlags :: [PCREOption]+ }++data NextState+ = Continue+ | GoTo TokenMatcher+ | CapturesTo Callback+ | Pop+ | PopNum Int+ | Push+ | DoAll [NextState]+ | Combined [TokenMatcher]+ deriving Show++type Callback = [String] -> TokenMatcher++data Token =+ Token+ { tType :: TokenType+ , tText :: BS.ByteString+ }+ deriving Show++data TokenType+ = Text+ | Whitespace+ | Error+ | Other+ | Keyword+ | Name+ | Literal+ | String+ | Number+ | Operator+ | Punctuation+ | Comment+ | Generic+ | TokenType :. TokenType++ -- Subtypes+ -- Keyword+ | Declaration+ | Reserved+ | Type++ -- Keyword, Name.Builtin+ | Pseudo++ -- Keyword, Name+ | Namespace++ -- Nane, Name.Variable+ | Class++ -- Keyword, Name+ | Constant++ -- Name+ | Attribute+ | Builtin+ | Decorator+ | Entity+ | Exception+ | Function+ | Identifier+ | Label+ | Property+ | Tag+ | Variable+ | Global+ | Instance+ | Anonymous++ -- Literal+ | Date+ | Scalar+ | Plain++ -- String+ | Atom+ | Backtick+ | Char+ | Doc+ | Double+ | Escape+ | Heredoc+ | Interp+ | Interpol+ | Regex+ | Regexp+ | Symbol++ -- String, Comment+ | Single++ -- Number+ | Bin+ | Binary+ | Decimal+ | Float+ | Hex+ | Hexadecimal+ | Int+ | Integer+ | Long+ | Oct+ | Octal++ -- Operator+ | Word++ -- Comment+ | Multiline+ | Preproc+ | Special++ -- Generic+ | Deleted+ | Emph+ | Heading+ | Inserted+ | Output+ | Prompt+ | Strong+ | Subheading+ | Traceback+ | ByGroups [TokenType]++ | Indicator++ -- Some arbitrary token name+ | Arbitrary String++ -- Use another lexer to yield some tokens+ | Using Lexer+ deriving Show++instance Show Lexer where+ show l = "(Lexer " ++ lName l ++ ")"++instance Show Callback where+ show _ = "Callback"++tok :: String -> TokenType -> Match+tok s tt = Match s tt Continue++tokNext :: String -> TokenType -> NextState -> Match+tokNext s = Match s++anyOf :: TokenMatcher -> Match+anyOf ms = AnyOf ms++shortName :: TokenType -> String+shortName ((_ :. a) :. b) =+ shortName a ++ shortName b+shortName (Name :. Constant) = "no"+shortName (Name :. Entity) = "ni"+shortName (Name :. Property) = "py"+shortName (Arbitrary "Name" :. Arbitrary "Constant") = "no"+shortName (Arbitrary "Name" :. Arbitrary "Entity") = "ni"+shortName (Arbitrary "Name" :. Arbitrary "Property") = "py"+shortName (Literal :. b) =+ shortName b+shortName (Arbitrary "Literal" :. b) =+ shortName b+shortName (a :. Other) =+ shortName a ++ "x"+shortName (a :. Error) =+ shortName a ++ "r"+shortName (a :. Single) =+ shortName a ++ "1"+shortName (a :. Double) =+ shortName a ++ "2"+shortName (a :. Arbitrary "Other") =+ shortName a ++ "x"+shortName (a :. Arbitrary "Error") =+ shortName a ++ "r"+shortName (a :. Arbitrary "Single") =+ shortName a ++ "1"+shortName (a :. Arbitrary "Double") =+ shortName a ++ "2"+shortName (a :. b) =+ shortName a ++ shortName b+shortName Error = "err"+shortName (Arbitrary "Error") = "err"+shortName Number = "m"+shortName (Arbitrary "Number") = "m"+shortName (Arbitrary t) =+ [toLower (head t)]+shortName x = [toLower (head (show x))]