Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type SyntaxMap = Map Text Syntax
- syntaxMap :: Syntax -> SyntaxMap
- addSyntax :: Syntax -> SyntaxMap -> SyntaxMap
- modifySyntax :: Text -> (Syntax -> Syntax) -> SyntaxMap -> SyntaxMap
- modifySyntaxContexts :: (ContextMap -> ContextMap) -> Syntax -> Syntax
- type ContextMap = Map Text Context
- contextMap :: Context -> ContextMap
- addContext :: Context -> ContextMap -> ContextMap
- modifyContext :: Text -> (Context -> Context) -> ContextMap -> ContextMap
- replaceKeywordRule :: Rule -> Context -> Context
- isKeywordRule :: Rule -> Bool
Syntax maps
Modify a SyntaxMap
by looking up a particular syntax by name, applying some
function to it, and placing the resulting syntax into the map in place of the
original syntax.
Syntax fields
modifySyntaxContexts :: (ContextMap -> ContextMap) -> Syntax -> Syntax Source #
Context maps
contextMap :: Context -> ContextMap Source #
Convert a Context
into a ContextMap
that contains only that one context.
addContext :: Context -> ContextMap -> ContextMap Source #
Adds one Context
to a ContextMap
, or replaces a context of the same name if
one exists.
:: Text | The name of the context to modify |
-> (Context -> Context) | |
-> ContextMap | |
-> ContextMap |
Modify a SyntaxMap
by looking up a particular syntax by name, applying some
function to it, and placing the resulting syntax into the map in place of the
original syntax.
Rules
replaceKeywordRule :: Rule -> Context -> Context Source #
Alters a Context
by replacing any Rule
that looks like a typical keyword
rule (as determined by isKeywordRule
) with the given rule.
isKeywordRule :: Rule -> Bool Source #
Determines whether a Rule
looks like a typical rule for keywords:
rAttribute
=KeywordTok
rMatcher
is of theKeyword
variety