mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
isolate_tests.py: Parse Sphinx block parameters correctly
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
Some text
|
||||
|
||||
|
||||
.. code-block:: solidity
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract C {
|
||||
function foo() public view {}
|
||||
}
|
||||
|
||||
|
||||
.. warning::
|
||||
|
||||
A Warning.
|
||||
|
||||
::
|
||||
|
||||
contract C {}
|
||||
|
||||
More text.
|
||||
@@ -0,0 +1,48 @@
|
||||
A normal block with parameters.
|
||||
|
||||
.. code-block:: solidity
|
||||
:force:
|
||||
:language: Solidity
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract C {
|
||||
function foo() public view {}
|
||||
}
|
||||
|
||||
|
||||
.. warning::
|
||||
A Warning.
|
||||
|
||||
.. code-block:: solidity
|
||||
|
||||
uint constant x = 42;
|
||||
|
||||
Text.
|
||||
|
||||
::
|
||||
|
||||
contract C {}
|
||||
|
||||
A block with blank lines between block parameters.
|
||||
Sphinx will treat the second one as a part of the code.
|
||||
|
||||
.. code-block:: solidity
|
||||
:force:
|
||||
|
||||
:language: Solidity
|
||||
|
||||
contract D {}
|
||||
:linenos:
|
||||
|
||||
Block with parameters indented less than code.
|
||||
Sphinx does not complain about these.
|
||||
|
||||
.. code-block:: solidity
|
||||
:force:
|
||||
:linenos:
|
||||
|
||||
contract E {}
|
||||
|
||||
More text.
|
||||
Reference in New Issue
Block a user