diff --git a/scheme/ikarus.numerics.ss b/scheme/ikarus.numerics.ss index a2055bf..44e373a 100644 --- a/scheme/ikarus.numerics.ss +++ b/scheme/ikarus.numerics.ss @@ -2351,10 +2351,10 @@ (cond [(fx= n (string-length "+xxx.0")) (cond - [(string=? x "+inf.0") +inf.0] - [(string=? x "-inf.0") -inf.0] - [(string=? x "+nan.0") +nan.0] - [(string=? x "-nan.0") -nan.0] + [(string-ci=? x "+inf.0") +inf.0] + [(string-ci=? x "-inf.0") -inf.0] + [(string-ci=? x "+nan.0") +nan.0] + [(string-ci=? x "-nan.0") -nan.0] [else (start x n 0 #f #f)])] [(fx> n 0) (start x n 0 #f #f)] [else #f])))) diff --git a/scheme/ikarus.reader.ss b/scheme/ikarus.reader.ss index 401e8fe..3b07f74 100644 --- a/scheme/ikarus.reader.ss +++ b/scheme/ikarus.reader.ss @@ -692,32 +692,32 @@ [(#\1) 1] [else #f])] [else (error 'radix-digit "invalid radix" radix)])) - (define (read-char* p ls str who) - (let f ([i 0] [ls ls]) - (let ([c (read-char p)]) - (cond - [(fx= i (string-length str)) - (cond - [(eof-object? c) (void)] - [(delimiter? c) (unread-char c p)] - [else - (unread-char c p) - (error 'tokenize - (format "invalid ~a: ~s" who - (list->string (reverse (cons c ls)))))])] - [else - (cond - [(eof-object? c) - (error 'tokenize - (format "invalid eof inside ~a" who))] - [(char=? c (string-ref str i)) - (f (add1 i) (cons c ls))] - [else - (unread-char c p) - (error 'tokenize - (format "invalid ~a: ~s" who - (list->string (reverse (cons c ls)))))])])))) (define (tokenize-integer/nan/inf-no-digits p ls) + (define (read-char* p ls str who) + (let f ([i 0] [ls ls]) + (let ([c (read-char p)]) + (cond + [(fx= i (string-length str)) + (cond + [(eof-object? c) (void)] + [(delimiter? c) (unread-char c p)] + [else + (unread-char c p) + (error 'tokenize + (format "invalid ~a: ~s" who + (list->string (reverse (cons c ls)))))])] + [else + (cond + [(eof-object? c) + (error 'tokenize + (format "invalid eof inside ~a" who))] + [(char=? (char-downcase c) (string-ref str i)) + (f (add1 i) (cons c ls))] + [else + (unread-char c p) + (error 'tokenize + (format "invalid ~a: ~s" who + (list->string (reverse (cons c ls)))))])])))) (let ([c (read-char p)]) (cond [(eof-object? c) (num-error "invalid eof" ls)] @@ -726,10 +726,10 @@ (tokenize-integer p (cons c ls) #f 10 d))] [(char=? c #\.) (tokenize-decimal-no-digits p (cons c ls) #f)] - [(char=? c #\i) + [(memv c '(#\i #\I)) (read-char* p (cons #\i ls) "nf.0" "number sequence") +inf.0] - [(char=? c #\n) + [(memv c '(#\n #\N)) (read-char* p (cons #\i ls) "an.0" "number sequence") +nan.0] [else (num-error "invalid sequence" (cons c ls))])))