-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SCRIPTS: Support single line if/else/while blocks
Before this change for all if/else/while blocks we needed to use brackets. Now they are optional if the block only contains one line. So we can for example now use: if (foo == 0) bar = 0; But be careful as while the following is supported, it will probably not do what you expect (the else is applied to the first if and not the second one): if (foo == 0) if (bar == 0) var = 0; else var = 1; To try to mitigate this issue the following will result in an error: if (foo == 0) if (bar == 0) { var = 0; } else { var = 1; }
- Loading branch information
Showing
2 changed files
with
51 additions
and
37 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
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