asciigoat's INI parser https://asciigoat.org/ini
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Alejandro Mery 986b6d1c6d Merge pull request 'parser: Unquoted(), AcceptQuotedString() and SplitCommaArray' (#9) 1 year ago
basic basic: cleanup using parser.NewError() 1 year ago
parser parser: introduce SplitCommaArray to splits comma separated strings 1 year ago
tools tools: add stringer support 1 year ago
.editorconfig Initial commit 1 year ago
.gitignore Initial commit 1 year ago
LICENCE.txt Initial commit 1 year ago
Makefile build-sys: import build system from darvaza.org/core 1 year ago
README.md basic: introduce basic one-shot INI-style decoder 1 year ago
docs.go Initial commit 1 year ago
go.mod parser: use GetPositionalLength() on TextParser.Discard() and TextParser.Emit() 1 year ago
go.sum parser: use GetPositionalLength() on TextParser.Discard() and TextParser.Emit() 1 year ago

README.md

asciigoat's INI parser

Go Reference Go Report Card

asciigoat.org/ini is a simple Go library that very loosly parses INI-style documents allowing the implementation of stricter parsers of similar form.

asciigoat is MIT licensed.

Parser

parser.Parser uses asciigoat's lexer to process an INI-style document emiting tokens and errors via callbacks.

Basic Parser

basic.Decode() provies a one-shot decoder that returns a structured document for you to post-process.

To allow for correct handling of repetition of section and field names downstream, it uses arrays instead of maps, and makes almost no judgment about what section or field names are acceptable.

Other Implementations

Other implementations exist, and they are mature and feature-rich, but they are highly opinionated about what's a valid file. Built around maps they don't allow repeating names and constraint what characters can be used.

These are great when you can adapt, or already agree, to their conditions but that's not always the case when you are parsing configuration files from other applications and that's what asciigoat.org/ini attempts to solve.

See also