Changeset 5188


Ignore:
Timestamp:
Sep 9, 2006, 3:21:37 AM (18 years ago)
Author:
Gary Byers
Message:

NAME-CHAR: insist on something more reasonable for c syntax; don't do MOD for octal.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-1/l1-reader.lisp

    r5145 r5188  
    8181              (char name 0)
    8282              (if (and (= namelen 2) (eq (char name 0) #\^))
    83                 (code-char (the fixnum (logxor (the fixnum (char-code (char-upcase (char name 1)))) #x40)))
     83                (let* ((c1 (char-code (char-upcase (char name 1)))))
     84                  (if (and (>= c1 64) (< c1 96))
     85                    (code-char (the fixnum (logxor (the fixnum (char-code (char-upcase (char name 1)))) #x40)))))
    8486                (let* ((n 0))
    8587                  (or
     
    99101                             (setq n 0)
    100102                             (return))))))
    101                    (dotimes (i namelen (code-char (mod n char-code-limit)))
     103                   (dotimes (i namelen (if (< n char-code-limit)
     104                                         (code-char n)))
    102105                     (let* ((code (the fixnum (- (the fixnum (char-code (char name i)))
    103106                                                 (char-code #\0)))))
Note: See TracChangeset for help on using the changeset viewer.