Enhancing all the .rst doc files by adding highlighting for the code snippets, including the following langs:
1. Solidity

2. bash

3. javascript

4. assembly
This commit is contained in:
iskanderandrews
2021-06-25 12:33:55 +02:00
parent cbf1c3ae69
commit a8e9d7a80d
37 changed files with 433 additions and 245 deletions
+5 -3
View File
@@ -39,7 +39,7 @@ load it into a ``bytes`` variable. This is not possible with "plain Solidity" an
idea is that reusable assembly libraries can enhance the Solidity language
without a compiler change.
.. code::
.. code-block:: solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.16 <0.9.0;
@@ -65,7 +65,7 @@ without a compiler change.
Inline assembly is also beneficial in cases where the optimizer fails to produce
efficient code, for example:
.. code::
.. code-block:: solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.16 <0.9.0;
@@ -217,7 +217,9 @@ starting from where this pointer points at and update it.
There is no guarantee that the memory has not been used before and thus
you cannot assume that its contents are zero bytes.
There is no built-in mechanism to release or free allocated memory.
Here is an assembly snippet you can use for allocating memory that follows the process outlined above::
Here is an assembly snippet you can use for allocating memory that follows the process outlined above
.. code-block:: yul
function allocate(length) -> pos {
pos := mload(0x40)