Closed expipiplus1 closed 1 year ago
Actually, perhaps this is:
terminal t `slipper` s == disambiguate (minimumBy fst) ((0,) <$> terminal t <|> (1,) <$> pure s)
i.e. a slipper is just the same as a pure value over which the terminal is prioritized
Terminology from the Marpa parser.
I have no idea what Marpa's implementation is, but perhaps this would work for this package:
In the same way that names are specified for tokens at specific positions, we could maintain a set of slippers, which are utilized when no terminals match in order to rescue the parse.