From 30ee57ff637ac527b78c1f384346f4e392d7ea62 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 17 Jan 2007 02:48:57 +0000 Subject: [PATCH] Implement UTF8-STRING->PARSER-BUFFER. --- v7/src/runtime/parser-buffer.scm | 6 +++++- v7/src/runtime/runtime.pkg | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/v7/src/runtime/parser-buffer.scm b/v7/src/runtime/parser-buffer.scm index be74158d7..4842c24b8 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.18 2007/01/05 21:19:28 cph Exp $ +$Id: parser-buffer.scm,v 1.19 2007/01/17 02:48:51 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -73,6 +73,10 @@ USA. 'STRING->PARSER-BUFFER)))) (make-parser-buffer string start end 0 0 #f #t 0))))) +(define (utf8-string->parser-buffer string #!optional start end) + (let ((ws (utf8-string->wide-string string start end))) + (make-parser-buffer ws 0 (%wide-string-length ws) 0 0 #f #t 0))) + (define (input-port->parser-buffer port) (guarantee-input-port port 'INPUT-PORT->PARSER-BUFFER) (make-parser-buffer (make-wide-string min-length) 0 0 0 0 port #f 0)) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index cf20cca21..253334daa 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.610 2007/01/09 06:16:59 cph Exp $ +$Id: runtime.pkg,v 14.611 2007/01/17 02:48:57 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -4806,7 +4806,8 @@ USA. peek-parser-buffer-char read-parser-buffer-char set-parser-buffer-pointer! - string->parser-buffer)) + string->parser-buffer + utf8-string->parser-buffer)) (define-package (runtime unicode) (files "unicode") -- 2.25.1