Skip to content

Commit

Permalink
[Docs] Add LityLexer
Browse files Browse the repository at this point in the history
  • Loading branch information
sifmelcara authored and hydai committed Dec 16, 2018
1 parent d5482ca commit c45c2ad
Show file tree
Hide file tree
Showing 13 changed files with 307 additions and 60 deletions.
11 changes: 8 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import os
import sys

def setup(sphinx):
thisdir = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, thisdir + '/utils')
from LityLexer import LityLexer
sphinx.add_lexer('Lity', LityLexer())

# -- Project information -----------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/eni-tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Use ENI in Your Contract

Create a contract file called `Reverse.lity`.

.. code::
.. code-block:: Lity
pragma lity ^1.2.4;
Expand Down
20 changes: 10 additions & 10 deletions docs/erc-contract-checker-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Examples

- ERC20 Interface (erc20_interface.sol)

.. code:: ts
.. code-block:: Lity
pragma lity ^1.2.4;
Expand Down Expand Up @@ -52,7 +52,7 @@ Examples
- ERC20 Interface with wrong mutability (wrong_mutability.sol)
.. code:: ts
.. code-block:: Lity
pragma lity ^1.2.4;
Expand Down Expand Up @@ -96,7 +96,7 @@ Examples
- ERC223 Interface (erc223_interface.sol)
.. code:: ts
.. code-block:: Lity
pragma lity ^1.2.4;
Expand All @@ -123,7 +123,7 @@ Examples
- ERC223 Token example (erc223_token.sol)
.. code:: ts
.. code-block:: Lity
pragma lity ^1.2.4;
Expand Down Expand Up @@ -279,7 +279,7 @@ Examples
- ERC721 Interface (erc721_interface.sol)
.. code:: ts
.. code-block:: Lity
pragma lity ^1.2.4;
Expand Down Expand Up @@ -314,7 +314,7 @@ Examples
- ERC721 Interface with wrong modification level (wrong_modification_level.sol)
.. code:: ts
.. code-block:: Lity
pragma lity ^1.2.4;
Expand Down Expand Up @@ -362,7 +362,7 @@ Examples
- ERC827 Interface (erc827_standard_no_inheritance.sol)
.. code:: ts
.. code-block:: Lity
pragma lity ^1.2.4;
Expand Down Expand Up @@ -394,7 +394,7 @@ Examples
- ERC827 Interface inheritance (erc827_inheritance.sol)
.. code:: ts
.. code-block:: Lity
pragma lity ^1.2.4;
Expand Down Expand Up @@ -444,7 +444,7 @@ Examples
- ERC884 Interface (erc884_interface.sol)
.. code:: ts
.. code-block:: Lity
pragma lity ^1.2.4;
Expand Down Expand Up @@ -496,7 +496,7 @@ Examples
- ERC884 Interface with missing function (missing_function.sol)
.. code:: ts
.. code-block:: Lity
pragma lity ^1.2.4;
Expand Down
4 changes: 2 additions & 2 deletions docs/overflow-protection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ This example shows how Lity and CyberMiles Virtual Machine helps users to avoid
Run a CyberMiles Local Node
```````````````````````````

Follow the instructions here to have a `running CyberMiles local node to deploy a contract <https://www.litylang.org/getting_started/>`_.
Follow the instructions here to have a `running CyberMiles local node to deploy a contract <https://www.litylang.org/getting_started/>`_.

Compile BEC Contract
````````````````````

There is an overflow issue at this statement :code:`uint256 amount = uint256(cnt) * _value;` of the function :code:`batchTransfer` .

.. code::
.. code-block:: Lity
pragma lity ^1.2.4;
Expand Down
8 changes: 4 additions & 4 deletions docs/oyente-integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@ Installation

Execute a python virtualenv

.. code::
.. code:: bash
virtualenv -p python3 env
source env/bin/activate
Download Oyente

.. code::
.. code:: bash
git clone https://github.com/CyberMiles/oyente.git
cd oyente
Install Oyente requirements

.. code::
.. code:: bash
pip install -r requirements.txt
Install Oyente

.. code::
.. code:: bash
pip install .
Expand Down
2 changes: 1 addition & 1 deletion docs/reverse-string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Compiler StringReverse Contract

There is a simple contract that leverage ENI to reverse a string.

.. code::
.. code-block:: Lity
pragma lity ^1.2.4;
contract StringReverse {
Expand Down
2 changes: 1 addition & 1 deletion docs/rsa-crypto.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Compiler RSACrypto Contract

There is a simple contract that leverage ENI to do RSA encrypt / decrypt.

.. code::
.. code-block:: Lity
pragma lity ^1.2.4;
Expand Down

0 comments on commit c45c2ad

Please sign in to comment.