-
Notifications
You must be signed in to change notification settings - Fork 2
when to flush error st
after head is parsed in a parseNonSeq
call, the st should be flushed if we are parsing a potential pattern and either there is an operator ahead (meaning that we are not actually in a potential pattern) or we are parsing a non-leaky expression (which means no error is going to be passed over to the parent container expression, if any such parent exists.)
please note that if we are not parsing a potential pattern, we won't need to flush st -- st has no errors; if it actually had, it would've meant it either got it from a child (which is not true, since the children of nonpats are parsed in non-leaky mode), or (even though I've not come up with any instance where this can actualy be the case), it recorded the error itself (which is not true either, because errors are immediately raised in nonpat mode.) there is a very important thing to beware of about parens -- their errors are not leaked even when they are parsed in pat mode