Documentation
¶
Overview ¶
Package transform defines text rules and tree transforms. Import text rules run before parsing, and export text rules run after rendering. Tree transforms run after parsing or before rendering.
A text rule maps one line to one line, so every rule preserves the line count and diagnostic lines always refer to the input file. Rules that would remove a line blank it instead.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyTree ¶
func ApplyTree(transforms []TreeTransform, cfg *tree.Config)
ApplyTree runs tree transforms left-to-right.
Types ¶
type TextRule ¶
TextRule transforms one line of raw configuration text before parsing or after rendering.
func DropLines ¶
DropLines blanks matching lines to preserve source line numbers; export rules retain the blank lines.
func PerLineSub ¶
PerLineSub applies a regex substitution to each line independently.
type TreeTransform ¶
TreeTransform mutates a parsed tree.