<div dir="ltr">> but it produces an error I don't understand: ... Example matched by both: { }<br><br>Ah - ambiguous in the tree->string direction. Is it possible to solve this without generating artificial labels ("#comment", "#comment1") ?<br>
<br> let option = key /[A-Z_]+/<br> let value = Sep.colon . Sep.opt_space . store /[^] \t\n:]+/ . Sep.opt_space<br> let values = counter "value" . [ seq "value" . value ] +<br>
let setting = Util.del_str "[" . option . values . Util.del_str "]"<br> let entry =<br> let not_setting = Rx.space_in - ( lens_ctype setting . /.*/ )<br><br>
(* doesn't start with a space - starts with setting - doesn't match the empty string *)<br> in [ setting . ( [ label "#comment" . Sep.opt_space . store Rx.space_in . Sep.opt_space ] | Sep.opt_space ) ] |<br>
<br> (* doesn't start with a space - doesn't start with setting - doesn't match the empty string *)<br> [ label "#comment" . store not_setting . del /[ \t]*/ "" ] |<br>
<br> (* starts with a space - doesn't match the empty string *)<br> [ label "#comment2" . del /[ \t]+/ " " . store Rx.space_in . Sep.opt_space ] |<br>
<br> (* - matches the empty string *)<br> [ del // "" ]<br> let line = entry . Util.del_str "\n"<br>
let lns = line *<br><br>Sincerely,<br><br></div>