Hi Francesco,
Quick response! Thanks.
I see, so would it reduce to something like?
many itemValue
and originally I was thinking the data structure that it would parse into would be
data Module = Module {— some record structure—}
but now it would be roughly like…
type Entry = (String, String)
data Module = Module [Entry]
Thanks
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) listand after that check if it is well formed (i.e. contains 'name' and'source' values). If not, call `parserFail` with an appropriatemessage._______________________________________________Beginners mailing listBeginners@haskell.orghttp://mail.haskell.org/cgi-bin/mailman/listinfo/beginners