alecthomas/participle: A parser library for Go
github.com/alecthomas/participletype INI struct {
Properties []*Property `@@*`
Sections []*Section `@@*`
}
type Section struct {
Identifier string `"[" @Ident "]"`
Properties []*Property `@@*`
}
type Property struct {
Key string `@Ident "="`
Value *Value `@@`
}
type Value struct {
String *string ` @String`
Float *float64 `| @Float`
Int *int `| @Int`
}