From: Chris Hanson Date: Sat, 11 Oct 2003 03:48:16 +0000 (+0000) Subject: Implement CALL-ON-PARSER-BUFFER-TAIL. X-Git-Tag: 20090517-FFI~1773 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=42125126d40c9d65e9c43d29874c040b9017edff;p=mit-scheme.git Implement CALL-ON-PARSER-BUFFER-TAIL. --- diff --git a/v7/src/runtime/parser-buffer.scm b/v7/src/runtime/parser-buffer.scm index 7ad4f6672..4e07678fd 100644 --- a/v7/src/runtime/parser-buffer.scm +++ b/v7/src/runtime/parser-buffer.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: parser-buffer.scm,v 1.8 2003/02/28 04:40:12 cph Exp $ +$Id: parser-buffer.scm,v 1.9 2003/10/11 03:48:16 cph Exp $ Copyright 2001,2002,2003 Massachusetts Institute of Technology @@ -90,10 +90,13 @@ USA. (set-parser-buffer-line! buffer (parser-buffer-pointer-line p))) (define (get-parser-buffer-tail buffer p) + (call-on-parser-buffer-tail buffer p substring)) + +(define (call-on-parser-buffer-tail buffer p procedure) ;; P must be a buffer pointer previously returned by - ;; GET-PARSER-BUFFER-POINTER. Return the string of characters + ;; GET-PARSER-BUFFER-POINTER. Call PROCEDURE on the substring ;; between P and the current buffer pointer. - (substring (parser-buffer-string buffer) + (procedure (parser-buffer-string buffer) (pointer->index p buffer) (parser-buffer-index buffer))) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index cd7f6ba3d..d1f567d2f 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.463 2003/10/01 18:07:41 cph Exp $ +$Id: runtime.pkg,v 14.464 2003/10/11 03:48:07 cph Exp $ Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology @@ -4485,6 +4485,7 @@ USA. (files "parser-buffer") (parent (runtime)) (export () + call-on-parser-buffer-tail discard-parser-buffer-head! get-parser-buffer-pointer get-parser-buffer-tail