File tree 3 files changed +9
-1
lines changed
3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ This section lists changes that do not have deprecation warnings.
17
17
* ` ntuple(f, n::Integer) ` throws ` ArgumentError ` if ` n ` is negative.
18
18
Previously an empty tuple was returned ([ #21697 ] ).
19
19
20
+ * Juxtaposing string literals (e.g. ` "x"y ` ) is now a syntax error ([ #20575 ] ).
21
+
20
22
* ` @__DIR__ ` returns the current working directory rather than ` nothing ` when not run
21
23
from a file ([ #21759 ] ).
22
24
Original file line number Diff line number Diff line change 876
876
)
877
877
(not (ts:space? s))
878
878
(not (operator? t))
879
- (not (initial-reserved-word? t))
880
879
(not (closing-token? t))
881
880
(not (newline? t))
881
+ (or (not (string? expr)) ; ; issue #20575
882
+ (error " cannot juxtapose string literal" ))
883
+ (not (initial-reserved-word? t))
882
884
(not (and (pair? expr) (syntactic-unary-op? (car expr))))
883
885
; ; TODO: this would disallow juxtaposition with 0, which is ambiguous
884
886
; ; with e.g. hex literals `0x...`. however this is used for `0im`, which
Original file line number Diff line number Diff line change @@ -1149,6 +1149,10 @@ f21586(; @m21586(a), @m21586(b)) = a + b
1149
1149
end
1150
1150
@test Test21604. X (1.0 ) === Test21604. X (1.0 )
1151
1151
1152
+ # issue #20575
1153
+ @test_throws ParseError parse (" \" a\" x" )
1154
+ @test_throws ParseError parse (" \" a\" begin end" )
1155
+
1152
1156
# comment 298107224 on pull #21607
1153
1157
module Test21607
1154
1158
using Base. Test
You can’t perform that action at this time.
0 commit comments