X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Freadtable.lisp;h=c4b711a680a11951878fb2685c6153408d67eddb;hb=c457d41e87e7ab27bb92f59f0e7839fe23b9d020;hp=250381e6931dca88199dbd59281409b7cad5be11;hpb=069ca63d16c8de8742fc78b927dfa7b79a27c96d;p=sbcl.git diff --git a/src/code/readtable.lisp b/src/code/readtable.lisp index 250381e..c4b711a 100644 --- a/src/code/readtable.lisp +++ b/src/code/readtable.lisp @@ -16,34 +16,40 @@ ;;; constants for readtable character attributes. These are all as in ;;; the manual. +;;; +;;; FIXME: wait a minute. Firstly, I doubt they're in the manual. +;;; Secondly, the numerical order of these constants is coupled with +;;; code in CHAR-CLASS{,2,3} in the reader implementation, so beware +;;; when changing them. (def!constant +char-attr-whitespace+ 0) (def!constant +char-attr-terminating-macro+ 1) -(def!constant +char-attr-escape+ 2) -(def!constant +char-attr-constituent+ 3) -(def!constant +char-attr-constituent-dot+ 4) -(def!constant +char-attr-constituent-expt+ 5) -(def!constant +char-attr-constituent-slash+ 6) -(def!constant +char-attr-constituent-digit+ 7) -(def!constant +char-attr-constituent-sign+ 8) +(def!constant +char-attr-single-escape+ 2) +(def!constant +char-attr-multiple-escape+ 3) +(def!constant +char-attr-constituent+ 4) +(def!constant +char-attr-constituent-dot+ 5) +(def!constant +char-attr-constituent-expt+ 6) +(def!constant +char-attr-constituent-slash+ 7) +(def!constant +char-attr-constituent-digit+ 8) +(def!constant +char-attr-constituent-sign+ 9) ;;; 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-constituent-digit-or-expt+ 10) +(def!constant +char-attr-constituent-decimal-digit+ 10) +(def!constant +char-attr-constituent-digit-or-expt+ 11) -(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) +(def!constant +char-attr-invalid+ 13) +(def!constant +char-attr-delimiter+ 14) ; (a fake for READ-UNQUALIFIED-TOKEN) (sb!xc:defstruct (readtable (:conc-name nil) - (:predicate readtablep) - ;; ANSI requires a CL:COPY-READTABLE to do - ;; a deep copy, so the DEFSTRUCT-generated - ;; default is not suitable. - (:copier nil)) + (:predicate readtablep) + ;; ANSI requires a CL:COPY-READTABLE to do + ;; a deep copy, so the DEFSTRUCT-generated + ;; default is not suitable. + (:copier nil)) #!+sb-doc "A READTABLE is a data structure that maps characters into syntax types for the Common Lisp expression reader." @@ -60,8 +66,8 @@ ;; constituents. (character-attribute-array (make-array base-char-code-limit - :element-type '(unsigned-byte 8) - :initial-element +char-attr-constituent+) + :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