mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #10583 from ethereum/fix-doc-pragma-checks
Fix checks for code snippets embedded in docs
This commit is contained in:
commit
e37e3099aa
@ -30,7 +30,7 @@ Not all types for constants and immutables are implemented at this time. The onl
|
|||||||
::
|
::
|
||||||
|
|
||||||
// SPDX-License-Identifier: GPL-3.0
|
// SPDX-License-Identifier: GPL-3.0
|
||||||
pragma solidity >0.7.2;
|
pragma solidity >=0.7.4;
|
||||||
|
|
||||||
uint constant X = 32**22 + 8;
|
uint constant X = 32**22 + 8;
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ registering with a username and password, all you need is an Ethereum keypair.
|
|||||||
::
|
::
|
||||||
|
|
||||||
// SPDX-License-Identifier: GPL-3.0
|
// SPDX-License-Identifier: GPL-3.0
|
||||||
pragma solidity >0.5.99 <0.8.0;
|
pragma solidity >=0.7.0 <0.8.0;
|
||||||
|
|
||||||
contract Coin {
|
contract Coin {
|
||||||
// The keyword "public" makes variables
|
// The keyword "public" makes variables
|
||||||
|
@ -49,7 +49,7 @@ The following example shows a contract and a function using all available tags.
|
|||||||
.. code:: Solidity
|
.. code:: Solidity
|
||||||
|
|
||||||
// SPDX-License-Identifier: GPL-3.0
|
// SPDX-License-Identifier: GPL-3.0
|
||||||
pragma solidity >0.6.10 <0.8.0;
|
pragma solidity >=0.6.12 <0.8.0;
|
||||||
|
|
||||||
/// @title A simulator for trees
|
/// @title A simulator for trees
|
||||||
/// @author Larry A. Gardner
|
/// @author Larry A. Gardner
|
||||||
|
@ -1071,6 +1071,10 @@ No::
|
|||||||
|
|
||||||
and in ``Congress.sol``::
|
and in ``Congress.sol``::
|
||||||
|
|
||||||
|
// SPDX-License-Identifier: GPL-3.0
|
||||||
|
pragma solidity ^0.7.0;
|
||||||
|
|
||||||
|
|
||||||
import "./owned.sol";
|
import "./owned.sol";
|
||||||
|
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ individual elements:
|
|||||||
::
|
::
|
||||||
|
|
||||||
// SPDX-License-Identifier: GPL-3.0
|
// SPDX-License-Identifier: GPL-3.0
|
||||||
pragma solidity >=0.4.0 <0.8.0;
|
pragma solidity >=0.4.16 <0.8.0;
|
||||||
|
|
||||||
contract C {
|
contract C {
|
||||||
function f() public pure {
|
function f() public pure {
|
||||||
|
@ -70,7 +70,7 @@ function compileFull()
|
|||||||
printError "Was failure: $exit_code"
|
printError "Was failure: $exit_code"
|
||||||
echo "$errors"
|
echo "$errors"
|
||||||
printError "While calling:"
|
printError "While calling:"
|
||||||
echo "\"$SOLC\" $ARGS $files"
|
echo "\"$SOLC\" $args $files"
|
||||||
printError "Inside directory:"
|
printError "Inside directory:"
|
||||||
pwd
|
pwd
|
||||||
false
|
false
|
||||||
|
@ -65,7 +65,7 @@ function getAllAvailableVersions()
|
|||||||
{
|
{
|
||||||
allVersions=()
|
allVersions=()
|
||||||
local allListedVersions=( $(
|
local allListedVersions=( $(
|
||||||
wget -q -O- https://ethereum.github.io/solc-bin/bin/list.txt |
|
wget -q -O- https://binaries.soliditylang.org/bin/list.txt |
|
||||||
grep -Po '(?<=soljson-v)\d+.\d+.\d+(?=\+commit)' |
|
grep -Po '(?<=soljson-v)\d+.\d+.\d+(?=\+commit)' |
|
||||||
sort -V
|
sort -V
|
||||||
) )
|
) )
|
||||||
@ -108,7 +108,7 @@ function findMinimalVersion()
|
|||||||
do
|
do
|
||||||
if versionGreater "$ver" "$pragmaVersion"
|
if versionGreater "$ver" "$pragmaVersion"
|
||||||
then
|
then
|
||||||
minVersion="$ver"
|
version="$ver"
|
||||||
break
|
break
|
||||||
elif ([ $greater == false ]) && versionEqual "$ver" "$pragmaVersion"
|
elif ([ $greater == false ]) && versionEqual "$ver" "$pragmaVersion"
|
||||||
then
|
then
|
||||||
@ -117,9 +117,10 @@ function findMinimalVersion()
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -z version ]
|
if [ -z "$version" ]
|
||||||
then
|
then
|
||||||
printError "No release $sign$pragmaVersion was listed in available releases!"
|
printError "No release $sign$pragmaVersion was listed in available releases!"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user