@@ -321,6 +321,18 @@ $(GNAME EscapeSequence):
321
321
$(D \U) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit)
322
322
$(D \) $(GLINK2 entity, NamedCharacterEntity)
323
323
324
+ $(GNAME HexString):
325
+ $(D x") $(GLINK HexStringChars) $(D ") $(GLINK StringPostfix)$(OPT)
326
+
327
+ $(GNAME HexStringChars):
328
+ $(GLINK HexStringChar)
329
+ $(GLINK HexStringChar) $(I HexStringChars)
330
+
331
+ $(GNAME HexStringChar):
332
+ $(GLINK HexDigit)
333
+ $(GLINK WhiteSpace)
334
+ $(GLINK EndOfLine)
335
+
324
336
$(GNAME StringPostfix):
325
337
$(B c)
326
338
$(B w)
@@ -389,6 +401,23 @@ $(H3 $(LNAME2 double_quoted_strings, Double Quoted Strings))
389
401
// 'a', 'b', and a linefeed
390
402
---
391
403
404
+ $(H3 $(LNAME2 hex_strings, Hex Strings))
405
+
406
+ $(P Hex strings allow string literals to be created using hex data.
407
+ The hex data need not form valid UTF characters.
408
+ )
409
+
410
+ --------------
411
+ x"0A" // same as "\x0A"
412
+ x"00 FBCD 32FD 0A" // same as
413
+ // "\x00\xFB\xCD\x32\xFD\x0A"
414
+ --------------
415
+
416
+ $(P Whitespace and newlines are ignored, so the hex data can be easily
417
+ formatted. The number of hex characters must be a multiple of 2.)
418
+
419
+ ---
420
+
392
421
$(H3 $(LNAME2 delimited_strings, Delimited Strings))
393
422
394
423
$(P Delimited strings use various forms of delimiters.
@@ -683,6 +712,10 @@ $(GNAME HexLetter):
683
712
by a $(SINGLEQUOTE 0b) or $(SINGLEQUOTE 0B).
684
713
)
685
714
715
+ $(P C-style octal integer notation was deemed too easy to mix up with decimal notation;
716
+ it is only fully supported in string literals.
717
+ D still supports octal integer literals interpreted at compile time through the $(REF octal, std,conv)
718
+ template, as in $(D octal!167).)
686
719
$(P Hexadecimal integers are a sequence of hexadecimal digits preceded
687
720
by a $(SINGLEQUOTE 0x) or $(SINGLEQUOTE 0X).
688
721
)
0 commit comments