aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorDenton Liu <liu.denton+github@gmail.com>2016-08-25 03:27:46 +0800
committerDenton Liu <liu.denton+github@gmail.com>2016-08-27 01:33:42 +0800
commitf1e6bc2eaa452412e8050f72ff14ad738dbe49bc (patch)
tree4cf4364870ef190441585e15098fe93c1cbfcd37 /docs
parentfb7836d87bba0eacb2454d6c50b1209365a89b6d (diff)
downloaddexon-solidity-f1e6bc2eaa452412e8050f72ff14ad738dbe49bc.tar.gz
dexon-solidity-f1e6bc2eaa452412e8050f72ff14ad738dbe49bc.tar.zst
dexon-solidity-f1e6bc2eaa452412e8050f72ff14ad738dbe49bc.zip
Update style-guide to use new style
Diffstat (limited to 'docs')
-rw-r--r--docs/style-guide.rst13
1 files changed, 7 insertions, 6 deletions
diff --git a/docs/style-guide.rst b/docs/style-guide.rst
index c7b13efa..f4b419c0 100644
--- a/docs/style-guide.rst
+++ b/docs/style-guide.rst
@@ -273,17 +273,17 @@ No::
}));
For ``if`` blocks which have an ``else`` or ``else if`` clause, the ``else`` should be
-placed on it's own line following the previous closing parenthesis. The
-parenthesis for the else block should follow the same rules as the other
-conditional control structures.
+placed on the same line as the ``if``'s closing brace. This is an exception compared
+to the rules of other block-like structures.
Yes::
if (x < 3) {
x += 1;
- }
- else {
+ } else if (x > 7) {
x -= 1;
+ } else {
+ x = 5;
}
@@ -296,7 +296,8 @@ No::
if (x < 3) {
x += 1;
- } else {
+ }
+ else {
x -= 1;
}