skylighting-core-0.14.6: syntax highlighting library

Safe Haskell | None
Language | Haskell2010

Skylighting.Parser

Synopsis

- parseSyntaxDefinition :: FilePath -> IO (Either String Syntax)
- parseSyntaxDefinitionFromText :: FilePath -> Text -> Either String Syntax
- addSyntaxDefinition :: Syntax -> SyntaxMap -> SyntaxMap
- resolveKeywords :: SyntaxMap -> Syntax -> Syntax
- missingIncludes :: [Syntax] -> [(Text, Text)]

# Documentation

parseSyntaxDefinition :: FilePath -> IO (Either String Syntax) #

Parses a file containing a Kate XML syntax definition into a `Syntax` description.

parseSyntaxDefinitionFromText :: FilePath -> Text -> Either String Syntax #

addSyntaxDefinition :: Syntax -> SyntaxMap -> SyntaxMap #

Adds a syntax definition to a syntax map, replacing any existing definition with the same name.

resolveKeywords :: SyntaxMap -> Syntax -> Syntax #

Resolve Keyword matchers that refer to lists; following up include directives in the syntax map and producing WordSets.

missingIncludes :: [Syntax] -> [(Text, Text)] #

Scan a list of `Syntax`s and make sure that `IncludeRules` never asks for a syntax not in this list. Produces a list of pairs where the first element is the including syntax name and the second element is the (missing) included syntax name. This is intended for sanity checks to avoid run-time errors.