If any of the parsers fail, this parser throws an error. This
can be handy for showing more specific error messages to
users. For example, if you have a parser that parses these two
statements:
import"foo"; greet"name"
And the user gives this input:
import;
You don't want the parser to fail with a generic message,
such as 'all parsers have failed'. You want a more
specific error, such as 'expected string after
import keyword'.
If any of the parsers fail, this parser throws an error. This can be handy for showing more specific error messages to users. For example, if you have a parser that parses these two statements:
And the user gives this input:
You don't want the parser to fail with a generic message, such as 'all parsers have failed'. You want a more specific error, such as 'expected string after
importkeyword'.You could accomplish that with
throwErrorUnless: