File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 22642264 b))
22652265 (loop (read-char (ts: port s))))))
22662266 (let ((str (tostr #f b)))
2267- (if (= (string-length str) 1)
2268- (string.char str 0)
2269- (error "invalid character literal")))))))
2267+ (let ((len (string-length str)))
2268+ (if (= len 1)
2269+ (string.char str 0)
2270+ (if (= len 0)
2271+ (error "invalid empty character literal")
2272+ (error "character literal contains multiple characters")))))))))
22702273
22712274 ;; symbol/expression quote
22722275 ((eq? t ':)
Original file line number Diff line number Diff line change @@ -1994,3 +1994,9 @@ end
19941994 end
19951995 pop = 1
19961996end == 1
1997+
1998+ # issue #29982
1999+ @test Meta. parse (" 'a'" ) == ' a'
2000+ @test Meta. parse (" '\U 0061'" ) == ' a'
2001+ test_parseerror (" ''" , " invalid empty character literal" )
2002+ test_parseerror (" 'abc'" , " character literal contains multiple characters" )
You can’t perform that action at this time.
0 commit comments