Greedy parser for holes
Good afternoon,
I'm sorry for my question, but how is the greediness of holes in a combi implemented?
Is Lookahead used for the entire pattern following the hole? If so, were there any optimizations added, such as memoization, to avoid parsing the entire following pattern in its entirety?
I wonder how the comby works in such a scenario, for example.
@rvantonder ping
@RomanSoloweow It "looks ahead" within the current nesting level (e.g., inside parens). There are no memoization / optimizations added, so it will attempt to parse at each point until it is satisfied or until epsilon. Since this happens within a nesting level, and not the entire input, in practice, for normal programs with delimiters, that are syntax-rich, it tends to perform well enough. Does that help?