Our parser combinator framework returns all possible parsings of an input. Without the bracketed part in the applicationParser
applicationParser : Parser Context Term
applicationParser =
let
eventuallyTerm =
Parser.lazy (\_ -> parser)
in
Parser.bracketed '(' ')' eventuallyTerm
|> Parser.keepThenIgnore (many space)
|> Parser.followedBy eventuallyTerm
|> Parser.map (\( l, r ) -> TmApp l r)
could not consume any input and happily go down an infinite stack hole.
Because bracketed consumes '(' in order to succeed, this is prevented.
This is artifical and ideally should be prevented.
Our parser combinator framework returns all possible parsings of an input. Without the
bracketedpart in theapplicationParsercould not consume any input and happily go down an infinite stack hole.
Because
bracketedconsumes '(' in order to succeed, this is prevented.This is artifical and ideally should be prevented.