
6 Mar
2016
6 Mar
'16
4:30 a.m.
On Sun, Mar 06, 2016 at 09:26:17AM +0000, Mike Houghton wrote:
Hi, I’m using Parsec to parse structured text and have some problems with mandatory and optional text entries and the order in which they occur. For example:
module{
name = some string source = …
dest = ….. bundle = … bundle_dest = … zip_name = ….
}
Hello Mike, I would personally keep it simple. Parse the (item, value) list and after that check if it is well formed (i.e. contains 'name' and 'source' values). If not, call `parserFail` with an appropriate message.