-
-
Notifications
You must be signed in to change notification settings - Fork 614
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d6f693b
commit 00db26d
Showing
4 changed files
with
96 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Adds the with-colon statement. | ||
|
||
Like at the global declarations level, a `with (expression) :` can be used to create | ||
a scope until a `}` is encountered. | ||
|
||
--- | ||
{ | ||
with (E): | ||
statement; | ||
statement; | ||
} | ||
--- | ||
|
||
which is equivalent to: | ||
|
||
--- | ||
{ | ||
with (E) | ||
{ | ||
statement; | ||
statement; | ||
} | ||
} | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* TEST_OUTPUT: | ||
--- | ||
fail_compilation/withspoon.d(17): Error: matching `}` expected following compound with statement, not `End of File` | ||
fail_compilation/withspoon.d(15): unmatched `with (exp):` | ||
fail_compilation/withspoon.d(17): Error: matching `}` expected following compound statement, not `End of File` | ||
fail_compilation/withspoon.d(14): unmatched `{` | ||
--- | ||
*/ | ||
|
||
|
||
enum E { A, B } | ||
|
||
void test2() | ||
{ | ||
with (E): | ||
return; |