#| -*-Scheme-*-
-$Id: parser-buffer.scm,v 1.15 2006/01/31 17:43:37 cph Exp $
+$Id: parser-buffer.scm,v 1.16 2006/06/10 04:06:47 cph Exp $
Copyright 2001,2002,2003,2004,2006 Massachusetts Institute of Technology
", char "
(number->string (+ (parser-buffer-pointer-index pointer) 1)))))
+(define (parser-buffer-error ptr msg . irritants)
+ (apply error
+ (string-append msg
+ " at "
+ (parser-buffer-position-string ptr)
+ (if (pair? irritants) ":" "."))
+ irritants))
+\f
(define (read-parser-buffer-char buffer)
;; Attempt to read the next character from BUFFER, starting at the
;; current position. If there is a character available, increment
(and (guarantee-buffer-chars buffer (fix:+ index 1))
(%wide-string-ref (parser-buffer-string buffer)
(fix:+ (parser-buffer-index buffer) index))))
-\f
+
(define (match-parser-buffer-char buffer char)
(match-char buffer char char=?))
(define (match-parser-buffer-not-char-ci-no-advance buffer char)
(match-char-not-no-advance buffer char char-ci=?))
-
+\f
(define (match-parser-buffer-char-in-set buffer set)
(match-char buffer set char-in-set?))
#| -*-Scheme-*-
-$Id: runtime.pkg,v 14.582 2006/03/10 01:46:20 cph Exp $
+$Id: runtime.pkg,v 14.583 2006/06/10 04:06:47 cph Exp $
Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology
Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology
(files "parser-buffer")
(parent (runtime))
(export ()
+ (match-utf8-char-in-alphabet match-parser-buffer-char-in-alphabet)
call-with-parser-buffer-tail
discard-parser-buffer-head!
get-parser-buffer-pointer
match-parser-buffer-substring-ci
match-parser-buffer-substring-ci-no-advance
match-parser-buffer-substring-no-advance
- (match-utf8-char-in-alphabet match-parser-buffer-char-in-alphabet)
+ parser-buffer-error
parser-buffer-line
parser-buffer-pointer-index
parser-buffer-pointer-line