isolate_tests.py: Parse Sphinx block parameters correctly

This commit is contained in:
Kamil Śliwak
2021-06-21 20:54:12 +02:00
parent a96114b3c5
commit 0311b955c2
4 changed files with 152 additions and 5 deletions
+22
View File
@@ -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.