File tree 2 files changed +12
-3
lines changed
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 2264
2264
b))
2265
2265
(loop (read-char (ts:port s))))))
2266
2266
(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" )))))))))
2270
2273
2271
2274
; ; symbol/expression quote
2272
2275
((eq? t ': )
Original file line number Diff line number Diff line change @@ -1994,3 +1994,9 @@ end
1994
1994
end
1995
1995
pop = 1
1996
1996
end == 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