Documentation
¶
Overview ¶
Package yini parses YINI configuration documents.
Parsing is lenient by default. Set Options.Mode to ModeStrict to enforce strict document rules. Parse results include diagnostics even when an error is returned.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diagnostic ¶
Diagnostic describes a problem found while parsing or validating input.
type Document ¶
Document is the structured result of parsing a YINI document. Members at this level are lenient-mode orphan members.
type Member ¶
Member is a key and its parsed value. Values are strings, int64, float64, bool, nil, []any, or map[string]any.
type Options ¶
type Options struct {
Mode Mode
}
Options controls parsing. The zero value selects lenient mode.
type ParseError ¶
type ParseError struct {
Diagnostic Diagnostic
}
ParseError reports a syntax or validation failure. The corresponding Result retains the complete list of diagnostics.
func (*ParseError) Error ¶
func (e *ParseError) Error() string
type Position ¶
Position identifies a location in the original input. Lines and columns start at one.
type Result ¶
type Result struct {
Document *Document
Diagnostics []Diagnostic
}
Result contains parsed data and all diagnostics collected from the input. Document may be partial when errors were reported.
func ParseFile ¶
ParseFile reads and parses a UTF-8 YINI file. The filename does not select the parsing mode; a .strict.yini file parsed leniently gets a warning.
func ParseForTooling ¶
ParseForTooling returns diagnostics and any recoverable document content without returning a Go error for normal YINI syntax and validation issues.
func ParseReader ¶
ParseReader parses YINI content from a reader.
func ParseString ¶
ParseString parses inline YINI content. A result with diagnostics is returned even when the input is invalid.