@@ -1253,7 +1253,7 @@ $(H2 $(LEGACY_LNAME2 SwitchStatement, switch-statement, Switch Statement))
1253
1253
1254
1254
$(GRAMMAR
1255
1255
$(GNAME SwitchStatement):
1256
- $(D switch $(LPAREN)) $(EXPRESSION ) $(D $(RPAREN)) $(PSSCOPE)
1256
+ $(D switch $(LPAREN)) $(GLINK IfCondition ) $(D $(RPAREN)) $(PSSCOPE)
1257
1257
1258
1258
$(GNAME CaseStatement):
1259
1259
$(D case) $(GLINK2 expression, ArgumentList) $(D :) $(PSSEMI_PSCURLYSCOPE_LIST)$(OPT)
@@ -1274,15 +1274,23 @@ $(GNAME StatementNoCaseNoDefault):
1274
1274
$(GLINK ScopeBlockStatement)
1275
1275
)
1276
1276
1277
- $(P $(I Expression ) is evaluated.
1278
- If the type of $(I Expression) is an `enum`, it is
1277
+ $(P The *Expression* from the $(I IfCondition ) is evaluated.
1278
+ If the type of the * Expression* is an `enum`, it is
1279
1279
(recursively) converted to its $(GLINK2 enum, EnumBaseType).
1280
- Then, if the type is an integral, $(I Expression) undergoes
1280
+ Then, if the type is an integral, the * Expression* undergoes
1281
1281
$(DDSUBLINK spec/type, integer-promotions, Integer Promotions).
1282
- Then, the type of $(I Expression) must be either an integral or
1282
+ Then, the type of the * Expression* must be either an integral or
1283
1283
a static or dynamic array of $(CODE char), $(CODE wchar), or $(CODE dchar).
1284
1284
)
1285
1285
1286
+ $(P If an $(I Identifier) `=` prefix is provided, a variable is declared with that
1287
+ name, initialized to the value and type of the *Expression*. Its scope
1288
+ extends from when it is initialized to the end of the *ScopeStatement*.)
1289
+
1290
+ $(P If $(I TypeCtors) and/or a specific type is provided for *Identifier*, those
1291
+ are used for the variable declaration which is initialized by an implicit
1292
+ conversion from the value of the *Expression*.)
1293
+
1286
1294
$(P The resulting value is
1287
1295
compared against each of the case expressions. If there is
1288
1296
a match, the corresponding case statement is transferred to.
@@ -1467,7 +1475,7 @@ $(H2 $(LEGACY_LNAME2 FinalSwitchStatement, final-switch-statement, Final Switch
1467
1475
1468
1476
$(GRAMMAR
1469
1477
$(GNAME FinalSwitchStatement):
1470
- $(D final switch $(LPAREN)) $(EXPRESSION ) $(D $(RPAREN)) $(PSSCOPE)
1478
+ $(D final switch $(LPAREN)) $(GLINK IfCondition ) $(D $(RPAREN)) $(PSSCOPE)
1471
1479
)
1472
1480
1473
1481
$(P A final switch statement is just like a switch statement,
0 commit comments