From f205d4c5dbd0ccb26cb9020e3ef8ae86d1336403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Sat, 12 Nov 2022 01:08:18 -0300 Subject: Introduce critical failure type --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 24b5ea6..6705ffd 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,24 @@ The goal is to have a good enough parser generator for use in my other personal # The type of parsers Parsers are lambdas that receive some *input* and return either a *parsing* or a *failure*. + +A *parsing* denotes a successful execution of the parser on the given input. + +Failures can be either *normal-failure* or *critical-failure*. + +The distinction of failure types allows to discern between an input that needs to be +parsed with another parser, and a syntax error. + +## Interaction with parser control flow + +### Choice (either) + +- parsing -> exit +- normal-failure -> continue +- critical-failure -> exit + +### Sequence (comp) + +- parsing -> continue +- normal-failure -> exit +- critical-failure -> exit -- cgit v1.2.3