From 7eec5c5c39a311e85a529793a5622a030150f483 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 11 Jul 2001 00:41:55 +0000 Subject: [PATCH] New procedure PARSER-BUFFER-REF. --- v7/src/star-parser/buffer.scm | 9 ++++++++- v7/src/star-parser/load.scm | 4 ++-- v7/src/star-parser/parser.pkg | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/v7/src/star-parser/buffer.scm b/v7/src/star-parser/buffer.scm index 28b872d8e..1871de68f 100644 --- a/v7/src/star-parser/buffer.scm +++ b/v7/src/star-parser/buffer.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: buffer.scm,v 1.7 2001/07/05 18:51:23 cph Exp $ +;;; $Id: buffer.scm,v 1.8 2001/07/11 00:41:50 cph Exp $ ;;; ;;; Copyright (c) 2001 Massachusetts Institute of Technology ;;; @@ -131,6 +131,13 @@ (and (guarantee-buffer-chars buffer 1) (string-ref (parser-buffer-string buffer) (parser-buffer-index buffer)))) + +(define (parser-buffer-ref buffer index) + (if (not (index-fixnum? index)) + (error:wrong-type-argument index "index" '???)) + (and (guarantee-buffer-chars buffer (fix:+ index 1)) + (string-ref (parser-buffer-string buffer) + (fix:+ (parser-buffer-index buffer) index)))) (let-syntax ((char-matcher diff --git a/v7/src/star-parser/load.scm b/v7/src/star-parser/load.scm index e03ab3990..6d7ae6e41 100644 --- a/v7/src/star-parser/load.scm +++ b/v7/src/star-parser/load.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: load.scm,v 1.4 2001/07/02 18:21:01 cph Exp $ +;;; $Id: load.scm,v 1.5 2001/07/11 00:41:52 cph Exp $ ;;; ;;; Copyright (c) 2001 Massachusetts Institute of Technology ;;; @@ -24,4 +24,4 @@ (lambda () (fluid-let ((*allow-package-redefinition?* #t)) (package/system-loader "parser" '() 'QUERY)))) -(add-subsystem-identification! "*Parser" '(0 4)) \ No newline at end of file +(add-subsystem-identification! "*Parser" '(0 5)) \ No newline at end of file diff --git a/v7/src/star-parser/parser.pkg b/v7/src/star-parser/parser.pkg index c0f532f9a..6da877b57 100644 --- a/v7/src/star-parser/parser.pkg +++ b/v7/src/star-parser/parser.pkg @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: parser.pkg,v 1.5 2001/07/02 18:20:47 cph Exp $ +;;; $Id: parser.pkg,v 1.6 2001/07/11 00:41:55 cph Exp $ ;;; ;;; Copyright (c) 2001 Massachusetts Institute of Technology ;;; @@ -54,6 +54,7 @@ parser-buffer-pointer-line parser-buffer-pointer? parser-buffer-position-string + parser-buffer-ref parser-buffer? peek-parser-buffer-char read-parser-buffer-char -- 2.25.1