skylighting-modding-1.0.0.0: Utilities for modifying Skylighting syntaxes

Skylighting.Modding

Description

Functions for making alterations to skylighting-core values (SyntaxMap, Syntax, Context, Rule, etc.).

Synopsis

# Syntax maps

A map of syntaxes, keyed by full name.

Convert a Syntax into a SyntaxMap that contains only that one syntax.

Adds one Syntax to a SyntaxMap, or replaces a context of the same name if one exists.

Arguments

 :: Text The name of the syntax to modify -> (Syntax -> Syntax) -> SyntaxMap -> SyntaxMap

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

Apply a function to the sContexts field of a Syntax.

# Context maps

A map of contexts, keyed by cName.

This is the type of sContexts.

Convert a Context into a ContextMap that contains only that one context.

Adds one Context to a ContextMap, or replaces a context of the same name if one exists.

Arguments

 :: 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

Alters a Context by replacing any Rule that looks like a typical keyword rule (as determined by isKeywordRule) with the given rule.

Determines whether a Rule looks like a typical rule for keywords:

1. rAttribute = KeywordTok
2. rMatcher is of the Keyword variety