On Wednesday, 28 November 2018 10:06:18 CET Raphaël Pinson wrote:
> Your example does not correspond to
> (entry | record)*
> Rather, it corresponds to
> entry* . record*
> since entries inside records are not independent.
> Also, you're missing comment support:
> (comment | entry)* . record*
Hmm most probably I did not explain correctly: [end] is not the start
of a new group called "end", but it's the closing tag for a group.
Yes, that was quite clear.
So back to my example:
- a un-grouped entry "foo" with value "var"
which is mapped by "entry"
- a group "group1" with a "var" entry
- a un-grouped entry "foo2" with value "var2"
Ah, I did not catch that! So indeed, you need a mix of entries and records, but then you will have to make sure they don't collide in their definitions.
I've seen some horrible config formats when writing Augeas lenses, but there's still some… unexpected surprises…