;;; -*-Scheme-*-
;;;
-;;; $Id: buffer.scm,v 1.10 2001/10/04 15:53:52 cph Exp $
+;;; $Id: buffer.scm,v 1.11 2001/10/04 16:59:56 cph Exp $
;;;
;;; Copyright (c) 2001 Massachusetts Institute of Technology
;;;
(char-matcher char-in-set (char-set-member? reference char)))
(define (match-utf8-char-in-alphabet buffer alphabet)
- (if (let ((n
- (read-utf8-code-point-from-source
- (lambda ()
- (read-parser-buffer-char buffer)))))
- (and n
- (code-point-in-alphabet? n alphabet)))
- #t
- (begin
- (set-parser-buffer-pointer! buffer p)
- #f)))
+ (let ((p (get-parser-buffer-pointer buffer)))
+ (if (let ((n
+ (read-utf8-code-point-from-source
+ (lambda ()
+ (read-parser-buffer-char buffer)))))
+ (and n
+ (code-point-in-alphabet? n alphabet)))
+ #t
+ (begin
+ (set-parser-buffer-pointer! buffer p)
+ #f))))
\f
(let-syntax
((string-matcher
;;; -*-Scheme-*-
;;;
-;;; $Id: unicode.scm,v 1.5 2001/10/04 16:28:57 cph Exp $
+;;; $Id: unicode.scm,v 1.6 2001/10/04 16:59:18 cph Exp $
;;;
;;; Copyright (c) 2001 Massachusetts Institute of Technology
;;;
(fix:or (fix:lsh n4 6)
n5))))
(else
- (error "Illegal initial UTF-8 char:" c)))))
+ (error "Illegal initial UTF-8 char:" c0)))))
(define (utf8-string->code-point string)
(read-utf8-code-point (string->input-port string)))