aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-04-27 20:09:39 +0800
committerGitHub <noreply@github.com>2017-04-27 20:09:39 +0800
commitabe77f48b621c55366012e7c0ddaa3f88535e0d7 (patch)
treed5300dd01e397c5afb8ab892181bc295fb12a3b0 /docs
parent2c1fb46bc341d9e44074af23cd4eadd3a9f732c5 (diff)
parent35f1cf92dbc6082b675e41e184aefe3b24325918 (diff)
downloaddexon-solidity-abe77f48b621c55366012e7c0ddaa3f88535e0d7.tar.gz
dexon-solidity-abe77f48b621c55366012e7c0ddaa3f88535e0d7.tar.zst
dexon-solidity-abe77f48b621c55366012e7c0ddaa3f88535e0d7.zip
Merge pull request #2184 from ethereum/julia-parentheses
Remove parentheses from around function return parameters
Diffstat (limited to 'docs')
-rw-r--r--docs/assembly.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/assembly.rst b/docs/assembly.rst
index eb1bf276..420cea17 100644
--- a/docs/assembly.rst
+++ b/docs/assembly.rst
@@ -29,7 +29,7 @@ arising when writing manual assembly by the following features:
* labels: ``let x := 10 repeat: x := sub(x, 1) jumpi(repeat, eq(x, 0))``
* loops: ``for { let i := 0 } lt(i, x) { i := add(i, 1) } { y := mul(2, y) }``
* switch statements: ``switch x case 0: { y := mul(x, 2) } default: { y := 0 }``
-* function calls: ``function f(x) -> (y) { switch x case 0: { y := 1 } default: { y := mul(x, f(sub(x, 1))) } }``
+* function calls: ``function f(x) -> y { switch x case 0: { y := 1 } default: { y := mul(x, f(sub(x, 1))) } }``
.. note::
Of the above, loops, function calls and switch statements are not yet implemented.
@@ -566,7 +566,7 @@ The following example implements the power function by square-and-multiply.
.. code::
assembly {
- function power(base, exponent) -> (result) {
+ function power(base, exponent) -> result {
switch exponent
0: { result := 1 }
1: { result := base }
@@ -701,12 +701,12 @@ The following assembly will be generated::
}
default: { jump(invalidJumpLabel) }
// memory allocator
- function $allocate(size) -> (pos) {
+ function $allocate(size) -> pos {
pos := mload(0x40)
mstore(0x40, add(pos, size))
}
// the contract function
- function f(x) -> (y) {
+ function f(x) -> y {
y := 1
for { let i := 0 } lt(i, x) { i := add(i, 1) } {
y := mul(2, y)