aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-04-22 00:49:04 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-11-22 11:33:06 +0800
commite9b08e029eb48fff9cd3b3287a88e1282395bfb4 (patch)
tree4de9e08218bb01177566dbbf749facedee24da64 /docs
parent15ca9870481e51f1923c0f41cbae449c14f4fc4d (diff)
downloaddexon-solidity-e9b08e029eb48fff9cd3b3287a88e1282395bfb4.tar
dexon-solidity-e9b08e029eb48fff9cd3b3287a88e1282395bfb4.tar.gz
dexon-solidity-e9b08e029eb48fff9cd3b3287a88e1282395bfb4.tar.bz2
dexon-solidity-e9b08e029eb48fff9cd3b3287a88e1282395bfb4.tar.lz
dexon-solidity-e9b08e029eb48fff9cd3b3287a88e1282395bfb4.tar.xz
dexon-solidity-e9b08e029eb48fff9cd3b3287a88e1282395bfb4.tar.zst
dexon-solidity-e9b08e029eb48fff9cd3b3287a88e1282395bfb4.zip
Restriction of switch
Diffstat (limited to 'docs')
-rw-r--r--docs/julia.rst7
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/julia.rst b/docs/julia.rst
index 5d6b8497..7740bc70 100644
--- a/docs/julia.rst
+++ b/docs/julia.rst
@@ -90,7 +90,7 @@ Grammar::
Switch =
'switch' Expression Case* ( 'default' ':' Block )?
Case =
- 'case' Expression ':' Block
+ 'case' Literal ':' Block
ForLoop =
'for' Block Expression Block Block
BreakContinue =
@@ -120,6 +120,11 @@ the block they are defined in (including all sub-nodes and sub-blocks).
Shadowing is disallowed, i.e. you cannot declare an identifier at a point
where another identifier with the same name is also visible.
+Switches must have at least one (or the default) and at most one default case.
+If all possible values of the expression is covered, the default case should
+not be allowed (i.e. a switch with a ``bool`` expression and having both a
+true and false case should not allow a default case).
+
In for-loops, identifiers declared in the first block (the init block)
are visible in all other parts of the for loop (but not outside of the loop).
Identifiers declared in the other parts of the for loop respect the regular