diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-06-23 05:17:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-23 05:17:26 +0800 |
commit | 08a5d144ace9392b31a33fd2f051feb7777b93be (patch) | |
tree | 1027e4f28d74d9f6f9108c8a9e08a1cc4568beae /docs | |
parent | bffb8c404f0df22c4da7cdc2a8affcbb77377582 (diff) | |
parent | e58cff3f37602db61ab9e70820367a5aff14f1b8 (diff) | |
download | dexon-solidity-08a5d144ace9392b31a33fd2f051feb7777b93be.tar.gz dexon-solidity-08a5d144ace9392b31a33fd2f051feb7777b93be.tar.zst dexon-solidity-08a5d144ace9392b31a33fd2f051feb7777b93be.zip |
Merge pull request #2426 from ethereum/miniMoustache
Whiskers template system
Diffstat (limited to 'docs')
-rw-r--r-- | docs/assembly.rst | 2 | ||||
-rw-r--r-- | docs/contributing.rst | 19 |
2 files changed, 21 insertions, 0 deletions
diff --git a/docs/assembly.rst b/docs/assembly.rst index 7ef41483..83643634 100644 --- a/docs/assembly.rst +++ b/docs/assembly.rst @@ -13,6 +13,8 @@ TODO: Write about how scoping rules of inline assembly are a bit different and the complications that arise when for example using internal functions of libraries. Furthermore, write about the symbols defined by the compiler. +.. _inline-assembly: + Inline Assembly =============== diff --git a/docs/contributing.rst b/docs/contributing.rst index 1f869dbb..559f9f6a 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -74,3 +74,22 @@ To run a subset of tests, filters can be used: ``soltest -t TestSuite/TestName -- --ipcpath /tmp/testeth/geth.ipc``, where ``TestName`` can be a wildcard ``*``. Alternatively, there is a testing script at ``scripts/test.sh`` which executes all tests. + +Whiskers +======== + +*Whiskers* is a templating system similar to `Moustache <https://mustache.github.io>`_. It is used by the +compiler in various places to aid readability, and thus maintainability and verifiability, of the code. + +The syntax comes with a substantial difference to Moustache: the template markers ``{{`` and ``}}`` are +replaced by ``<`` and ``>`` in order to aid parsing and avoid conflicts with :ref:`inline-assembly` +(The symbols ``<`` and ``>`` are invalid in inline assembly, while ``{`` and ``}`` are used to delimit blocks). +Another limitation is that lists are only resolved one depth and they will not recurse. This may change in the future. + +A rough specification is the following: + +Any occurrence of ``<name>`` is replaced by the string-value of the supplied variable ``name`` without any +escaping and without iterated replacements. An area can be delimited by ``<#name>...</name>``. It is replaced +by as many concatenations of its contents as there were sets of variables supplied to the template system, +each time replacing any ``<inner>`` items by their respective value. Top-level variales can also be used +inside such areas.
\ No newline at end of file |