From 82163f5c9ad28cc12aeb784d739a1a5c038487c5 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 4 Oct 2001 15:53:16 +0000 Subject: [PATCH] Remove all references to parser buffers. --- v7/src/star-parser/parser.pkg | 4 ++-- v7/src/star-parser/unicode.scm | 30 ++++++++---------------------- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/v7/src/star-parser/parser.pkg b/v7/src/star-parser/parser.pkg index db746eb11..56efb9964 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.9 2001/07/14 11:42:29 cph Exp $ +;;; $Id: parser.pkg,v 1.10 2001/10/04 15:53:16 cph Exp $ ;;; ;;; Copyright (c) 2001 Massachusetts Institute of Technology ;;; @@ -93,7 +93,7 @@ code-point-in-alphabet? code-points->alphabet match-utf8-char-in-alphabet - read-utf8-code-point + read-utf8-code-point-from-source string->alphabet unicode-code-point? utf8-string->code-point diff --git a/v7/src/star-parser/unicode.scm b/v7/src/star-parser/unicode.scm index 5ced8afe4..ed163264f 100644 --- a/v7/src/star-parser/unicode.scm +++ b/v7/src/star-parser/unicode.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: unicode.scm,v 1.3 2001/07/12 03:53:02 cph Exp $ +;;; $Id: unicode.scm,v 1.4 2001/10/04 15:52:39 cph Exp $ ;;; ;;; Copyright (c) 2001 Massachusetts Institute of Technology ;;; @@ -463,28 +463,15 @@ (error:wrong-type-argument string "UTF-8 character" 'UTF8-STRING->CODE-POINT))) -(define (match-utf8-char-in-alphabet buffer alphabet) - (let ((p (get-parser-buffer-pointer buffer))) - (let ((n (read-utf8-code-point buffer p))) - (and n - (if (code-point-in-alphabet? n alphabet) - #t - (begin - (set-parser-buffer-pointer! buffer p) - #f)))))) - -(define (read-utf8-code-point buffer p) - (let ((c0 (read-parser-buffer-char buffer)) +(define (read-utf8-code-point-from-source source) + (let ((c0 (source)) (get-next (lambda () - (let ((c (read-parser-buffer-char buffer))) - (if (and c - (fix:<= #x80 (char->integer c)) - (fix:< (char->integer c) #xC0)) - (fix:and (char->integer c) #x3F) - (begin - (set-parser-buffer-pointer! buffer p) - #f)))))) + (let ((c (source))) + (and c + (fix:<= #x80 (char->integer c)) + (fix:< (char->integer c) #xC0) + (fix:and (char->integer c) #x3F)))))) (and c0 (cond ((fix:< (char->integer c0) #x80) (char->integer c0)) @@ -534,5 +521,4 @@ (fix:or (fix:lsh n4 6) n5))))) (else - (set-parser-buffer-pointer! buffer p) #f))))) \ No newline at end of file -- 2.25.1