Skip to content

Commit e3b890e

Browse files
committed
Deprecate hexstrings
1 parent 6c14245 commit e3b890e

File tree

2 files changed

+18
-33
lines changed

2 files changed

+18
-33
lines changed

deprecate.dd

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ $(SPEC_S Deprecated Features,
1010

1111
$(TABLE2 Deprecated Features,
1212
$(THEAD Feature, Spec, Dep, Error, Gone)
13+
$(TROW $(DEPLINK Hexstring literals), 2.079, 2.079,  ,  )
1314
$(TROW $(DEPLINK Class allocators and deallocators), future,  ,  ,  )
1415
$(TROW $(DEPLINK Implicit comparison of different enums), 2.075, 2.075,  ,  )
1516
$(TROW $(DEPLINK Implicit string concatenation), 2.072, 2.072,  ,  )
@@ -59,6 +60,23 @@ $(SPEC_S Deprecated Features,
5960
$(DD The feature is completely gone)
6061
)
6162

63+
$(H3 $(DEPNAME Hexstring literals))
64+
$(P Hexstring literals can be used to enter literals in base 16.
65+
---
66+
// deprecated code
67+
// auto x = x"1234";
68+
---
69+
)
70+
$(H4 Corrective Action)
71+
$(P Use the $(REF hexString, std,conv) template.
72+
---
73+
auto x = hexString!"1234";
74+
---
75+
)
76+
$(H4 Rationale)
77+
$(P Hexstrings are used so seldom that they don't warrant a language feature.
78+
)
79+
6280
$(H3 $(DEPNAME Class allocators and deallocators))
6381
$(P D classes can have members customizing the (de)allocation strategy.
6482
---

spec/lex.dd

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -325,18 +325,6 @@ $(GNAME EscapeSequence):
325325
$(D \U) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit)
326326
$(D \) $(GLINK2 entity, NamedCharacterEntity)
327327

328-
$(GNAME HexString):
329-
$(D x") $(GLINK HexStringChars) $(D ") $(GLINK StringPostfix)$(OPT)
330-
331-
$(GNAME HexStringChars):
332-
$(GLINK HexStringChar)
333-
$(GLINK HexStringChar) $(I HexStringChars)
334-
335-
$(GNAME HexStringChar):
336-
$(GLINK HexDigit)
337-
$(GLINK WhiteSpace)
338-
$(GLINK EndOfLine)
339-
340328
$(GNAME StringPostfix):
341329
$(B c)
342330
$(B w)
@@ -405,23 +393,6 @@ $(H3 $(LNAME2 double_quoted_strings, Double Quoted Strings))
405393
// 'a', 'b', and a linefeed
406394
---------------
407395

408-
409-
410-
$(H3 $(LNAME2 hex_strings, Hex Strings))
411-
412-
$(P Hex strings allow string literals to be created using hex data.
413-
The hex data need not form valid UTF characters.
414-
)
415-
416-
--------------
417-
x"0A" // same as "\x0A"
418-
x"00 FBCD 32FD 0A" // same as
419-
// "\x00\xFB\xCD\x32\xFD\x0A"
420-
--------------
421-
422-
$(P Whitespace and newlines are ignored, so the hex data can be easily
423-
formatted. The number of hex characters must be a multiple of 2.)
424-
425396
$(P Adjacent strings are concatenated with the ~ operator:)
426397

427398
--------------
@@ -732,10 +703,6 @@ $(GNAME HexLetter):
732703
by a $(SINGLEQUOTE 0b) or $(SINGLEQUOTE 0B).
733704
)
734705

735-
$(P C-style octal integer notation was deemed too easy to mix up with decimal notation;
736-
it is only fully supported in string literals.
737-
D still supports octal integer literals interpreted at compile time through the $(REF octal, std,conv)
738-
template, as in $(D octal!167).)
739706

740707
$(P Hexadecimal integers are a sequence of hexadecimal digits preceded
741708
by a $(SINGLEQUOTE 0x) or $(SINGLEQUOTE 0X).

0 commit comments

Comments
 (0)