diff options
author | chriseth <chris@ethereum.org> | 2017-11-27 22:02:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-27 22:02:46 +0800 |
commit | a1f59cbb17d29ca5f92fa1cc20d17f47026ade5a (patch) | |
tree | d17e5ab7a2c9cd5ffacba728851e6c127182fbe0 /docs/julia.rst | |
parent | a7136dbc16ba7e0cf8a7d6097d50cc40c1248914 (diff) | |
parent | 1d91b65b726d4757b866124d75834f28a9bc9eb9 (diff) | |
download | dexon-solidity-a1f59cbb17d29ca5f92fa1cc20d17f47026ade5a.tar dexon-solidity-a1f59cbb17d29ca5f92fa1cc20d17f47026ade5a.tar.gz dexon-solidity-a1f59cbb17d29ca5f92fa1cc20d17f47026ade5a.tar.bz2 dexon-solidity-a1f59cbb17d29ca5f92fa1cc20d17f47026ade5a.tar.lz dexon-solidity-a1f59cbb17d29ca5f92fa1cc20d17f47026ade5a.tar.xz dexon-solidity-a1f59cbb17d29ca5f92fa1cc20d17f47026ade5a.tar.zst dexon-solidity-a1f59cbb17d29ca5f92fa1cc20d17f47026ade5a.zip |
Merge pull request #3220 from ethereum/IuliaIf
If statement for Iulia / Inline Assembly
Diffstat (limited to 'docs/julia.rst')
-rw-r--r-- | docs/julia.rst | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/docs/julia.rst b/docs/julia.rst index cf798363..309e6b36 100644 --- a/docs/julia.rst +++ b/docs/julia.rst @@ -15,7 +15,7 @@ future versions of the Solidity compiler will even use JULIA as intermediate language. It should also be easy to build high-level optimizer stages for JULIA. The core components of JULIA are functions, blocks, variables, literals, -for-loops, switch-statements, expressions and assignments to variables. +for-loops, if-statements, switch-statements, expressions and assignments to variables. JULIA is typed, both variables and literals must specify the type with postfix notation. The supported types are ``bool``, ``u8``, ``s8``, ``u32``, ``s32``, @@ -88,6 +88,8 @@ Grammar:: IdentifierList ':=' Expression Expression = FunctionCall | Identifier | Literal + If = + 'if' Expression Block Switch = 'switch' Expression Case* ( 'default' Block )? Case = @@ -248,8 +250,14 @@ We will use a destructuring notation for the AST nodes. G, L, break E(G, L, continue: BreakContinue) = G, L, continue + E(G, L, <if condition body>: If) = + let G0, L0, v = E(G, L, condition) + if v is true: + E(G0, L0, body) + else: + G0, L0, regular E(G, L, <switch condition case l1:t1 st1 ... case ln:tn stn>: Switch) = - E(G, L, switch condition case l1:t1 st1 ... case ln:tn stn default {}) = + E(G, L, switch condition case l1:t1 st1 ... case ln:tn stn default {}) E(G, L, <switch condition case l1:t1 st1 ... case ln:tn stn default st'>: Switch) = let G0, L0, v = E(G, L, condition) // i = 1 .. n |