{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE OverloadedStrings #-}
module Skylighting.Extensions.GHCi (syntax) where
import Skylighting.Core
import Skylighting.Modding
import qualified Data.Text.Encoding as Text
syntax :: Syntax
syntax =
Syntax
{ sName = "ghci"
, sFilename = ""
, sShortname = "ghci"
, sContexts = contextMap ghciContext
, sAuthor = "Typeclass Consulting, LLC"
, sVersion = "1"
, sLicense = "MIT"
, sExtensions = []
, sStartingContext = "ghci"
}
ghciContext :: Context
ghciContext =
Context
{ cName = "ghci"
, cSyntax = "ghci"
, cRules = [promptRule]
, cAttribute = NormalTok
, cLineEmptyContext = []
, cLineEndContext = []
, cLineBeginContext = []
, cFallthrough = False
, cFallthroughContext = []
, cDynamic = False
}
promptRule :: Rule
promptRule =
Rule
{ rMatcher = RegExpr promptRE
, rAttribute = AnnotationTok
, rIncludeAttribute = True
, rDynamic = False
, rCaseSensitive = True
, rChildren = []
, rLookahead = False
, rFirstNonspace = False
, rColumn = Just 0
, rContextSwitch = []
}
promptRE :: RE
promptRE =
RE
{ reString = Text.encodeUtf8 "[λ ]>"
, reCaseSensitive = True
}