From e620656889cc4220b9b4a58439d2c5036312d4f4 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 29 Jun 2001 05:23:24 +0000 Subject: [PATCH] * Track the line number of the current buffer position, so that error messages can refer to the line. Change representation of buffer pointers to include the line number. Add operation to generate a string that shows the line number and character number of either a given pointer or the current position. * Eliminate DECREMENT-PARSER-BUFFER-POINTER, which was unused and makes implementing the line number more difficult. * Add -NO-ADVANCE versions of procedures that match single characters. * Change terminology: the index of the current character in the buffer is called a "position". The word "pointer" is reserved to refer to pointer objects that are handed to the users, which themselves refer to positions. --- v7/src/star-parser/buffer.scm | 6 +++--- v7/src/star-parser/ed-ffi.scm | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/v7/src/star-parser/buffer.scm b/v7/src/star-parser/buffer.scm index 1a9ee5899..afc78ad0e 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.4 2001/06/29 05:19:24 cph Exp $ +;;; $Id: buffer.scm,v 1.5 2001/06/29 05:21:43 cph Exp $ ;;; ;;; Copyright (c) 2001 Massachusetts Institute of Technology ;;; @@ -53,10 +53,10 @@ ;;; length. (define (substring->parser-buffer string start end) - (make-parser-buffer string start end 0 start #f #t 0 0)) + (make-parser-buffer string start end 0 start #f #t 0)) (define (source->parser-buffer source) - (make-parser-buffer (make-string min-length) 0 0 0 0 source #f 0 0)) + (make-parser-buffer (make-string min-length) 0 0 0 0 source #f 0)) (define-integrable min-length 256) diff --git a/v7/src/star-parser/ed-ffi.scm b/v7/src/star-parser/ed-ffi.scm index a3454775d..13e87cf4b 100644 --- a/v7/src/star-parser/ed-ffi.scm +++ b/v7/src/star-parser/ed-ffi.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: ed-ffi.scm,v 1.1 2001/06/26 18:51:22 cph Exp $ +;;; $Id: ed-ffi.scm,v 1.2 2001/06/29 05:23:24 cph Exp $ ;;; ;;; Copyright (c) 2001 Massachusetts Institute of Technology ;;; @@ -22,7 +22,7 @@ ;;;; Parser language: Edwin buffer packaging info (standard-scheme-find-file-initialization - '#(("buffer" (runtime *parser) + '#(("buffer" (runtime *parser buffer) system-global-syntax-table) ("matcher" (runtime *parser) system-global-syntax-table) -- 2.25.1