forked from ethereum/solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ethereum#14323 from ethereum/stop-after-parsing-di…
…sallow-outputs-that-require-analysis Disallow `--stop-after parsing` with CLI outputs that require analysis
- Loading branch information
Showing
22 changed files
with
215 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
test/cmdlineTests/standard_stop_after_parsing_ast_requested/args
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--allow-paths . |
6 changes: 6 additions & 0 deletions
6
test/cmdlineTests/standard_stop_after_parsing_ast_requested/in.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity *; | ||
|
||
import "A"; | ||
|
||
contract C {} |
12 changes: 12 additions & 0 deletions
12
test/cmdlineTests/standard_stop_after_parsing_ast_requested/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"language": "Solidity", | ||
"sources": { | ||
"C": {"urls": ["standard_stop_after_parsing_ast_requested/in.sol"]} | ||
}, | ||
"settings": { | ||
"stopAfter": "parsing", | ||
"outputSelection": { | ||
"*": {"": ["ast"]} | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
test/cmdlineTests/standard_stop_after_parsing_ast_requested/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"sources": | ||
{ | ||
"C": | ||
{ | ||
"ast": | ||
{ | ||
"absolutePath": "C", | ||
"id": 4, | ||
"license": "GPL-3.0", | ||
"nodeType": "SourceUnit", | ||
"nodes": | ||
[ | ||
{ | ||
"id": 1, | ||
"literals": | ||
[ | ||
"solidity", | ||
"*" | ||
], | ||
"nodeType": "PragmaDirective", | ||
"src": "36:18:0" | ||
}, | ||
{ | ||
"absolutePath": "A", | ||
"file": "A", | ||
"id": 2, | ||
"nameLocation": "-1:-1:-1", | ||
"nodeType": "ImportDirective", | ||
"src": "56:11:0", | ||
"symbolAliases": [], | ||
"unitAlias": "" | ||
}, | ||
{ | ||
"abstract": false, | ||
"baseContracts": [], | ||
"contractDependencies": [], | ||
"contractKind": "contract", | ||
"id": 3, | ||
"name": "C", | ||
"nameLocation": "78:1:0", | ||
"nodeType": "ContractDefinition", | ||
"nodes": [], | ||
"src": "69:13:0", | ||
"usedErrors": [], | ||
"usedEvents": [] | ||
} | ||
], | ||
"src": "36:47:0" | ||
}, | ||
"id": 0 | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
test/cmdlineTests/standard_stop_after_parsing_bytecode_requested/args
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--allow-paths . |
6 changes: 6 additions & 0 deletions
6
test/cmdlineTests/standard_stop_after_parsing_bytecode_requested/in.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity *; | ||
|
||
import "A"; | ||
|
||
contract C {} |
12 changes: 12 additions & 0 deletions
12
test/cmdlineTests/standard_stop_after_parsing_bytecode_requested/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"language": "Solidity", | ||
"sources": { | ||
"C": {"urls": ["standard_stop_after_parsing_bytecode_requested/in.sol"]} | ||
}, | ||
"settings": { | ||
"stopAfter": "parsing", | ||
"outputSelection": { | ||
"*": {"*": ["evm.bytecode.object"]} | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
test/cmdlineTests/standard_stop_after_parsing_bytecode_requested/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"errors": | ||
[ | ||
{ | ||
"component": "general", | ||
"formattedMessage": "Requested output selection conflicts with \"settings.stopAfter\".", | ||
"message": "Requested output selection conflicts with \"settings.stopAfter\".", | ||
"severity": "error", | ||
"type": "JSONError" | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
test/cmdlineTests/standard_stop_after_parsing_non_binary_output_requested/args
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--allow-paths . |
8 changes: 8 additions & 0 deletions
8
test/cmdlineTests/standard_stop_after_parsing_non_binary_output_requested/in.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity *; | ||
|
||
import "A"; | ||
|
||
contract C { | ||
function f() public {} | ||
} |
19 changes: 19 additions & 0 deletions
19
test/cmdlineTests/standard_stop_after_parsing_non_binary_output_requested/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"language": "Solidity", | ||
"sources": { | ||
"C": {"urls": ["standard_stop_after_parsing_non_binary_output_requested/in.sol"]} | ||
}, | ||
"settings": { | ||
"stopAfter": "parsing", | ||
"outputSelection": { | ||
"*": {"*": [ | ||
"abi", | ||
"devdoc", | ||
"userdoc", | ||
"metadata", | ||
"storageLayout", | ||
"evm.methodIdentifiers" | ||
]} | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
test/cmdlineTests/standard_stop_after_parsing_non_binary_output_requested/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"sources": | ||
{ | ||
"C": | ||
{ | ||
"id": 0 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--pretty-json --json-indent 4 --stop-after parsing --abi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The following options are mutually exclusive: --stop-after, --abi. Select at most one. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity *; | ||
|
||
import "A"; | ||
|
||
contract C { | ||
function f() public {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--pretty-json --json-indent 4 --stop-after parsing --ast-compact-json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity *; | ||
|
||
import "A"; | ||
|
||
contract C {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
JSON AST (compact format): | ||
|
||
|
||
======= stop_after_parsing_ast/input.sol ======= | ||
{ | ||
"absolutePath": "stop_after_parsing_ast/input.sol", | ||
"id": 4, | ||
"license": "GPL-3.0", | ||
"nodeType": "SourceUnit", | ||
"nodes": | ||
[ | ||
{ | ||
"id": 1, | ||
"literals": | ||
[ | ||
"solidity", | ||
"*" | ||
], | ||
"nodeType": "PragmaDirective", | ||
"src": "36:18:0" | ||
}, | ||
{ | ||
"absolutePath": "A", | ||
"file": "A", | ||
"id": 2, | ||
"nameLocation": "-1:-1:-1", | ||
"nodeType": "ImportDirective", | ||
"src": "56:11:0", | ||
"symbolAliases": [], | ||
"unitAlias": "" | ||
}, | ||
{ | ||
"abstract": false, | ||
"baseContracts": [], | ||
"contractDependencies": [], | ||
"contractKind": "contract", | ||
"id": 3, | ||
"name": "C", | ||
"nameLocation": "78:1:0", | ||
"nodeType": "ContractDefinition", | ||
"nodes": [], | ||
"src": "69:13:0", | ||
"usedErrors": [], | ||
"usedEvents": [] | ||
} | ||
], | ||
"src": "36:47:0" | ||
} |