File tree 2 files changed +16
-6
lines changed
2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ Language changes
19
19
* In string and character literals, backslash ` \ ` may no longer
20
20
precede unrecognized escape characters ([ #22800 ] ).
21
21
22
+ * Juxtaposing hex literals is deprecated, since it can lead to confusing
23
+ code such as ` 0xapi == 0xa * pi ` ([ #16356 ] ).
24
+
22
25
* Declaring arguments as ` x::ANY ` to avoid specialization has been replaced
23
26
by ` @nospecialize x ` . ([ #22666 ] ).
24
27
Original file line number Diff line number Diff line change 337
337
(write-char (read-char port) str)
338
338
(read-digs #t #f )
339
339
(disallow-dot))
340
- (io.ungetc port c))))
340
+ (io.ungetc port c)))))
341
+ (if (and (char? c)
342
+ (or (and (or (eq? pred char-bin?) (eq? pred char-oct?))
343
+ (char-numeric? c))
344
+ (and (eq? pred char-hex?) (not is-hex-float-literal)
345
+ (identifier-start-char? c)
346
+ (syntax-deprecation port ; ; remove after v0.7
347
+ (string (get-output-string str) c)
348
+ (string (get-output-string str) " * " c))
349
+ #f ))) ; ; remove after v0.7
341
350
; ; disallow digits after binary or octal literals, e.g., 0b12
342
- (if (and (or (eq? pred char-bin?) (eq? pred char-oct?))
343
- (not (eof-object? c))
344
- (char-numeric? c))
345
- (error (string " invalid numeric constant \" "
346
- (get-output-string str) c " \" " )))))
351
+ ; ; and disallow identifier chars after hex literals.
352
+ (error (string " invalid numeric constant \" "
353
+ (get-output-string str) c " \" " ))))
347
354
(let* ((s (get-output-string str))
348
355
(r (cond ((eq? pred char-hex?) 16 )
349
356
((eq? pred char-oct?) 8 )
You can’t perform that action at this time.
0 commit comments