aboutsummaryrefslogtreecommitdiffstats
path: root/docs/julia.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/julia.rst')
-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