Changeset 13527
- Timestamp:
- Mar 12, 2010, 2:05:36 PM (15 years ago)
- Location:
- branches/working-0711/ccl
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
level-1/l1-reader.lisp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/working-0711/ccl
- Property svn:mergeinfo changed
/trunk/source merged: 13488,13495,13498
- Property svn:mergeinfo changed
-
branches/working-0711/ccl/level-1/l1-reader.lisp
r13505 r13527 1990 1990 (defun copy-readtable (&optional (from *readtable*) to) 1991 1991 (setq from (if from (readtable-arg from) %standard-readtable%)) 1992 (setq to (if to 1993 (readtable-arg to) 1994 (%istruct 'readtable 1995 (make-array 256 :element-type '(unsigned-byte 8)) 1992 (let* ((fttab (rdtab.ttab from)) 1993 (ttablen (uvsize fttab))) 1994 (declare (fixnum ttablen)) 1995 (setq to (if to 1996 (readtable-arg to) 1997 (%istruct 'readtable 1998 (make-array ttablen :element-type '(unsigned-byte 8)) 1996 1999 nil (rdtab.case from)))) 1997 (setf (rdtab.alist to) (copy-tree (rdtab.alist from))) 1998 (setf (rdtab.case to) (rdtab.case from)) 1999 (let* ((fttab (rdtab.ttab from)) 2000 (tttab (rdtab.ttab to))) 2001 (%copy-ivector-to-ivector fttab 0 tttab 0 256)) 2002 to) 2000 (setf (rdtab.alist to) (copy-tree (rdtab.alist from))) 2001 (setf (rdtab.case to) (rdtab.case from)) 2002 (let* ((tttab (rdtab.ttab to))) 2003 (%copy-ivector-to-ivector fttab 0 tttab 0 ttablen)) 2004 to)) 2003 2005 2004 2006 (declaim (inline %character-attribute)) … … 2006 2008 (defun %character-attribute (char attrtab) 2007 2009 (declare (character char) 2008 (type (simple-array (unsigned-byte 8) ( 256)) attrtab)2010 (type (simple-array (unsigned-byte 8) (*)) attrtab) 2009 2011 (optimize (speed 3) (safety 0))) 2010 2012 (let* ((code (char-code char))) 2011 2013 (declare (fixnum code)) 2012 (if (< code 256)2014 (if (< code (uvsize attrtab)) 2013 2015 (aref attrtab code) 2014 ;; Should probably have an extension mechanism for things2015 ;; like NBS.2016 2016 $cht_cnst))) 2017 2018 (defun %set-character-attribute (char readtable attr) 2019 (let* ((code (char-code char)) 2020 (attrtab (rdtab.ttab readtable)) 2021 (oldsize (uvsize attrtab))) 2022 (declare (type (mod #x110000) code) 2023 (type (simple-array (unsigned-byte 8) (*)) attrtab)) 2024 (when (>= code oldsize) 2025 ;; Characters whose code is > the current size of the table 2026 ;; are implicitly constituents; don't grow the table just to 2027 ;; store that info explicitly. 2028 (if (eql attr $cht_cnst) 2029 (return-from %set-character-attribute attr) 2030 (let* ((newsize (min (+ code code) char-code-limit)) 2031 (new (make-array newsize 2032 :element-type '(unsigned-byte 8) 2033 :initial-element $cht_cnst))) 2034 (declare ((simple-array (unsigned-byte 8) (*)) new)) 2035 (%copy-ivector-to-ivector attrtab 0 new 0 oldsize) 2036 (setf (rdtab.ttab readtable) (setq attrtab new))))) 2037 (setf (aref attrtab code) attr))) 2038 2017 2039 2018 2040 ;;; returns: (values attrib <aux-info>), where … … 2047 2069 (if old-to-info 2048 2070 (setf (rdtab.alist to-readtable) (delq old-to-info (rdtab.alist to-readtable))))) 2049 (if (and (= from-attr $cht_cnst) 2050 (member to-char '(#\Newline #\Linefeed #\Page #\Return 2051 #\Space #\Tab #\Backspace #\Rubout))) 2052 (setf (uvref (rdtab.ttab to-readtable) (char-code to-char)) $cht_ill) 2053 (setf (uvref (rdtab.ttab to-readtable) (char-code to-char)) from-attr))) 2071 (%set-character-attribute to-char 2072 to-readtable 2073 (if (and (= from-attr $cht_cnst) 2074 (member to-char '(#\Newline #\Linefeed #\Page #\Return 2075 #\Space #\Tab #\Backspace #\Rubout))) 2076 $cht_ill 2077 from-attr))) 2054 2078 t))) 2055 2079 … … 2078 2102 (declare (list info)) 2079 2103 (without-interrupts 2080 ( setf (uvref (rdtab.ttab readtable) (char-code char))2081 (if (null fn) $cht_cnst (if non-terminating-p $cht_ntmac $cht_tmac)))2104 (%set-character-attribute char readtable 2105 (if (null fn) $cht_cnst (if non-terminating-p $cht_ntmac $cht_tmac))) 2082 2106 (if (and (null fn) info) 2083 2107 (setf (rdtab.alist readtable) (delete info (rdtab.alist readtable) :test #'eq)) … … 2115 2139 (declare (list info)) 2116 2140 (without-interrupts 2117 ( setf (uvref (rdtab.ttab readtable) (char-code char))2141 (%set-character-attribute char readtable 2118 2142 (if non-terminating-p $cht_ntmac $cht_tmac)) 2119 2143 (if info
Note:
See TracChangeset
for help on using the changeset viewer.
