Introduce solidity-next pragma

Exclude pragma experimental error from ANTLR tests

Test for first pragma after non-pragma declaration

Resolve import pragmas

Change pragma name from next to solidity

Add Changelog entries

Address review comments
This commit is contained in:
Nikola Matic
2023-05-15 19:25:13 +02:00
parent 9804085934
commit 8a41f4ac7e
18 changed files with 163 additions and 14 deletions
@@ -0,0 +1,3 @@
pragma experimental solidity;
// ----
// Warning 2264: (0-29): Experimental features are turned on. Do not use experimental features on live deployments.
@@ -0,0 +1,24 @@
==== Source: A.sol ====
contract A {}
==== Source: B.sol ====
pragma experimental solidity;
import "A.sol";
contract B {
A a;
}
==== Source: C.sol ====
pragma experimental solidity;
import "A.sol";
contract C {
A a;
}
==== Source: D.sol ====
pragma experimental solidity;
import "A.sol";
contract D {
A a;
}
// ----
// ParserError 2141: (B.sol:0-29): File declares "pragma experimental solidity". If you want to enable the experimental mode, all source units must include the pragma.
// ParserError 2141: (C.sol:0-29): File declares "pragma experimental solidity". If you want to enable the experimental mode, all source units must include the pragma.
// ParserError 2141: (D.sol:0-29): File declares "pragma experimental solidity". If you want to enable the experimental mode, all source units must include the pragma.
@@ -0,0 +1,5 @@
contract A {}
pragma experimental solidity;
// ----
// ParserError 8185: (45-45): Experimental pragma "solidity" can only be set at the beginning of the source unit.
@@ -0,0 +1,13 @@
function f() pure returns (uint)
{
return 1;
}
pragma experimental solidity;
struct A
{
uint256 x;
}
// ----
// ParserError 8185: (83-89): Experimental pragma "solidity" can only be set at the beginning of the source unit.