X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcode%2Freadtable.lisp;h=250381e6931dca88199dbd59281409b7cad5be11;hb=dfe6138af5c38d92568b6dac48e852c01be0ec8e;hp=ee4dd7a3a761e6e6e2c5d1938c8dfe0ff57ffaf7;hpb=56a972e201d117a8d5d769527f2bafd23cba7de9;p=sbcl.git diff --git a/src/code/readtable.lisp b/src/code/readtable.lisp index ee4dd7a..250381e 100644 --- a/src/code/readtable.lisp +++ b/src/code/readtable.lisp @@ -12,7 +12,7 @@ (in-package "SB!IMPL") (sb!xc:deftype attribute-table () - '(simple-array (unsigned-byte 8) (#.sb!xc:char-code-limit))) + '(simple-array (unsigned-byte 8) (#.base-char-code-limit))) ;;; constants for readtable character attributes. These are all as in ;;; the manual. @@ -25,13 +25,18 @@ (def!constant +char-attr-constituent-slash+ 6) (def!constant +char-attr-constituent-digit+ 7) (def!constant +char-attr-constituent-sign+ 8) -;; the "9" entry intentionally left blank for some reason -- WHN 19990806 -;; -;; appropriated by CSR 2004-03-16 +;;; the following two are not static but depend on *READ-BASE*. +;;; DECIMAL-DIGIT is for characters being digits in base 10 but not in +;;; base *READ-BASE* (which is therefore perforce smaller than 10); +;;; DIGIT-OR-EXPT is for characters being both exponent markers and +;;; digits in base *READ-BASE* (which is therefore perforce larger +;;; than 10). -- CSR, 2004-03-16 (def!constant +char-attr-constituent-decimal-digit+ 9) -(def!constant +char-attr-multiple-escape+ 10) -(def!constant +char-attr-package-delimiter+ 11) -(def!constant +char-attr-delimiter+ 12) ; (a fake for READ-UNQUALIFIED-TOKEN) +(def!constant +char-attr-constituent-digit-or-expt+ 10) + +(def!constant +char-attr-multiple-escape+ 11) +(def!constant +char-attr-package-delimiter+ 12) +(def!constant +char-attr-delimiter+ 13) ; (a fake for READ-UNQUALIFIED-TOKEN) (sb!xc:defstruct (readtable (:conc-name nil) (:predicate readtablep) @@ -53,20 +58,22 @@ ;; In order to make READ-TOKEN fast, all this information is stored ;; in the character attribute table by having different varieties of ;; constituents. - (character-attribute-table - (make-array sb!xc:char-code-limit + (character-attribute-array + (make-array base-char-code-limit :element-type '(unsigned-byte 8) :initial-element +char-attr-constituent+) :type attribute-table) + (character-attribute-hash-table (make-hash-table) :type hash-table) ;; The CHARACTER-MACRO-TABLE is a vector of CHAR-CODE-LIMIT ;; functions. One of these functions called with appropriate ;; arguments whenever any non-WHITESPACE character is encountered ;; inside READ-PRESERVING-WHITESPACE. These functions are used to ;; implement user-defined read-macros, system read-macros, and the ;; number-symbol reader. - (character-macro-table - (make-array sb!xc:char-code-limit :initial-element #'undefined-macro-char) - :type (simple-vector #.sb!xc:char-code-limit)) + (character-macro-array + (make-array base-char-code-limit :initial-element #'undefined-macro-char) + :type (simple-vector #.base-char-code-limit)) + (character-macro-hash-table (make-hash-table) :type hash-table) ;; an alist from dispatch characters to vectors of CHAR-CODE-LIMIT ;; functions, for use in defining dispatching macros (like #-macro) (dispatch-tables () :type list)