From c109ed6c6f9767f797cca55fe156164a25b4432e Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sun, 23 Apr 2000 03:04:02 +0000 Subject: [PATCH] Implement PREDICATED-PARSER. --- v7/src/imail/parser.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/v7/src/imail/parser.scm b/v7/src/imail/parser.scm index d7d314c9d..55d47f8a0 100644 --- a/v7/src/imail/parser.scm +++ b/v7/src/imail/parser.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: parser.scm,v 1.2 2000/04/22 05:04:31 cph Exp $ +;;; $Id: parser.scm,v 1.3 2000/04/23 03:04:02 cph Exp $ ;;; ;;; Copyright (c) 2000 Massachusetts Institute of Technology ;;; @@ -80,6 +80,13 @@ (let ((pv (parser string start end))) (and pv (list (car pv) (cons keyword (transformer pv))))))) + +(define (predicated-parser parser predicate) + (lambda (string start end) + (let ((pv (parser string start end))) + (and pv + (predicate pv) + pv)))) (define (list-parser match-element match-delimiter keyword) (lambda (string start end) -- 2.25.1