1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-18 09:40:25 +02:00

ice-9/read: Parse #{}}# properly.

This is a regression since Guile 3.0.2 and breaks compilation
of a Guile library.

* module/ice-9/read.scm
  (%read)[read-parenthesized]: When SAW-BRACE? is #t but CH isn't
  #\#, don't eat CH.
* test-suite/tests/reader.test
  ("#{}#): Add four test cases.
This commit is contained in:
Maxime Devos 2021-07-18 19:59:32 +02:00 committed by Daniel Llorens
parent d79a226359
commit c78c130b1d
2 changed files with 10 additions and 2 deletions

View file

@ -536,6 +536,11 @@
(with-test-prefix "#{}#"
(pass-if (equal? (read-string "#{}#") '#{}#))
;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49623>
(pass-if (equal? (read-string "#{}}#") (string->symbol "}")))
(pass-if (equal? (read-string "#{}}}#") (string->symbol "}}")))
(pass-if (equal? (read-string "#{{}}#") (string->symbol "{}")))
(pass-if (equal? (read-string "#{{}b}#") (string->symbol "{}b")))
(pass-if (not (equal? (read-string "(a #{.}# b)") '(a . b))))
(pass-if (equal? (read-string "#{a}#") 'a))
(pass-if (equal? (read-string "#{a b}#") '#{a b}#))