From: Chris Hanson Date: Sat, 17 Jan 2004 13:49:49 +0000 (+0000) Subject: Simplify table-lookup mechanism. X-Git-Tag: 20090517-FFI~1708 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=34def81654f07f7ff4393a60abbea2adfde3d6bd;p=mit-scheme.git Simplify table-lookup mechanism. --- diff --git a/v7/src/runtime/parse.scm b/v7/src/runtime/parse.scm index 69eeec24f..dce31ac43 100644 --- a/v7/src/runtime/parse.scm +++ b/v7/src/runtime/parse.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: parse.scm,v 14.46 2004/01/16 19:39:53 cph Exp $ +$Id: parse.scm,v 14.47 2004/01/17 13:49:49 cph Exp $ Copyright 1986,1987,1988,1989,1990,1991 Massachusetts Institute of Technology Copyright 1992,1993,1994,1997,1998,1999 Massachusetts Institute of Technology @@ -64,17 +64,13 @@ USA. (let ((char (read-char port))) (if (eof-object? char) char - (let ((handler (get-handler char (parser-table/initial table)))) - (if (not handler) - (error:illegal-char char)) - (handler port table db ctx char))))) + ((get-handler char (parser-table/initial table)) + port table db ctx char)))) (define (dispatch-special port table db ctx) (let ((char (read-char/no-eof port))) - (let ((handler (get-handler char (parser-table/special table)))) - (if (not handler) - (error:illegal-char char)) - (handler port table db ctx char)))) + ((get-handler char (parser-table/special table)) + port table db ctx char))) (define (dispatch/no-eof port table db ctx) (let ((object (dispatch port table db ctx))) @@ -89,7 +85,10 @@ USA. (let ((n (char->integer char))) (if (not (fix:< n #x100)) (error:illegal-char char)) - (vector-ref handlers n))) + (let ((handler (vector-ref handlers n))) + (if (not handler) + (error:illegal-char char)) + handler))) (define system-global-parser-table) (define char-set/constituents)