aboutsummaryrefslogtreecommitdiffstats
path: root/docs/control-structures.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/control-structures.rst')
-rw-r--r--docs/control-structures.rst14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/control-structures.rst b/docs/control-structures.rst
index 0e430b6b..a5ae079a 100644
--- a/docs/control-structures.rst
+++ b/docs/control-structures.rst
@@ -98,6 +98,8 @@ parameters from the function declaration, but can be in arbitrary order.
::
+ pragma solidity ^0.4.0;
+
contract C {
function f(uint key, uint value) { ... }
@@ -115,6 +117,8 @@ Those names will still be present on the stack, but they are inaccessible.
::
+ pragma solidity ^0.4.0;
+
contract C {
// omitted name for parameter
function func(uint k, uint) returns(uint) {
@@ -136,6 +140,8 @@ creation-dependencies are now possible.
::
+ pragma solidity ^0.4.0;
+
contract D {
uint x;
function D(uint a) {
@@ -343,6 +349,8 @@ idea is that assembly libraries will be used to enhance the language in such way
.. code::
+ pragma solidity ^0.4.0;
+
library GetCode {
function at(address _addr) returns (bytes o_code) {
assembly {
@@ -368,6 +376,8 @@ you really know what you are doing.
.. code::
+ pragma solidity ^0.4.0;
+
library VectorSum {
// This function is less efficient because the optimizer currently fails to
// remove the bounds checks in array access.
@@ -622,6 +632,8 @@ It is planned that the stack height changes can be specified in inline assembly.
.. code::
+ pragma solidity ^0.4.0;
+
contract C {
uint b;
function f(uint x) returns (uint r) {
@@ -696,6 +708,8 @@ be just ``0``, but it can also be a complex functional-style expression.
.. code::
+ pragma solidity ^0.4.0;
+
contract C {
function f(uint x) returns (uint b) {
assembly {