From 16169311d2d39d82a799fd90c77c829767842c9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Sat, 19 Oct 2024 20:03:50 -0300 Subject: Revert some changes --- notes.md | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 notes.md (limited to 'notes.md') diff --git a/notes.md b/notes.md deleted file mode 100644 index 717613a..0000000 --- a/notes.md +++ /dev/null @@ -1,33 +0,0 @@ -# one-of in parallel -## Problem -When in a one-of block, it's harder to tell where an error came from. - -## Current solution -We have critical blocks that stop parsing when the parser inside fails. - -## Problem with current solution -We need to be dilligent in placing critical blocks. - -## Another approach -We could take a page from LR parsers and instead of driving the parsing from the parsers themselves we invert the flow, making the input drive the parsing. This results in a breadth first parsing, where the one-of block parses one step of every of it's children and decides which to keep. In the event there's only one children left, it is critical, so a failure stops parsing and reports the error. - -## How to select between BF and DF when parsing -Add an extra argument to parser type (lambda (input)) for the parsing mode. -one-of will be BF and comp will be DF. -This means that the immediate children of a one-of block will be parsed step by step. - -## Implementing BF in bind -Instead of calling the resulting function with the input, return it. -It will be the caller's responsibility to call the resulting lambda with the appropiate input. -This will give control to the one-of block to call the next parsing step. - -# lazy binding -## Problem -If defining a parser that surrounds another, the inner parser must know about what the delimiter parser is attempting to parse, specially after the inner parser. - -## Solution -Implement lazy binding. This sweeps the next parser across the input until it finds where it first parses, then takes the distance from the current input and calls the current parser with a limit on how much input to parse equal to said difference. - -# TODO -* Change the parser entry so that it takes streams as input. This will make it easier to interact with other packages. -* Change literal parser into a macro that chains unit parsers. This will take advantage of the BF feature in one-of block. -- cgit v1.2.3