aboutsummaryrefslogtreecommitdiff
path: root/src/__OLD_parcom/flunk.cr
blob: 00a0bd692a35f408ed0c00465a873061fc4b37cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
require "./parser.cr"

module Parcom
  # `Flunk` is a `Parser` that always fails.
  class Flunk(T, V) < Parser(T, V)
    # Always raises `ParserFail`
    def parse(tokens) : Result(T, V)
      raise ParserFail.new("Flunk: parsing failed")
    end
  end
end