aboutsummaryrefslogtreecommitdiff
path: root/src/__OLD_parcom/eof.cr
diff options
context:
space:
mode:
authorMatthew Hall <hallmatthew314@gmail.com>2023-03-19 23:02:29 +1300
committerMatthew Hall <hallmatthew314@gmail.com>2023-03-19 23:02:29 +1300
commit9734fa2d530b9496b70a388a117ea57fe5730772 (patch)
tree78a42db1e64e5148edfa96cb2a451a17ef362485 /src/__OLD_parcom/eof.cr
parent2ef8841e9c7a48eea0f66cfe09d8fe996f43c2b2 (diff)
Remove old files
Diffstat (limited to 'src/__OLD_parcom/eof.cr')
-rw-r--r--src/__OLD_parcom/eof.cr23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/__OLD_parcom/eof.cr b/src/__OLD_parcom/eof.cr
deleted file mode 100644
index 650da56..0000000
--- a/src/__OLD_parcom/eof.cr
+++ /dev/null
@@ -1,23 +0,0 @@
-require "./parser.cr"
-
-module Parcom
- # `EOF` is a `Parser` succeeds if the input stream is empty.
- #
- # This parser retuns `nil` when successful because there is no
- # other meaningful value to return.
- #
- # This parser is also one of the few cases where it is ideal to not
- # modify or take from the input stream, as it should be empty anyway.
- class EOF(T) < Parser(T, Nil)
- # Succeeds is the input stream is empty and returns `nil`.
- # Raises a `ParserFail` exception when the input is not empty.
- def parse(tokens : Tokens(T)) : Result(T, Nil)
- if tokens.empty?
- Result.new(tokens, nil)
- else
- raise ParserFail.new("Eof: input was not empty")
- end
- end
- end
-end
-