1
0
mirror of https://github.com/janet-lang/janet synced 2025-07-24 21:02:54 +00:00
Calvin Rose d30fd27575 Address #1554 - capture first 0-width match in repeating rules and
optionals.

This fixes some undesirable interplay between lookaheads and looping
(repeating) rules where lookaheads caused the loop to immediately
terminate _and_ discard any captures. This change adds an exception if
there is a 0-width match at the first iteration of the loop, in which
case captures will be kept, although the loop will still be terminated
(any further iteration of the loop would possibly cause an infinite
 loop).

This allows optionals to work as expected when combined with lookahead.
There is also a question of whether or not optional should be
implemented as separate rule rather than as `(between 0 1 subrule)`.
2025-02-02 20:34:36 -06:00
..
2024-09-29 16:07:24 -05:00
2024-03-10 09:07:11 -05:00
2024-10-05 12:37:23 -05:00
2023-06-02 07:04:07 +09:00
2023-06-02 07:04:07 +09:00
2023-06-02 07:04:07 +09:00
2025-01-20 09:02:22 -06:00
2023-06-02 07:04:07 +09:00
2024-10-18 18:17:06 -05:00
2023-06-02 07:04:07 +09:00
2023-06-02 07:04:07 +09:00
2023-11-14 19:52:22 -06:00
2023-06-02 07:04:07 +09:00
2023-06-02 07:04:07 +09:00
2023-06-02 07:04:07 +09:00
2023-08-18 12:35:12 +07:00
2023-06-02 07:04:07 +09:00