READ, #- or #+. and *read-suppress*; wrong offset after failed reader conditional
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Unassigned |
Bug Description
When READ while *READ-SUPPRESS* is T encounters a reader conditional which succeeds,
the file-position afterwards is not the same as if *READ-SUPPRESS* was NIL.
This can make debugging awkward when you switch between *READ-SUPPRESS* values
for debugging purposes.
Test case:
;; Conditional succeeds
(defvar *str1*
"#-q 1 2")
;; Conditional succeeds
(defvar *str2*
"#-q
1
2")
;; Conditional succeeds
(defvar *str3*
"#+sbcl
1
2")
;; Conditional fails
(defvar *str4*
"#+q
1
2")
(defun test-read (string)
(list
:expected
(with-
(let ((*read-suppress* nil))
(read s))
(file-position s))
:read-supress
(with-
(let ((*read-suppress* t))
(read s))
(file-position s))))
(values (test-read *str1*)
evaluates to
(:EXPECTED 6 :READ-SUPRESS 5),
(:EXPECTED 6 :READ-SUPRESS 5),
(:EXPECTED 9 :READ-SUPRESS 8),
(:EXPECTED 8 :READ-SUPRESS 8)
Changed in sbcl: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in sbcl: | |
status: | Confirmed → Fix Committed |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |