Documentation
¶
Overview ¶
Package formatter provides conservative, deterministic formatting for NFlow source. It preserves expression text, comments, strings, and opaque directive bodies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
Formatter formats source using the parser extensions supplied by the caller.
func New ¶
New builds a formatter from the active Flow bundles. The same bundles should be supplied by the host that exposes the formatter, so extension syntax is parsed consistently with that host.
func NewWithParserTables ¶ added in v0.44.0
func NewWithParserTables( operators *compiler.OperatorTable, primaries *compiler.PrimaryExtensionTable, requireEnabled bool, ) *Formatter
NewWithParserTables builds a formatter from the active compiler tables. Hosts that prepare a source with dynamically selected bundles should use these tables so formatting and compilation recognize the same syntax.