-
-
Notifications
You must be signed in to change notification settings - Fork 205
Closed
Description
Hi all,
Just starting to use this library to parse a custom file format, quite similiar to INI files.
I am not able to get right the most simple example.
This is the file contents
==abc
zzz
And this is the parser
var lexerDefinition = lexer.MustSimple([]lexer.SimpleRule{
{Name: "Ident", Pattern: `[a-zA-Z][a-zA-Z_\d]*`},
})
var Parser = participle.MustBuild[Matadown](
participle.Lexer(lexerDefinition),
)
type Matadown struct {
Sections []*Section `@@*`
}
type Section struct {
Title string `"==" @Ident`
Content *Content `@@`
}
type Content struct {
String string `@Ident`
}
Getting this error
1:1: invalid input text "==abc\nzzz\n\n"
Any hint ?
Thanks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels