Skip to content

Commit 8cea52c

Browse files
committed
[expression.dd] (re)move 2 sections to lex.dd
Remove section for true & false, this info is already in lex.dd. Move CharacterLiteral paragraph to lex.dd so the info is all in one place. Update anchor links. Add link for `$`.
1 parent 818a635 commit 8cea52c

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

spec/expression.dd

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,12 +1369,12 @@ $(GNAME PrimaryExpression):
13691369
$(RELATIVE_LINK2 this, $(D this))
13701370
$(RELATIVE_LINK2 super, $(D super))
13711371
$(RELATIVE_LINK2 null, $(D null))
1372-
$(D true)
1373-
$(D false)
1374-
$(D $)
1372+
$(LEGACY_LNAME2 true_false)$(DDSUBLINK spec/type, bool, `true`)
1373+
$(DDSUBLINK spec/type, bool, `false`)
1374+
$(RELATIVE_LINK2 IndexExpression, `$`)
13751375
$(GLINK_LEX IntegerLiteral)
13761376
$(GLINK_LEX FloatLiteral)
1377-
$(GLINK_LEX CharacterLiteral)
1377+
$(LEGACY_LNAME2 CharacterLiteral)$(LEGACY_LNAME2 character-literal)$(GLINK_LEX CharacterLiteral)
13781378
$(GLINK StringLiterals)
13791379
$(GLINK ArrayLiteral)
13801380
$(GLINK AssocArrayLiteral)
@@ -1463,23 +1463,6 @@ $(H3 $(LNAME2 null, null))
14631463
but no longer exact.
14641464
)
14651465

1466-
$(H3 $(LNAME2 true_false, true, false))
1467-
1468-
$(P These are of type $(D bool) and when cast to another integral
1469-
type become the values 1 and 0,
1470-
respectively.
1471-
)
1472-
1473-
$(H3 $(LEGACY_LNAME2 CharacterLiteral, character-literal, Character Literals))
1474-
1475-
$(P Character literals are single characters and resolve to one
1476-
of type $(D char), $(D wchar), or $(D dchar).
1477-
If the literal is a $(D \u) escape sequence, it resolves to type $(D wchar).
1478-
If the literal is a $(D \U) escape sequence, it resolves to type $(D dchar).
1479-
Otherwise, it resolves to the type with the smallest size it
1480-
will fit into.
1481-
)
1482-
14831466
$(H3 $(LNAME2 string_literals, String Literals))
14841467

14851468
$(GRAMMAR

spec/lex.dd

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,17 @@ single quotes.)
638638
'\\' // the backslash character
639639
---
640640

641+
$(P A character literal resolves to one
642+
of type $(D char), $(D wchar), or $(D dchar)
643+
(see $(DDSUBLINK spec/type, basic-data-types, Basic Data Types)).)
644+
645+
$(UL
646+
$(LI If the literal is a $(D \u) escape sequence, it resolves to type $(D wchar).)
647+
$(LI If the literal is a $(D \U) escape sequence, it resolves to type $(D dchar).)
648+
)
649+
$(P Otherwise, it resolves to the type with the smallest size it
650+
will fit into.)
651+
641652
$(H2 $(LNAME2 integerliteral, Integer Literals))
642653

643654
$(GRAMMAR_LEX

0 commit comments

Comments
 (0)