Hi folks !
I am trying to parse the following input using Nom (simplified)
let input = "
foo
bar
other
baz
biz
";
Essentially multi-line blocks separated by empty lines (or until eof), into Vec<Vec>
The blocks can vary in size (ie different number of items/ lines with identifiers in them).
I got things somewhat working if I use tuple and hard code the number of items + many0
For two item blocks for example:
tuple((
spacey(identifier) ,
alt(( tag("\n"), eof )),
spacey(identifier),
alt(( tag("\n"), eof )),
alt(( empty_line, eof ))
))(input)
but I am looking for an actual solution for matching until an empty line correctly, and have tried a ton of of other variations (manyTill, takeUntil etc), without success.
Would really appreciate some help on this
Thanks in advance!