From f3e1f096932834938a59fe9c4a4c419b336a5212 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 16 Jul 2017 15:44:34 -0600 Subject: [PATCH] fix use of `eqv?` with `+inf.0` The current Racket implementation preserves the `eq?`ness of `+inf.0` enough to mostly hide this problem. --- parser-tools-lib/parser-tools/private-lex/re.rkt | 2 +- parser-tools-lib/parser-tools/private-lex/stx.rkt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/parser-tools-lib/parser-tools/private-lex/re.rkt b/parser-tools-lib/parser-tools/private-lex/re.rkt index 9da62de..b06c3eb 100644 --- a/parser-tools-lib/parser-tools/private-lex/re.rkt +++ b/parser-tools-lib/parser-tools/private-lex/re.rkt @@ -172,7 +172,7 @@ ((and (= 0 low) (or (= 0 high) (eq? z r))) e) ((and (= 1 low) (= 1 high)) r) ((and (repeatR? r) - (eq? (repeatR-high r) +inf.0) + (eqv? (repeatR-high r) +inf.0) (or (= 0 (repeatR-low r)) (= 1 (repeatR-low r)))) (build-repeat (* low (repeatR-low r)) diff --git a/parser-tools-lib/parser-tools/private-lex/stx.rkt b/parser-tools-lib/parser-tools/private-lex/stx.rkt index 1104a87..86f7a70 100644 --- a/parser-tools-lib/parser-tools/private-lex/stx.rkt +++ b/parser-tools-lib/parser-tools/private-lex/stx.rkt @@ -84,7 +84,7 @@ stx (car arg-list))) (unless (or (and (number? high) (exact? high) (integer? high) (>= high 0)) - (eq? high +inf.0)) + (eqv? high +inf.0)) (raise-syntax-error #f "not a non-negative exact integer or +inf.0" stx