Implement CALL-ON-PARSER-BUFFER-TAIL.
authorChris Hanson <org/chris-hanson/cph>
Sat, 11 Oct 2003 03:48:16 +0000 (03:48 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sat, 11 Oct 2003 03:48:16 +0000 (03:48 +0000)
v7/src/runtime/parser-buffer.scm
v7/src/runtime/runtime.pkg

index 7ad4f6672e3d6fb5e6728b178051a20a1351d222..4e07678fda8770c374bed7b8993fa5e7e68c2d18 100644 (file)
@@ -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)))
 
index cd7f6ba3d26807c953462d8af6bc8efedebf88c5..d1f567d2f64101a847a24059432c5c05199077bb 100644 (file)
@@ -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