summaryrefslogtreecommitdiff
path: root/syntax-highlight/parsers.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-10-19 09:08:08 -0400
committerDavid Thompson <dthompson2@worcester.edu>2015-10-19 09:08:08 -0400
commited72c28cd11726dd2e3f547aa29157b69fe5eaff (patch)
tree2f5e35894bc5c6e9b986888bf8489771a4383f5b /syntax-highlight/parsers.scm
parent698b991e8173dd3dc595f5b750131eb472d6b735 (diff)
parsers: Remove parse-never.
This was a thinko. It's redundant with 'parse-fail'. * syntax-highlight/parsers.scm (parse-never): Delete. (parse-fail): Rewrite docstring. (parse-any, parse-each): Use 'parse-fail'. * syntax-highlight/scheme.scm (parse-specials, parse-openers, parse-closers): Likewise.
Diffstat (limited to 'syntax-highlight/parsers.scm')
-rw-r--r--syntax-highlight/parsers.scm9
1 files changed, 2 insertions, 7 deletions
diff --git a/syntax-highlight/parsers.scm b/syntax-highlight/parsers.scm
index 712f8d5..31c17ae 100644
--- a/syntax-highlight/parsers.scm
+++ b/syntax-highlight/parsers.scm
@@ -32,7 +32,6 @@
parse-bind
parse-return
parse-lift
- parse-never
parse-map
parse-filter
parse-either
@@ -52,7 +51,7 @@
;;;
(define (parse-fail stream)
- "Return a failed parse value with STREAM as the remainder."
+ "Always fail to parse STREAM without consuming any of it."
(values #f stream))
(define (parse-bind proc parser)
@@ -72,10 +71,6 @@
(lambda args
(parse-return (apply proc args))))
-(define (parse-never stream)
- "Always fail to parse STREAM."
- (parse-fail stream))
-
(define (parse-map proc parser)
"Return a new parser that applies PROC to result of PARSER."
(parse-bind (parse-lift proc) parser))
@@ -114,7 +109,7 @@ FIRST and SECOND if both are successful."
"Create a parser that returns the result of the first successful
parser in PARSERS. This parser fails if no parser in PARSERS
succeeds."
- (fold-right parse-either parse-never parsers))
+ (fold-right parse-either parse-fail parsers))
(define (parse-each . parsers)
"Create a parser that builds a list of the results of PARSERS. This