Replies: 4 comments 2 replies
-
Hi @chrisspre - unfortunately, no, this is unexplored territory for Superpower. It would be extremely interesting to hear what you come up with, if you decide to dig in further. My guess is that some of Superpower (as it stands today) could be reused, but there would need to be fairly deep changes to support recovery/reporting of multiple errors. Best regards, |
Beta Was this translation helpful? Give feedback.
-
We're trialling GitHub Discussions in some of the Datalust repositories. This thread seems like a good candidate for a discussion, I hope you don't mind me converting it, @chrisspre - let me know if you had any trouble locating it/navigating across here to the new location 👍 |
Beta Was this translation helpful? Give feedback.
-
Odd - I received your reply by email, but can't see it here. I can see discussions even when not logged in, however. In case it helps, the URL is #124 |
Beta Was this translation helpful? Give feedback.
-
I had no response yet. Was only looking around, trying to find GitHub Discussions only to realized this is where we are :-) For what it's worth, here is an early thought: Something like interface IResult<T>
{
T Value { get; }
IImmutableList<Error> Errors { get; }
} I believe there is still a monadic join operator on this that allows to compute values from previous ones, that also always accumulates errors. Other combinators should be possible to derive from this. |
Beta Was this translation helpful? Give feedback.
-
Is there any tips or guidance how to achieve some sort of error recovery for a superpower parser so that the parser can report multiple, independent syntactical errors?
Without extra caution a superpower parser stops parsing when it discovers an error which means an end-user needs to fix one error at a time.
Typically programming languages show multiple errors in one file. My understanding is that these parsers detect one error per "statement" (a common production rule) and skip over some text until the next statement is discover.
How can this be achieved in superpower?
Beta Was this translation helpful? Give feedback.
All reactions