From dd3beeadf13e8b77154feaf4faef7c99a6cbaadf Mon Sep 17 00:00:00 2001 From: Chris Chinchilla Date: Wed, 2 Oct 2019 14:35:08 +0200 Subject: [PATCH 1/4] Rephrase sentence of example explanation --- docs/common-patterns.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/common-patterns.rst b/docs/common-patterns.rst index 494f22dd4..ed87666d9 100644 --- a/docs/common-patterns.rst +++ b/docs/common-patterns.rst @@ -22,9 +22,8 @@ a contract where the goal is to send the most money to the contract in order to become the "richest", inspired by `King of the Ether `_. -In the following contract, if you are usurped as the richest, -you will receive the funds of the person who has gone on to -become the new richest. +In the following contract, if you are no longer the richest, +you receive the funds of the person who is now the richest. :: From c823b3519e23714da55f2c6d807fdfe77e71f662 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Wed, 2 Oct 2019 17:25:10 +0200 Subject: [PATCH 2/4] Replace build source path in __FILE__ macros. --- cmake/EthCompilerSettings.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake index 7ffb45964..74a2e55f9 100644 --- a/cmake/EthCompilerSettings.cmake +++ b/cmake/EthCompilerSettings.cmake @@ -23,6 +23,9 @@ endif() eth_add_cxx_compiler_flag_if_supported(-Wimplicit-fallthrough) +# Prevent the path of the source directory from ending up in the binary via __FILE__ macros. +eth_add_cxx_compiler_flag_if_supported("-fmacro-prefix-map=${CMAKE_SOURCE_DIR}=/solidity") + if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")) # Enables all the warnings about constructions that some users consider questionable, # and that are easy to avoid. Also enable some extra warning flags that are not From 62a62555bc9b5cc9489984b70b7a7a426e520514 Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Mon, 30 Sep 2019 02:32:28 +0300 Subject: [PATCH 3/4] Remove trailing spaces from JSON output --- libsolidity/ast/ASTJsonConverter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp index 5424ee5bc..7834e4a37 100644 --- a/libsolidity/ast/ASTJsonConverter.cpp +++ b/libsolidity/ast/ASTJsonConverter.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -189,7 +190,7 @@ Json::Value ASTJsonConverter::inlineAssemblyIdentifierToJson(pair Date: Wed, 2 Oct 2019 22:31:12 +0200 Subject: [PATCH 4/4] Modify the expectation files in ASTJSON tests. --- test/libsolidity/ASTJSON/address_payable.json | 1116 +++++++-------- .../ASTJSON/address_payable_legacy.json | 1198 ++++++++--------- test/libsolidity/ASTJSON/array_type_name.json | 148 +- test/libsolidity/ASTJSON/array_type_name.sol | 2 + .../ASTJSON/array_type_name_legacy.json | 174 +-- test/libsolidity/ASTJSON/constructor.json | 136 +- test/libsolidity/ASTJSON/constructor.sol | 2 + .../ASTJSON/constructor_legacy.json | 216 +-- .../ASTJSON/contract_dep_order.json | 462 +++---- .../ASTJSON/contract_dep_order_legacy.json | 572 ++++---- test/libsolidity/ASTJSON/documentation.json | 348 ++--- test/libsolidity/ASTJSON/documentation.sol | 2 + .../ASTJSON/documentation_legacy.json | 350 ++--- test/libsolidity/ASTJSON/enum_value.json | 110 +- test/libsolidity/ASTJSON/enum_value.sol | 2 + .../ASTJSON/enum_value_legacy.json | 152 +-- .../libsolidity/ASTJSON/event_definition.json | 96 +- test/libsolidity/ASTJSON/event_definition.sol | 2 + .../ASTJSON/event_definition_legacy.json | 144 +- test/libsolidity/ASTJSON/fallback.json | 136 +- test/libsolidity/ASTJSON/fallback.sol | 2 + test/libsolidity/ASTJSON/fallback_legacy.json | 216 +-- .../libsolidity/ASTJSON/fallback_payable.json | 136 +- test/libsolidity/ASTJSON/fallback_payable.sol | 2 + .../ASTJSON/fallback_payable_legacy.json | 216 +-- test/libsolidity/ASTJSON/function_type.json | 444 +++--- .../ASTJSON/function_type_legacy.json | 528 ++++---- .../ASTJSON/inheritance_specifier.json | 156 +-- .../ASTJSON/inheritance_specifier_legacy.json | 206 +-- .../long_type_name_binary_operation.json | 346 ++--- .../long_type_name_binary_operation.sol | 2 + ...ong_type_name_binary_operation_legacy.json | 412 +++--- .../ASTJSON/long_type_name_identifier.json | 358 ++--- .../ASTJSON/long_type_name_identifier.sol | 2 + .../long_type_name_identifier_legacy.json | 436 +++--- .../ASTJSON/modifier_definition.json | 344 ++--- .../ASTJSON/modifier_definition.sol | 2 + .../ASTJSON/modifier_definition_legacy.json | 420 +++--- .../ASTJSON/modifier_invocation.json | 344 ++--- .../ASTJSON/modifier_invocation.sol | 2 + .../ASTJSON/modifier_invocation_legacy.json | 420 +++--- test/libsolidity/ASTJSON/non_utf8.json | 240 ++-- test/libsolidity/ASTJSON/non_utf8.sol | 2 + test/libsolidity/ASTJSON/non_utf8_legacy.json | 308 ++--- .../ASTJSON/placeholder_statement.json | 124 +- .../ASTJSON/placeholder_statement.sol | 2 + .../ASTJSON/placeholder_statement_legacy.json | 170 +-- test/libsolidity/ASTJSON/short_type_name.json | 248 ++-- test/libsolidity/ASTJSON/short_type_name.sol | 2 + .../ASTJSON/short_type_name_legacy.json | 322 ++--- .../ASTJSON/short_type_name_ref.json | 272 ++-- .../ASTJSON/short_type_name_ref.sol | 2 + .../ASTJSON/short_type_name_ref_legacy.json | 348 ++--- test/libsolidity/ASTJSON/smoke.json | 62 +- test/libsolidity/ASTJSON/smoke.sol | 2 + test/libsolidity/ASTJSON/smoke_legacy.json | 92 +- test/libsolidity/ASTJSON/source_location.json | 316 ++--- test/libsolidity/ASTJSON/source_location.sol | 2 + .../ASTJSON/source_location_legacy.json | 394 +++--- .../ASTJSON/using_for_directive.json | 170 +-- .../ASTJSON/using_for_directive.sol | 2 + .../ASTJSON/using_for_directive_legacy.json | 216 +-- 62 files changed, 6847 insertions(+), 6811 deletions(-) diff --git a/test/libsolidity/ASTJSON/address_payable.json b/test/libsolidity/ASTJSON/address_payable.json index c8b71628c..075aacda9 100644 --- a/test/libsolidity/ASTJSON/address_payable.json +++ b/test/libsolidity/ASTJSON/address_payable.json @@ -1,560 +1,560 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 37 - ] - }, - "id" : 38, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 37, - "linearizedBaseContracts" : - [ - 37 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "constant" : false, - "id" : 4, - "name" : "m", - "nodeType" : "VariableDeclaration", - "scope" : 37, - "src" : "17:44:1", - "stateVariable" : true, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_mapping$_t_address_$_t_address_payable_$", - "typeString" : "mapping(address => address payable)" - }, - "typeName" : - { - "id" : 3, - "keyType" : - { - "id" : 1, - "name" : "address", - "nodeType" : "ElementaryTypeName", - "src" : "25:7:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_address", - "typeString" : "address" - } - }, - "nodeType" : "Mapping", - "src" : "17:35:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_mapping$_t_address_$_t_address_payable_$", - "typeString" : "mapping(address => address payable)" - }, - "valueType" : - { - "id" : 2, - "name" : "address", - "nodeType" : "ElementaryTypeName", - "src" : "36:15:1", - "stateMutability" : "payable", - "typeDescriptions" : - { - "typeIdentifier" : "t_address_payable", - "typeString" : "address payable" - } - } - }, - "value" : null, - "visibility" : "public" - }, - { - "body" : - { - "id" : 35, - "nodeType" : "Block", - "src" : "134:122:1", - "statements" : - [ - { - "assignments" : - [ - 12 - ], - "declarations" : - [ - { - "constant" : false, - "id" : 12, - "name" : "a", - "nodeType" : "VariableDeclaration", - "scope" : 35, - "src" : "144:17:1", - "stateVariable" : false, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_address_payable", - "typeString" : "address payable" - }, - "typeName" : - { - "id" : 11, - "name" : "address", - "nodeType" : "ElementaryTypeName", - "src" : "144:15:1", - "stateMutability" : "payable", - "typeDescriptions" : - { - "typeIdentifier" : "t_address_payable", - "typeString" : "address payable" - } - }, - "value" : null, - "visibility" : "internal" - } - ], - "id" : 16, - "initialValue" : - { - "argumentTypes" : null, - "baseExpression" : - { - "argumentTypes" : null, - "id" : 13, - "name" : "m", - "nodeType" : "Identifier", - "overloadedDeclarations" : [], - "referencedDeclaration" : 4, - "src" : "164:1:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_mapping$_t_address_$_t_address_payable_$", - "typeString" : "mapping(address => address payable)" - } - }, - "id" : 15, - "indexExpression" : - { - "argumentTypes" : null, - "id" : 14, - "name" : "arg", - "nodeType" : "Identifier", - "overloadedDeclarations" : [], - "referencedDeclaration" : 6, - "src" : "166:3:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_address_payable", - "typeString" : "address payable" - } - }, - "isConstant" : false, - "isLValue" : true, - "isPure" : false, - "lValueRequested" : false, - "nodeType" : "IndexAccess", - "src" : "164:6:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_address_payable", - "typeString" : "address payable" - } - }, - "nodeType" : "VariableDeclarationStatement", - "src" : "144:26:1" - }, - { - "expression" : - { - "argumentTypes" : null, - "id" : 19, - "isConstant" : false, - "isLValue" : false, - "isPure" : false, - "lValueRequested" : false, - "leftHandSide" : - { - "argumentTypes" : null, - "id" : 17, - "name" : "r", - "nodeType" : "Identifier", - "overloadedDeclarations" : [], - "referencedDeclaration" : 9, - "src" : "180:1:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_address_payable", - "typeString" : "address payable" - } - }, - "nodeType" : "Assignment", - "operator" : "=", - "rightHandSide" : - { - "argumentTypes" : null, - "id" : 18, - "name" : "arg", - "nodeType" : "Identifier", - "overloadedDeclarations" : [], - "referencedDeclaration" : 6, - "src" : "184:3:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_address_payable", - "typeString" : "address payable" - } - }, - "src" : "180:7:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_address_payable", - "typeString" : "address payable" - } - }, - "id" : 20, - "nodeType" : "ExpressionStatement", - "src" : "180:7:1" - }, - { - "assignments" : - [ - 22 - ], - "declarations" : - [ - { - "constant" : false, - "id" : 22, - "name" : "c", - "nodeType" : "VariableDeclaration", - "scope" : 35, - "src" : "197:9:1", - "stateVariable" : false, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_address", - "typeString" : "address" - }, - "typeName" : - { - "id" : 21, - "name" : "address", - "nodeType" : "ElementaryTypeName", - "src" : "197:7:1", - "stateMutability" : "nonpayable", - "typeDescriptions" : - { - "typeIdentifier" : "t_address", - "typeString" : "address" - } - }, - "value" : null, - "visibility" : "internal" - } - ], - "id" : 26, - "initialValue" : - { - "argumentTypes" : null, - "arguments" : - [ - { - "argumentTypes" : null, - "id" : 24, - "name" : "this", - "nodeType" : "Identifier", - "overloadedDeclarations" : [], - "referencedDeclaration" : 66, - "src" : "217:4:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_contract$_C_$37", - "typeString" : "contract C" - } - } - ], - "expression" : - { - "argumentTypes" : - [ - { - "typeIdentifier" : "t_contract$_C_$37", - "typeString" : "contract C" - } - ], - "id" : 23, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "lValueRequested" : false, - "nodeType" : "ElementaryTypeNameExpression", - "src" : "209:7:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_type$_t_address_$", - "typeString" : "type(address)" - }, - "typeName" : "address" - }, - "id" : 25, - "isConstant" : false, - "isLValue" : false, - "isPure" : false, - "kind" : "typeConversion", - "lValueRequested" : false, - "names" : [], - "nodeType" : "FunctionCall", - "src" : "209:13:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_address", - "typeString" : "address" - } - }, - "nodeType" : "VariableDeclarationStatement", - "src" : "197:25:1" - }, - { - "expression" : - { - "argumentTypes" : null, - "id" : 33, - "isConstant" : false, - "isLValue" : false, - "isPure" : false, - "lValueRequested" : false, - "leftHandSide" : - { - "argumentTypes" : null, - "baseExpression" : - { - "argumentTypes" : null, - "id" : 27, - "name" : "m", - "nodeType" : "Identifier", - "overloadedDeclarations" : [], - "referencedDeclaration" : 4, - "src" : "232:1:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_mapping$_t_address_$_t_address_payable_$", - "typeString" : "mapping(address => address payable)" - } - }, - "id" : 29, - "indexExpression" : - { - "argumentTypes" : null, - "id" : 28, - "name" : "c", - "nodeType" : "Identifier", - "overloadedDeclarations" : [], - "referencedDeclaration" : 22, - "src" : "234:1:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_address", - "typeString" : "address" - } - }, - "isConstant" : false, - "isLValue" : true, - "isPure" : false, - "lValueRequested" : true, - "nodeType" : "IndexAccess", - "src" : "232:4:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_address_payable", - "typeString" : "address payable" - } - }, - "nodeType" : "Assignment", - "operator" : "=", - "rightHandSide" : - { - "argumentTypes" : null, - "arguments" : - [ - { - "argumentTypes" : null, - "hexValue" : "30", - "id" : 31, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "number", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "247:1:1", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : "t_rational_0_by_1", - "typeString" : "int_const 0" - }, - "value" : "0" - } - ], - "expression" : - { - "argumentTypes" : - [ - { - "typeIdentifier" : "t_rational_0_by_1", - "typeString" : "int_const 0" - } - ], - "id" : 30, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "lValueRequested" : false, - "nodeType" : "ElementaryTypeNameExpression", - "src" : "239:7:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_type$_t_address_$", - "typeString" : "type(address)" - }, - "typeName" : "address" - }, - "id" : 32, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "typeConversion", - "lValueRequested" : false, - "names" : [], - "nodeType" : "FunctionCall", - "src" : "239:10:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_address_payable", - "typeString" : "address payable" - } - }, - "src" : "232:17:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_address_payable", - "typeString" : "address payable" - } - }, - "id" : 34, - "nodeType" : "ExpressionStatement", - "src" : "232:17:1" - } - ] - }, - "documentation" : null, - "id" : 36, - "implemented" : true, - "kind" : "function", - "modifiers" : [], - "name" : "f", - "nodeType" : "FunctionDefinition", - "parameters" : - { - "id" : 7, - "nodeType" : "ParameterList", - "parameters" : - [ - { - "constant" : false, - "id" : 6, - "name" : "arg", - "nodeType" : "VariableDeclaration", - "scope" : 36, - "src" : "78:19:1", - "stateVariable" : false, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_address_payable", - "typeString" : "address payable" - }, - "typeName" : - { - "id" : 5, - "name" : "address", - "nodeType" : "ElementaryTypeName", - "src" : "78:15:1", - "stateMutability" : "payable", - "typeDescriptions" : - { - "typeIdentifier" : "t_address_payable", - "typeString" : "address payable" - } - }, - "value" : null, - "visibility" : "internal" - } - ], - "src" : "77:21:1" - }, - "returnParameters" : - { - "id" : 10, - "nodeType" : "ParameterList", - "parameters" : - [ - { - "constant" : false, - "id" : 9, - "name" : "r", - "nodeType" : "VariableDeclaration", - "scope" : 36, - "src" : "115:17:1", - "stateVariable" : false, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_address_payable", - "typeString" : "address payable" - }, - "typeName" : - { - "id" : 8, - "name" : "address", - "nodeType" : "ElementaryTypeName", - "src" : "115:15:1", - "stateMutability" : "payable", - "typeDescriptions" : - { - "typeIdentifier" : "t_address_payable", - "typeString" : "address payable" - } - }, - "value" : null, - "visibility" : "internal" - } - ], - "src" : "114:19:1" - }, - "scope" : 37, - "src" : "67:189:1", - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - } - ], - "scope" : 38, - "src" : "0:258:1" - } - ], - "src" : "0:259:1" + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 37 + ] + }, + "id": 38, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 37, + "linearizedBaseContracts": + [ + 37 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "constant": false, + "id": 4, + "name": "m", + "nodeType": "VariableDeclaration", + "scope": 37, + "src": "17:44:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_mapping$_t_address_$_t_address_payable_$", + "typeString": "mapping(address => address payable)" + }, + "typeName": + { + "id": 3, + "keyType": + { + "id": 1, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "25:7:1", + "typeDescriptions": + { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "17:35:1", + "typeDescriptions": + { + "typeIdentifier": "t_mapping$_t_address_$_t_address_payable_$", + "typeString": "mapping(address => address payable)" + }, + "valueType": + { + "id": 2, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "36:15:1", + "stateMutability": "payable", + "typeDescriptions": + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "body": + { + "id": 35, + "nodeType": "Block", + "src": "134:122:1", + "statements": + [ + { + "assignments": + [ + 12 + ], + "declarations": + [ + { + "constant": false, + "id": 12, + "name": "a", + "nodeType": "VariableDeclaration", + "scope": 35, + "src": "144:17:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + "typeName": + { + "id": 11, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "144:15:1", + "stateMutability": "payable", + "typeDescriptions": + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 16, + "initialValue": + { + "argumentTypes": null, + "baseExpression": + { + "argumentTypes": null, + "id": 13, + "name": "m", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4, + "src": "164:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_mapping$_t_address_$_t_address_payable_$", + "typeString": "mapping(address => address payable)" + } + }, + "id": 15, + "indexExpression": + { + "argumentTypes": null, + "id": 14, + "name": "arg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6, + "src": "166:3:1", + "typeDescriptions": + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "164:6:1", + "typeDescriptions": + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "144:26:1" + }, + { + "expression": + { + "argumentTypes": null, + "id": 19, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": + { + "argumentTypes": null, + "id": 17, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9, + "src": "180:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": + { + "argumentTypes": null, + "id": 18, + "name": "arg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6, + "src": "184:3:1", + "typeDescriptions": + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "180:7:1", + "typeDescriptions": + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "id": 20, + "nodeType": "ExpressionStatement", + "src": "180:7:1" + }, + { + "assignments": + [ + 22 + ], + "declarations": + [ + { + "constant": false, + "id": 22, + "name": "c", + "nodeType": "VariableDeclaration", + "scope": 35, + "src": "197:9:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": + { + "id": 21, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "197:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": + { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 26, + "initialValue": + { + "argumentTypes": null, + "arguments": + [ + { + "argumentTypes": null, + "id": 24, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 66, + "src": "217:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$37", + "typeString": "contract C" + } + } + ], + "expression": + { + "argumentTypes": + [ + { + "typeIdentifier": "t_contract$_C_$37", + "typeString": "contract C" + } + ], + "id": 23, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "209:7:1", + "typeDescriptions": + { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 25, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "209:13:1", + "typeDescriptions": + { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "197:25:1" + }, + { + "expression": + { + "argumentTypes": null, + "id": 33, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": + { + "argumentTypes": null, + "baseExpression": + { + "argumentTypes": null, + "id": 27, + "name": "m", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4, + "src": "232:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_mapping$_t_address_$_t_address_payable_$", + "typeString": "mapping(address => address payable)" + } + }, + "id": 29, + "indexExpression": + { + "argumentTypes": null, + "id": 28, + "name": "c", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 22, + "src": "234:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "232:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": + { + "argumentTypes": null, + "arguments": + [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 31, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "247:1:1", + "subdenomination": null, + "typeDescriptions": + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": + { + "argumentTypes": + [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 30, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "239:7:1", + "typeDescriptions": + { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 32, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "239:10:1", + "typeDescriptions": + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "232:17:1", + "typeDescriptions": + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "id": 34, + "nodeType": "ExpressionStatement", + "src": "232:17:1" + } + ] + }, + "documentation": null, + "id": 36, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 7, + "nodeType": "ParameterList", + "parameters": + [ + { + "constant": false, + "id": 6, + "name": "arg", + "nodeType": "VariableDeclaration", + "scope": 36, + "src": "78:19:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + "typeName": + { + "id": 5, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "78:15:1", + "stateMutability": "payable", + "typeDescriptions": + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "77:21:1" + }, + "returnParameters": + { + "id": 10, + "nodeType": "ParameterList", + "parameters": + [ + { + "constant": false, + "id": 9, + "name": "r", + "nodeType": "VariableDeclaration", + "scope": 36, + "src": "115:17:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + "typeName": + { + "id": 8, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "115:15:1", + "stateMutability": "payable", + "typeDescriptions": + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "114:19:1" + }, + "scope": 37, + "src": "67:189:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 38, + "src": "0:258:1" + } + ], + "src": "0:259:1" } diff --git a/test/libsolidity/ASTJSON/address_payable_legacy.json b/test/libsolidity/ASTJSON/address_payable_legacy.json index 8abebce08..3e8c66616 100644 --- a/test/libsolidity/ASTJSON/address_payable_legacy.json +++ b/test/libsolidity/ASTJSON/address_payable_legacy.json @@ -1,601 +1,601 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 37 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 37 - ], - "name" : "C", - "scope" : 38 - }, - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "m", - "scope" : 37, - "stateVariable" : true, - "storageLocation" : "default", - "type" : "mapping(address => address payable)", - "value" : null, - "visibility" : "public" - }, - "children" : - [ - { - "attributes" : - { - "type" : "mapping(address => address payable)" - }, - "children" : - [ - { - "attributes" : - { - "name" : "address", - "type" : "address" - }, - "id" : 1, - "name" : "ElementaryTypeName", - "src" : "25:7:1" - }, - { - "attributes" : - { - "name" : "address", - "stateMutability" : "payable", - "type" : "address payable" - }, - "id" : 2, - "name" : "ElementaryTypeName", - "src" : "36:15:1" - } - ], - "id" : 3, - "name" : "Mapping", - "src" : "17:35:1" - } - ], - "id" : 4, - "name" : "VariableDeclaration", - "src" : "17:44:1" - }, - { - "attributes" : - { - "documentation" : null, - "implemented" : true, - "isConstructor" : false, - "kind" : "function", - "modifiers" : - [ - null - ], - "name" : "f", - "scope" : 37, - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - }, - "children" : - [ - { - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "arg", - "scope" : 36, - "stateVariable" : false, - "storageLocation" : "default", - "type" : "address payable", - "value" : null, - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "name" : "address", - "stateMutability" : "payable", - "type" : "address payable" - }, - "id" : 5, - "name" : "ElementaryTypeName", - "src" : "78:15:1" - } - ], - "id" : 6, - "name" : "VariableDeclaration", - "src" : "78:19:1" - } - ], - "id" : 7, - "name" : "ParameterList", - "src" : "77:21:1" - }, - { - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "r", - "scope" : 36, - "stateVariable" : false, - "storageLocation" : "default", - "type" : "address payable", - "value" : null, - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "name" : "address", - "stateMutability" : "payable", - "type" : "address payable" - }, - "id" : 8, - "name" : "ElementaryTypeName", - "src" : "115:15:1" - } - ], - "id" : 9, - "name" : "VariableDeclaration", - "src" : "115:17:1" - } - ], - "id" : 10, - "name" : "ParameterList", - "src" : "114:19:1" - }, - { - "children" : - [ - { - "attributes" : - { - "assignments" : - [ - 12 - ] - }, - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "a", - "scope" : 35, - "stateVariable" : false, - "storageLocation" : "default", - "type" : "address payable", - "value" : null, - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "name" : "address", - "stateMutability" : "payable", - "type" : "address payable" - }, - "id" : 11, - "name" : "ElementaryTypeName", - "src" : "144:15:1" - } - ], - "id" : 12, - "name" : "VariableDeclaration", - "src" : "144:17:1" - }, - { - "attributes" : - { - "argumentTypes" : null, - "isConstant" : false, - "isLValue" : true, - "isPure" : false, - "lValueRequested" : false, - "type" : "address payable" - }, - "children" : - [ - { - "attributes" : - { - "argumentTypes" : null, - "overloadedDeclarations" : - [ - null - ], - "referencedDeclaration" : 4, - "type" : "mapping(address => address payable)", - "value" : "m" - }, - "id" : 13, - "name" : "Identifier", - "src" : "164:1:1" - }, - { - "attributes" : - { - "argumentTypes" : null, - "overloadedDeclarations" : - [ - null - ], - "referencedDeclaration" : 6, - "type" : "address payable", - "value" : "arg" - }, - "id" : 14, - "name" : "Identifier", - "src" : "166:3:1" - } - ], - "id" : 15, - "name" : "IndexAccess", - "src" : "164:6:1" - } - ], - "id" : 16, - "name" : "VariableDeclarationStatement", - "src" : "144:26:1" - }, - { - "children" : - [ - { - "attributes" : - { - "argumentTypes" : null, - "isConstant" : false, - "isLValue" : false, - "isPure" : false, - "lValueRequested" : false, - "operator" : "=", - "type" : "address payable" - }, - "children" : - [ - { - "attributes" : - { - "argumentTypes" : null, - "overloadedDeclarations" : - [ - null - ], - "referencedDeclaration" : 9, - "type" : "address payable", - "value" : "r" - }, - "id" : 17, - "name" : "Identifier", - "src" : "180:1:1" - }, - { - "attributes" : - { - "argumentTypes" : null, - "overloadedDeclarations" : - [ - null - ], - "referencedDeclaration" : 6, - "type" : "address payable", - "value" : "arg" - }, - "id" : 18, - "name" : "Identifier", - "src" : "184:3:1" - } - ], - "id" : 19, - "name" : "Assignment", - "src" : "180:7:1" - } - ], - "id" : 20, - "name" : "ExpressionStatement", - "src" : "180:7:1" - }, - { - "attributes" : - { - "assignments" : - [ - 22 - ] - }, - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "c", - "scope" : 35, - "stateVariable" : false, - "storageLocation" : "default", - "type" : "address", - "value" : null, - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "name" : "address", - "stateMutability" : "nonpayable", - "type" : "address" - }, - "id" : 21, - "name" : "ElementaryTypeName", - "src" : "197:7:1" - } - ], - "id" : 22, - "name" : "VariableDeclaration", - "src" : "197:9:1" - }, - { - "attributes" : - { - "argumentTypes" : null, - "isConstant" : false, - "isLValue" : false, - "isPure" : false, - "isStructConstructorCall" : false, - "lValueRequested" : false, - "names" : - [ - null - ], - "type" : "address", - "type_conversion" : true - }, - "children" : - [ - { - "attributes" : - { - "argumentTypes" : - [ - { - "typeIdentifier" : "t_contract$_C_$37", - "typeString" : "contract C" - } - ], - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "lValueRequested" : false, - "type" : "type(address)", - "value" : "address" - }, - "id" : 23, - "name" : "ElementaryTypeNameExpression", - "src" : "209:7:1" - }, - { - "attributes" : - { - "argumentTypes" : null, - "overloadedDeclarations" : - [ - null - ], - "referencedDeclaration" : 66, - "type" : "contract C", - "value" : "this" - }, - "id" : 24, - "name" : "Identifier", - "src" : "217:4:1" - } - ], - "id" : 25, - "name" : "FunctionCall", - "src" : "209:13:1" - } - ], - "id" : 26, - "name" : "VariableDeclarationStatement", - "src" : "197:25:1" - }, - { - "children" : - [ - { - "attributes" : - { - "argumentTypes" : null, - "isConstant" : false, - "isLValue" : false, - "isPure" : false, - "lValueRequested" : false, - "operator" : "=", - "type" : "address payable" - }, - "children" : - [ - { - "attributes" : - { - "argumentTypes" : null, - "isConstant" : false, - "isLValue" : true, - "isPure" : false, - "lValueRequested" : true, - "type" : "address payable" - }, - "children" : - [ - { - "attributes" : - { - "argumentTypes" : null, - "overloadedDeclarations" : - [ - null - ], - "referencedDeclaration" : 4, - "type" : "mapping(address => address payable)", - "value" : "m" - }, - "id" : 27, - "name" : "Identifier", - "src" : "232:1:1" - }, - { - "attributes" : - { - "argumentTypes" : null, - "overloadedDeclarations" : - [ - null - ], - "referencedDeclaration" : 22, - "type" : "address", - "value" : "c" - }, - "id" : 28, - "name" : "Identifier", - "src" : "234:1:1" - } - ], - "id" : 29, - "name" : "IndexAccess", - "src" : "232:4:1" - }, - { - "attributes" : - { - "argumentTypes" : null, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "isStructConstructorCall" : false, - "lValueRequested" : false, - "names" : - [ - null - ], - "type" : "address payable", - "type_conversion" : true - }, - "children" : - [ - { - "attributes" : - { - "argumentTypes" : - [ - { - "typeIdentifier" : "t_rational_0_by_1", - "typeString" : "int_const 0" - } - ], - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "lValueRequested" : false, - "type" : "type(address)", - "value" : "address" - }, - "id" : 30, - "name" : "ElementaryTypeNameExpression", - "src" : "239:7:1" - }, - { - "attributes" : - { - "argumentTypes" : null, - "hexvalue" : "30", - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "lValueRequested" : false, - "subdenomination" : null, - "token" : "number", - "type" : "int_const 0", - "value" : "0" - }, - "id" : 31, - "name" : "Literal", - "src" : "247:1:1" - } - ], - "id" : 32, - "name" : "FunctionCall", - "src" : "239:10:1" - } - ], - "id" : 33, - "name" : "Assignment", - "src" : "232:17:1" - } - ], - "id" : 34, - "name" : "ExpressionStatement", - "src" : "232:17:1" - } - ], - "id" : 35, - "name" : "Block", - "src" : "134:122:1" - } - ], - "id" : 36, - "name" : "FunctionDefinition", - "src" : "67:189:1" - } - ], - "id" : 37, - "name" : "ContractDefinition", - "src" : "0:258:1" - } - ], - "id" : 38, - "name" : "SourceUnit", - "src" : "0:259:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 37 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 37 + ], + "name": "C", + "scope": 38 + }, + "children": + [ + { + "attributes": + { + "constant": false, + "name": "m", + "scope": 37, + "stateVariable": true, + "storageLocation": "default", + "type": "mapping(address => address payable)", + "value": null, + "visibility": "public" + }, + "children": + [ + { + "attributes": + { + "type": "mapping(address => address payable)" + }, + "children": + [ + { + "attributes": + { + "name": "address", + "type": "address" + }, + "id": 1, + "name": "ElementaryTypeName", + "src": "25:7:1" + }, + { + "attributes": + { + "name": "address", + "stateMutability": "payable", + "type": "address payable" + }, + "id": 2, + "name": "ElementaryTypeName", + "src": "36:15:1" + } + ], + "id": 3, + "name": "Mapping", + "src": "17:35:1" + } + ], + "id": 4, + "name": "VariableDeclaration", + "src": "17:44:1" + }, + { + "attributes": + { + "documentation": null, + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": + [ + null + ], + "name": "f", + "scope": 37, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": + [ + { + "children": + [ + { + "attributes": + { + "constant": false, + "name": "arg", + "scope": 36, + "stateVariable": false, + "storageLocation": "default", + "type": "address payable", + "value": null, + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "name": "address", + "stateMutability": "payable", + "type": "address payable" + }, + "id": 5, + "name": "ElementaryTypeName", + "src": "78:15:1" + } + ], + "id": 6, + "name": "VariableDeclaration", + "src": "78:19:1" + } + ], + "id": 7, + "name": "ParameterList", + "src": "77:21:1" + }, + { + "children": + [ + { + "attributes": + { + "constant": false, + "name": "r", + "scope": 36, + "stateVariable": false, + "storageLocation": "default", + "type": "address payable", + "value": null, + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "name": "address", + "stateMutability": "payable", + "type": "address payable" + }, + "id": 8, + "name": "ElementaryTypeName", + "src": "115:15:1" + } + ], + "id": 9, + "name": "VariableDeclaration", + "src": "115:17:1" + } + ], + "id": 10, + "name": "ParameterList", + "src": "114:19:1" + }, + { + "children": + [ + { + "attributes": + { + "assignments": + [ + 12 + ] + }, + "children": + [ + { + "attributes": + { + "constant": false, + "name": "a", + "scope": 35, + "stateVariable": false, + "storageLocation": "default", + "type": "address payable", + "value": null, + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "name": "address", + "stateMutability": "payable", + "type": "address payable" + }, + "id": 11, + "name": "ElementaryTypeName", + "src": "144:15:1" + } + ], + "id": 12, + "name": "VariableDeclaration", + "src": "144:17:1" + }, + { + "attributes": + { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "address payable" + }, + "children": + [ + { + "attributes": + { + "argumentTypes": null, + "overloadedDeclarations": + [ + null + ], + "referencedDeclaration": 4, + "type": "mapping(address => address payable)", + "value": "m" + }, + "id": 13, + "name": "Identifier", + "src": "164:1:1" + }, + { + "attributes": + { + "argumentTypes": null, + "overloadedDeclarations": + [ + null + ], + "referencedDeclaration": 6, + "type": "address payable", + "value": "arg" + }, + "id": 14, + "name": "Identifier", + "src": "166:3:1" + } + ], + "id": 15, + "name": "IndexAccess", + "src": "164:6:1" + } + ], + "id": 16, + "name": "VariableDeclarationStatement", + "src": "144:26:1" + }, + { + "children": + [ + { + "attributes": + { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "=", + "type": "address payable" + }, + "children": + [ + { + "attributes": + { + "argumentTypes": null, + "overloadedDeclarations": + [ + null + ], + "referencedDeclaration": 9, + "type": "address payable", + "value": "r" + }, + "id": 17, + "name": "Identifier", + "src": "180:1:1" + }, + { + "attributes": + { + "argumentTypes": null, + "overloadedDeclarations": + [ + null + ], + "referencedDeclaration": 6, + "type": "address payable", + "value": "arg" + }, + "id": 18, + "name": "Identifier", + "src": "184:3:1" + } + ], + "id": 19, + "name": "Assignment", + "src": "180:7:1" + } + ], + "id": 20, + "name": "ExpressionStatement", + "src": "180:7:1" + }, + { + "attributes": + { + "assignments": + [ + 22 + ] + }, + "children": + [ + { + "attributes": + { + "constant": false, + "name": "c", + "scope": 35, + "stateVariable": false, + "storageLocation": "default", + "type": "address", + "value": null, + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "name": "address", + "stateMutability": "nonpayable", + "type": "address" + }, + "id": 21, + "name": "ElementaryTypeName", + "src": "197:7:1" + } + ], + "id": 22, + "name": "VariableDeclaration", + "src": "197:9:1" + }, + { + "attributes": + { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": + [ + null + ], + "type": "address", + "type_conversion": true + }, + "children": + [ + { + "attributes": + { + "argumentTypes": + [ + { + "typeIdentifier": "t_contract$_C_$37", + "typeString": "contract C" + } + ], + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "type": "type(address)", + "value": "address" + }, + "id": 23, + "name": "ElementaryTypeNameExpression", + "src": "209:7:1" + }, + { + "attributes": + { + "argumentTypes": null, + "overloadedDeclarations": + [ + null + ], + "referencedDeclaration": 66, + "type": "contract C", + "value": "this" + }, + "id": 24, + "name": "Identifier", + "src": "217:4:1" + } + ], + "id": 25, + "name": "FunctionCall", + "src": "209:13:1" + } + ], + "id": 26, + "name": "VariableDeclarationStatement", + "src": "197:25:1" + }, + { + "children": + [ + { + "attributes": + { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "=", + "type": "address payable" + }, + "children": + [ + { + "attributes": + { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "type": "address payable" + }, + "children": + [ + { + "attributes": + { + "argumentTypes": null, + "overloadedDeclarations": + [ + null + ], + "referencedDeclaration": 4, + "type": "mapping(address => address payable)", + "value": "m" + }, + "id": 27, + "name": "Identifier", + "src": "232:1:1" + }, + { + "attributes": + { + "argumentTypes": null, + "overloadedDeclarations": + [ + null + ], + "referencedDeclaration": 22, + "type": "address", + "value": "c" + }, + "id": 28, + "name": "Identifier", + "src": "234:1:1" + } + ], + "id": 29, + "name": "IndexAccess", + "src": "232:4:1" + }, + { + "attributes": + { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": true, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": + [ + null + ], + "type": "address payable", + "type_conversion": true + }, + "children": + [ + { + "attributes": + { + "argumentTypes": + [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "type": "type(address)", + "value": "address" + }, + "id": 30, + "name": "ElementaryTypeNameExpression", + "src": "239:7:1" + }, + { + "attributes": + { + "argumentTypes": null, + "hexvalue": "30", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 0", + "value": "0" + }, + "id": 31, + "name": "Literal", + "src": "247:1:1" + } + ], + "id": 32, + "name": "FunctionCall", + "src": "239:10:1" + } + ], + "id": 33, + "name": "Assignment", + "src": "232:17:1" + } + ], + "id": 34, + "name": "ExpressionStatement", + "src": "232:17:1" + } + ], + "id": 35, + "name": "Block", + "src": "134:122:1" + } + ], + "id": 36, + "name": "FunctionDefinition", + "src": "67:189:1" + } + ], + "id": 37, + "name": "ContractDefinition", + "src": "0:258:1" + } + ], + "id": 38, + "name": "SourceUnit", + "src": "0:259:1" } diff --git a/test/libsolidity/ASTJSON/array_type_name.json b/test/libsolidity/ASTJSON/array_type_name.json index e3a3bea94..37802d1d4 100644 --- a/test/libsolidity/ASTJSON/array_type_name.json +++ b/test/libsolidity/ASTJSON/array_type_name.json @@ -1,76 +1,76 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 4 - ] - }, - "id" : 5, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 4, - "linearizedBaseContracts" : - [ - 4 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "constant" : false, - "id" : 3, - "name" : "i", - "nodeType" : "VariableDeclaration", - "scope" : 4, - "src" : "13:8:1", - "stateVariable" : true, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$dyn_storage", - "typeString" : "uint256[]" - }, - "typeName" : - { - "baseType" : - { - "id" : 1, - "name" : "uint", - "nodeType" : "ElementaryTypeName", - "src" : "13:4:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "id" : 2, - "length" : null, - "nodeType" : "ArrayTypeName", - "src" : "13:6:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$dyn_storage_ptr", - "typeString" : "uint256[]" - } - }, - "value" : null, - "visibility" : "internal" - } - ], - "scope" : 5, - "src" : "0:24:1" - } - ], - "src" : "0:25:1" + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 4 + ] + }, + "id": 5, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 4, + "linearizedBaseContracts": + [ + 4 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "constant": false, + "id": 3, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 4, + "src": "13:8:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[]" + }, + "typeName": + { + "baseType": + { + "id": 1, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2, + "length": null, + "nodeType": "ArrayTypeName", + "src": "13:6:1", + "typeDescriptions": + { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "scope": 5, + "src": "0:24:1" + } + ], + "src": "0:25:1" } diff --git a/test/libsolidity/ASTJSON/array_type_name.sol b/test/libsolidity/ASTJSON/array_type_name.sol index 202ecf02b..97ed03510 100644 --- a/test/libsolidity/ASTJSON/array_type_name.sol +++ b/test/libsolidity/ASTJSON/array_type_name.sol @@ -1 +1,3 @@ contract C { uint[] i; } + +// ---- diff --git a/test/libsolidity/ASTJSON/array_type_name_legacy.json b/test/libsolidity/ASTJSON/array_type_name_legacy.json index 80feb344b..eed4ecbdc 100644 --- a/test/libsolidity/ASTJSON/array_type_name_legacy.json +++ b/test/libsolidity/ASTJSON/array_type_name_legacy.json @@ -1,89 +1,89 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 4 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 4 - ], - "name" : "C", - "scope" : 5 - }, - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "i", - "scope" : 4, - "stateVariable" : true, - "storageLocation" : "default", - "type" : "uint256[]", - "value" : null, - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "length" : null, - "type" : "uint256[]" - }, - "children" : - [ - { - "attributes" : - { - "name" : "uint", - "type" : "uint256" - }, - "id" : 1, - "name" : "ElementaryTypeName", - "src" : "13:4:1" - } - ], - "id" : 2, - "name" : "ArrayTypeName", - "src" : "13:6:1" - } - ], - "id" : 3, - "name" : "VariableDeclaration", - "src" : "13:8:1" - } - ], - "id" : 4, - "name" : "ContractDefinition", - "src" : "0:24:1" - } - ], - "id" : 5, - "name" : "SourceUnit", - "src" : "0:25:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 4 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 4 + ], + "name": "C", + "scope": 5 + }, + "children": + [ + { + "attributes": + { + "constant": false, + "name": "i", + "scope": 4, + "stateVariable": true, + "storageLocation": "default", + "type": "uint256[]", + "value": null, + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "length": null, + "type": "uint256[]" + }, + "children": + [ + { + "attributes": + { + "name": "uint", + "type": "uint256" + }, + "id": 1, + "name": "ElementaryTypeName", + "src": "13:4:1" + } + ], + "id": 2, + "name": "ArrayTypeName", + "src": "13:6:1" + } + ], + "id": 3, + "name": "VariableDeclaration", + "src": "13:8:1" + } + ], + "id": 4, + "name": "ContractDefinition", + "src": "0:24:1" + } + ], + "id": 5, + "name": "SourceUnit", + "src": "0:25:1" } diff --git a/test/libsolidity/ASTJSON/constructor.json b/test/libsolidity/ASTJSON/constructor.json index b0bc42019..89ffa5fd3 100644 --- a/test/libsolidity/ASTJSON/constructor.json +++ b/test/libsolidity/ASTJSON/constructor.json @@ -1,70 +1,70 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 5 - ] - }, - "id" : 6, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 5, - "linearizedBaseContracts" : - [ - 5 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "body" : - { - "id" : 3, - "nodeType" : "Block", - "src" : "35:4:1", - "statements" : [] - }, - "documentation" : null, - "id" : 4, - "implemented" : true, - "kind" : "constructor", - "modifiers" : [], - "name" : "", - "nodeType" : "FunctionDefinition", - "parameters" : - { - "id" : 1, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "25:2:1" - }, - "returnParameters" : - { - "id" : 2, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "35:0:1" - }, - "scope" : 5, - "src" : "14:25:1", - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - } - ], - "scope" : 6, - "src" : "0:41:1" - } - ], - "src" : "0:42:1" + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 5 + ] + }, + "id": 6, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 5, + "linearizedBaseContracts": + [ + 5 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 3, + "nodeType": "Block", + "src": "35:4:1", + "statements": [] + }, + "documentation": null, + "id": 4, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "25:2:1" + }, + "returnParameters": + { + "id": 2, + "nodeType": "ParameterList", + "parameters": [], + "src": "35:0:1" + }, + "scope": 5, + "src": "14:25:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 6, + "src": "0:41:1" + } + ], + "src": "0:42:1" } diff --git a/test/libsolidity/ASTJSON/constructor.sol b/test/libsolidity/ASTJSON/constructor.sol index 79d04eb5a..f89ac45b4 100644 --- a/test/libsolidity/ASTJSON/constructor.sol +++ b/test/libsolidity/ASTJSON/constructor.sol @@ -2,3 +2,5 @@ contract C { constructor() public { } } + +// ---- diff --git a/test/libsolidity/ASTJSON/constructor_legacy.json b/test/libsolidity/ASTJSON/constructor_legacy.json index 0617073e3..fe89775a1 100644 --- a/test/libsolidity/ASTJSON/constructor_legacy.json +++ b/test/libsolidity/ASTJSON/constructor_legacy.json @@ -1,110 +1,110 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 5 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 5 - ], - "name" : "C", - "scope" : 6 - }, - "children" : - [ - { - "attributes" : - { - "documentation" : null, - "implemented" : true, - "isConstructor" : true, - "kind" : "constructor", - "modifiers" : - [ - null - ], - "name" : "", - "scope" : 5, - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 1, - "name" : "ParameterList", - "src" : "25:2:1" - }, - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 2, - "name" : "ParameterList", - "src" : "35:0:1" - }, - { - "attributes" : - { - "statements" : - [ - null - ] - }, - "children" : [], - "id" : 3, - "name" : "Block", - "src" : "35:4:1" - } - ], - "id" : 4, - "name" : "FunctionDefinition", - "src" : "14:25:1" - } - ], - "id" : 5, - "name" : "ContractDefinition", - "src" : "0:41:1" - } - ], - "id" : 6, - "name" : "SourceUnit", - "src" : "0:42:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 5 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 5 + ], + "name": "C", + "scope": 6 + }, + "children": + [ + { + "attributes": + { + "documentation": null, + "implemented": true, + "isConstructor": true, + "kind": "constructor", + "modifiers": + [ + null + ], + "name": "", + "scope": 5, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 1, + "name": "ParameterList", + "src": "25:2:1" + }, + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 2, + "name": "ParameterList", + "src": "35:0:1" + }, + { + "attributes": + { + "statements": + [ + null + ] + }, + "children": [], + "id": 3, + "name": "Block", + "src": "35:4:1" + } + ], + "id": 4, + "name": "FunctionDefinition", + "src": "14:25:1" + } + ], + "id": 5, + "name": "ContractDefinition", + "src": "0:41:1" + } + ], + "id": 6, + "name": "SourceUnit", + "src": "0:42:1" } diff --git a/test/libsolidity/ASTJSON/contract_dep_order.json b/test/libsolidity/ASTJSON/contract_dep_order.json index de42ca600..521ad93f1 100644 --- a/test/libsolidity/ASTJSON/contract_dep_order.json +++ b/test/libsolidity/ASTJSON/contract_dep_order.json @@ -1,233 +1,233 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "A" : - [ - 1 - ], - "B" : - [ - 4 - ], - "C" : - [ - 7 - ], - "D" : - [ - 10 - ], - "E" : - [ - 13 - ] - }, - "id" : 14, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 1, - "linearizedBaseContracts" : - [ - 1 - ], - "name" : "A", - "nodeType" : "ContractDefinition", - "nodes" : [], - "scope" : 14, - "src" : "0:14:1" - }, - { - "baseContracts" : - [ - { - "arguments" : null, - "baseName" : - { - "contractScope" : null, - "id" : 2, - "name" : "A", - "nodeType" : "UserDefinedTypeName", - "referencedDeclaration" : 1, - "src" : "29:1:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_contract$_A_$1", - "typeString" : "contract A" - } - }, - "id" : 3, - "nodeType" : "InheritanceSpecifier", - "src" : "29:1:1" - } - ], - "contractDependencies" : - [ - 1 - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 4, - "linearizedBaseContracts" : - [ - 4, - 1 - ], - "name" : "B", - "nodeType" : "ContractDefinition", - "nodes" : [], - "scope" : 14, - "src" : "15:19:1" - }, - { - "baseContracts" : - [ - { - "arguments" : null, - "baseName" : - { - "contractScope" : null, - "id" : 5, - "name" : "B", - "nodeType" : "UserDefinedTypeName", - "referencedDeclaration" : 4, - "src" : "49:1:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_contract$_B_$4", - "typeString" : "contract B" - } - }, - "id" : 6, - "nodeType" : "InheritanceSpecifier", - "src" : "49:1:1" - } - ], - "contractDependencies" : - [ - 1, - 4 - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 7, - "linearizedBaseContracts" : - [ - 7, - 4, - 1 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : [], - "scope" : 14, - "src" : "35:19:1" - }, - { - "baseContracts" : - [ - { - "arguments" : null, - "baseName" : - { - "contractScope" : null, - "id" : 8, - "name" : "C", - "nodeType" : "UserDefinedTypeName", - "referencedDeclaration" : 7, - "src" : "69:1:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_contract$_C_$7", - "typeString" : "contract C" - } - }, - "id" : 9, - "nodeType" : "InheritanceSpecifier", - "src" : "69:1:1" - } - ], - "contractDependencies" : - [ - 1, - 4, - 7 - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 10, - "linearizedBaseContracts" : - [ - 10, - 7, - 4, - 1 - ], - "name" : "D", - "nodeType" : "ContractDefinition", - "nodes" : [], - "scope" : 14, - "src" : "55:19:1" - }, - { - "baseContracts" : - [ - { - "arguments" : null, - "baseName" : - { - "contractScope" : null, - "id" : 11, - "name" : "D", - "nodeType" : "UserDefinedTypeName", - "referencedDeclaration" : 10, - "src" : "89:1:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_contract$_D_$10", - "typeString" : "contract D" - } - }, - "id" : 12, - "nodeType" : "InheritanceSpecifier", - "src" : "89:1:1" - } - ], - "contractDependencies" : - [ - 1, - 4, - 7, - 10 - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 13, - "linearizedBaseContracts" : - [ - 13, - 10, - 7, - 4, - 1 - ], - "name" : "E", - "nodeType" : "ContractDefinition", - "nodes" : [], - "scope" : 14, - "src" : "75:19:1" - } - ], - "src" : "0:95:1" + "absolutePath": "a", + "exportedSymbols": + { + "A": + [ + 1 + ], + "B": + [ + 4 + ], + "C": + [ + 7 + ], + "D": + [ + 10 + ], + "E": + [ + 13 + ] + }, + "id": 14, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 1, + "linearizedBaseContracts": + [ + 1 + ], + "name": "A", + "nodeType": "ContractDefinition", + "nodes": [], + "scope": 14, + "src": "0:14:1" + }, + { + "baseContracts": + [ + { + "arguments": null, + "baseName": + { + "contractScope": null, + "id": 2, + "name": "A", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1, + "src": "29:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_A_$1", + "typeString": "contract A" + } + }, + "id": 3, + "nodeType": "InheritanceSpecifier", + "src": "29:1:1" + } + ], + "contractDependencies": + [ + 1 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 4, + "linearizedBaseContracts": + [ + 4, + 1 + ], + "name": "B", + "nodeType": "ContractDefinition", + "nodes": [], + "scope": 14, + "src": "15:19:1" + }, + { + "baseContracts": + [ + { + "arguments": null, + "baseName": + { + "contractScope": null, + "id": 5, + "name": "B", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 4, + "src": "49:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_B_$4", + "typeString": "contract B" + } + }, + "id": 6, + "nodeType": "InheritanceSpecifier", + "src": "49:1:1" + } + ], + "contractDependencies": + [ + 1, + 4 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 7, + "linearizedBaseContracts": + [ + 7, + 4, + 1 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": [], + "scope": 14, + "src": "35:19:1" + }, + { + "baseContracts": + [ + { + "arguments": null, + "baseName": + { + "contractScope": null, + "id": 8, + "name": "C", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 7, + "src": "69:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$7", + "typeString": "contract C" + } + }, + "id": 9, + "nodeType": "InheritanceSpecifier", + "src": "69:1:1" + } + ], + "contractDependencies": + [ + 1, + 4, + 7 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 10, + "linearizedBaseContracts": + [ + 10, + 7, + 4, + 1 + ], + "name": "D", + "nodeType": "ContractDefinition", + "nodes": [], + "scope": 14, + "src": "55:19:1" + }, + { + "baseContracts": + [ + { + "arguments": null, + "baseName": + { + "contractScope": null, + "id": 11, + "name": "D", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 10, + "src": "89:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_D_$10", + "typeString": "contract D" + } + }, + "id": 12, + "nodeType": "InheritanceSpecifier", + "src": "89:1:1" + } + ], + "contractDependencies": + [ + 1, + 4, + 7, + 10 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 13, + "linearizedBaseContracts": + [ + 13, + 10, + 7, + 4, + 1 + ], + "name": "E", + "nodeType": "ContractDefinition", + "nodes": [], + "scope": 14, + "src": "75:19:1" + } + ], + "src": "0:95:1" } diff --git a/test/libsolidity/ASTJSON/contract_dep_order_legacy.json b/test/libsolidity/ASTJSON/contract_dep_order_legacy.json index 5990b52ca..ff80f7fb6 100644 --- a/test/libsolidity/ASTJSON/contract_dep_order_legacy.json +++ b/test/libsolidity/ASTJSON/contract_dep_order_legacy.json @@ -1,288 +1,288 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "A" : - [ - 1 - ], - "B" : - [ - 4 - ], - "C" : - [ - 7 - ], - "D" : - [ - 10 - ], - "E" : - [ - 13 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 1 - ], - "name" : "A", - "nodes" : - [ - null - ], - "scope" : 14 - }, - "id" : 1, - "name" : "ContractDefinition", - "src" : "0:14:1" - }, - { - "attributes" : - { - "contractDependencies" : - [ - 1 - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 4, - 1 - ], - "name" : "B", - "nodes" : - [ - null - ], - "scope" : 14 - }, - "children" : - [ - { - "attributes" : - { - "arguments" : null - }, - "children" : - [ - { - "attributes" : - { - "contractScope" : null, - "name" : "A", - "referencedDeclaration" : 1, - "type" : "contract A" - }, - "id" : 2, - "name" : "UserDefinedTypeName", - "src" : "29:1:1" - } - ], - "id" : 3, - "name" : "InheritanceSpecifier", - "src" : "29:1:1" - } - ], - "id" : 4, - "name" : "ContractDefinition", - "src" : "15:19:1" - }, - { - "attributes" : - { - "contractDependencies" : - [ - 1, - 4 - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 7, - 4, - 1 - ], - "name" : "C", - "nodes" : - [ - null - ], - "scope" : 14 - }, - "children" : - [ - { - "attributes" : - { - "arguments" : null - }, - "children" : - [ - { - "attributes" : - { - "contractScope" : null, - "name" : "B", - "referencedDeclaration" : 4, - "type" : "contract B" - }, - "id" : 5, - "name" : "UserDefinedTypeName", - "src" : "49:1:1" - } - ], - "id" : 6, - "name" : "InheritanceSpecifier", - "src" : "49:1:1" - } - ], - "id" : 7, - "name" : "ContractDefinition", - "src" : "35:19:1" - }, - { - "attributes" : - { - "contractDependencies" : - [ - 1, - 4, - 7 - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 10, - 7, - 4, - 1 - ], - "name" : "D", - "nodes" : - [ - null - ], - "scope" : 14 - }, - "children" : - [ - { - "attributes" : - { - "arguments" : null - }, - "children" : - [ - { - "attributes" : - { - "contractScope" : null, - "name" : "C", - "referencedDeclaration" : 7, - "type" : "contract C" - }, - "id" : 8, - "name" : "UserDefinedTypeName", - "src" : "69:1:1" - } - ], - "id" : 9, - "name" : "InheritanceSpecifier", - "src" : "69:1:1" - } - ], - "id" : 10, - "name" : "ContractDefinition", - "src" : "55:19:1" - }, - { - "attributes" : - { - "contractDependencies" : - [ - 1, - 4, - 7, - 10 - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 13, - 10, - 7, - 4, - 1 - ], - "name" : "E", - "nodes" : - [ - null - ], - "scope" : 14 - }, - "children" : - [ - { - "attributes" : - { - "arguments" : null - }, - "children" : - [ - { - "attributes" : - { - "contractScope" : null, - "name" : "D", - "referencedDeclaration" : 10, - "type" : "contract D" - }, - "id" : 11, - "name" : "UserDefinedTypeName", - "src" : "89:1:1" - } - ], - "id" : 12, - "name" : "InheritanceSpecifier", - "src" : "89:1:1" - } - ], - "id" : 13, - "name" : "ContractDefinition", - "src" : "75:19:1" - } - ], - "id" : 14, - "name" : "SourceUnit", - "src" : "0:95:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "A": + [ + 1 + ], + "B": + [ + 4 + ], + "C": + [ + 7 + ], + "D": + [ + 10 + ], + "E": + [ + 13 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 1 + ], + "name": "A", + "nodes": + [ + null + ], + "scope": 14 + }, + "id": 1, + "name": "ContractDefinition", + "src": "0:14:1" + }, + { + "attributes": + { + "contractDependencies": + [ + 1 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 4, + 1 + ], + "name": "B", + "nodes": + [ + null + ], + "scope": 14 + }, + "children": + [ + { + "attributes": + { + "arguments": null + }, + "children": + [ + { + "attributes": + { + "contractScope": null, + "name": "A", + "referencedDeclaration": 1, + "type": "contract A" + }, + "id": 2, + "name": "UserDefinedTypeName", + "src": "29:1:1" + } + ], + "id": 3, + "name": "InheritanceSpecifier", + "src": "29:1:1" + } + ], + "id": 4, + "name": "ContractDefinition", + "src": "15:19:1" + }, + { + "attributes": + { + "contractDependencies": + [ + 1, + 4 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 7, + 4, + 1 + ], + "name": "C", + "nodes": + [ + null + ], + "scope": 14 + }, + "children": + [ + { + "attributes": + { + "arguments": null + }, + "children": + [ + { + "attributes": + { + "contractScope": null, + "name": "B", + "referencedDeclaration": 4, + "type": "contract B" + }, + "id": 5, + "name": "UserDefinedTypeName", + "src": "49:1:1" + } + ], + "id": 6, + "name": "InheritanceSpecifier", + "src": "49:1:1" + } + ], + "id": 7, + "name": "ContractDefinition", + "src": "35:19:1" + }, + { + "attributes": + { + "contractDependencies": + [ + 1, + 4, + 7 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 10, + 7, + 4, + 1 + ], + "name": "D", + "nodes": + [ + null + ], + "scope": 14 + }, + "children": + [ + { + "attributes": + { + "arguments": null + }, + "children": + [ + { + "attributes": + { + "contractScope": null, + "name": "C", + "referencedDeclaration": 7, + "type": "contract C" + }, + "id": 8, + "name": "UserDefinedTypeName", + "src": "69:1:1" + } + ], + "id": 9, + "name": "InheritanceSpecifier", + "src": "69:1:1" + } + ], + "id": 10, + "name": "ContractDefinition", + "src": "55:19:1" + }, + { + "attributes": + { + "contractDependencies": + [ + 1, + 4, + 7, + 10 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 13, + 10, + 7, + 4, + 1 + ], + "name": "E", + "nodes": + [ + null + ], + "scope": 14 + }, + "children": + [ + { + "attributes": + { + "arguments": null + }, + "children": + [ + { + "attributes": + { + "contractScope": null, + "name": "D", + "referencedDeclaration": 10, + "type": "contract D" + }, + "id": 11, + "name": "UserDefinedTypeName", + "src": "89:1:1" + } + ], + "id": 12, + "name": "InheritanceSpecifier", + "src": "89:1:1" + } + ], + "id": 13, + "name": "ContractDefinition", + "src": "75:19:1" + } + ], + "id": 14, + "name": "SourceUnit", + "src": "0:95:1" } diff --git a/test/libsolidity/ASTJSON/documentation.json b/test/libsolidity/ASTJSON/documentation.json index ce1e0b57a..ba66e73a9 100644 --- a/test/libsolidity/ASTJSON/documentation.json +++ b/test/libsolidity/ASTJSON/documentation.json @@ -1,180 +1,180 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 1 - ] - }, - "id" : 2, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : "This contract is empty", - "fullyImplemented" : true, - "id" : 1, - "linearizedBaseContracts" : - [ - 1 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : [], - "scope" : 2, - "src" : "28:13:1" - } - ], - "src" : "28:14:1" + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 1 + ] + }, + "id": 2, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": "This contract is empty", + "fullyImplemented": true, + "id": 1, + "linearizedBaseContracts": + [ + 1 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": [], + "scope": 2, + "src": "28:13:1" + } + ], + "src": "28:14:1" }, { - "absolutePath" : "b", - "exportedSymbols" : - { - "C" : - [ - 3 - ] - }, - "id" : 4, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : "This contract is empty\nand has a line-breaking comment.", - "fullyImplemented" : true, - "id" : 3, - "linearizedBaseContracts" : - [ - 3 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : [], - "scope" : 4, - "src" : "62:13:2" - } - ], - "src" : "62:14:2" + "absolutePath": "b", + "exportedSymbols": + { + "C": + [ + 3 + ] + }, + "id": 4, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": "This contract is empty\nand has a line-breaking comment.", + "fullyImplemented": true, + "id": 3, + "linearizedBaseContracts": + [ + 3 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": [], + "scope": 4, + "src": "62:13:2" + } + ], + "src": "62:14:2" }, { - "absolutePath" : "c", - "exportedSymbols" : - { - "C" : - [ - 15 - ] - }, - "id" : 16, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 15, - "linearizedBaseContracts" : - [ - 15 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "anonymous" : false, - "documentation" : "Some comment on Evt.", - "id" : 6, - "name" : "Evt", - "nodeType" : "EventDefinition", - "parameters" : - { - "id" : 5, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "51:2:3" - }, - "src" : "42:12:3" - }, - { - "body" : - { - "id" : 9, - "nodeType" : "Block", - "src" : "99:6:3", - "statements" : - [ - { - "id" : 8, - "nodeType" : "PlaceholderStatement", - "src" : "101:1:3" - } - ] - }, - "documentation" : "Some comment on mod.", - "id" : 10, - "name" : "mod", - "nodeType" : "ModifierDefinition", - "parameters" : - { - "id" : 7, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "96:2:3" - }, - "src" : "84:21:3", - "visibility" : "internal" - }, - { - "body" : - { - "id" : 13, - "nodeType" : "Block", - "src" : "155:2:3", - "statements" : [] - }, - "documentation" : "Some comment on fn.", - "id" : 14, - "implemented" : true, - "kind" : "function", - "modifiers" : [], - "name" : "fn", - "nodeType" : "FunctionDefinition", - "parameters" : - { - "id" : 11, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "145:2:3" - }, - "returnParameters" : - { - "id" : 12, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "155:0:3" - }, - "scope" : 15, - "src" : "134:23:3", - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - } - ], - "scope" : 16, - "src" : "0:159:3" - } - ], - "src" : "0:160:3" + "absolutePath": "c", + "exportedSymbols": + { + "C": + [ + 15 + ] + }, + "id": 16, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 15, + "linearizedBaseContracts": + [ + 15 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "documentation": "Some comment on Evt.", + "id": 6, + "name": "Evt", + "nodeType": "EventDefinition", + "parameters": + { + "id": 5, + "nodeType": "ParameterList", + "parameters": [], + "src": "51:2:3" + }, + "src": "42:12:3" + }, + { + "body": + { + "id": 9, + "nodeType": "Block", + "src": "99:6:3", + "statements": + [ + { + "id": 8, + "nodeType": "PlaceholderStatement", + "src": "101:1:3" + } + ] + }, + "documentation": "Some comment on mod.", + "id": 10, + "name": "mod", + "nodeType": "ModifierDefinition", + "parameters": + { + "id": 7, + "nodeType": "ParameterList", + "parameters": [], + "src": "96:2:3" + }, + "src": "84:21:3", + "visibility": "internal" + }, + { + "body": + { + "id": 13, + "nodeType": "Block", + "src": "155:2:3", + "statements": [] + }, + "documentation": "Some comment on fn.", + "id": 14, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "fn", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 11, + "nodeType": "ParameterList", + "parameters": [], + "src": "145:2:3" + }, + "returnParameters": + { + "id": 12, + "nodeType": "ParameterList", + "parameters": [], + "src": "155:0:3" + }, + "scope": 15, + "src": "134:23:3", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 16, + "src": "0:159:3" + } + ], + "src": "0:160:3" } diff --git a/test/libsolidity/ASTJSON/documentation.sol b/test/libsolidity/ASTJSON/documentation.sol index e65af9b44..5c5fe7d2b 100644 --- a/test/libsolidity/ASTJSON/documentation.sol +++ b/test/libsolidity/ASTJSON/documentation.sol @@ -15,3 +15,5 @@ contract C { /** Some comment on mod.*/ modifier mod() { _; } /** Some comment on fn.*/ function fn() public {} } + +// ---- diff --git a/test/libsolidity/ASTJSON/documentation_legacy.json b/test/libsolidity/ASTJSON/documentation_legacy.json index 0277902f8..caf5e43d9 100644 --- a/test/libsolidity/ASTJSON/documentation_legacy.json +++ b/test/libsolidity/ASTJSON/documentation_legacy.json @@ -1,177 +1,177 @@ { - "attributes" : - { - "absolutePath" : "c", - "exportedSymbols" : - { - "C" : - [ - 15 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 15 - ], - "name" : "C", - "scope" : 16 - }, - "children" : - [ - { - "attributes" : - { - "anonymous" : false, - "documentation" : "Some comment on Evt.", - "name" : "Evt" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 5, - "name" : "ParameterList", - "src" : "51:2:3" - } - ], - "id" : 6, - "name" : "EventDefinition", - "src" : "42:12:3" - }, - { - "attributes" : - { - "documentation" : "Some comment on mod.", - "name" : "mod", - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 7, - "name" : "ParameterList", - "src" : "96:2:3" - }, - { - "children" : - [ - { - "id" : 8, - "name" : "PlaceholderStatement", - "src" : "101:1:3" - } - ], - "id" : 9, - "name" : "Block", - "src" : "99:6:3" - } - ], - "id" : 10, - "name" : "ModifierDefinition", - "src" : "84:21:3" - }, - { - "attributes" : - { - "documentation" : "Some comment on fn.", - "implemented" : true, - "isConstructor" : false, - "kind" : "function", - "modifiers" : - [ - null - ], - "name" : "fn", - "scope" : 15, - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 11, - "name" : "ParameterList", - "src" : "145:2:3" - }, - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 12, - "name" : "ParameterList", - "src" : "155:0:3" - }, - { - "attributes" : - { - "statements" : - [ - null - ] - }, - "children" : [], - "id" : 13, - "name" : "Block", - "src" : "155:2:3" - } - ], - "id" : 14, - "name" : "FunctionDefinition", - "src" : "134:23:3" - } - ], - "id" : 15, - "name" : "ContractDefinition", - "src" : "0:159:3" - } - ], - "id" : 16, - "name" : "SourceUnit", - "src" : "0:160:3" + "attributes": + { + "absolutePath": "c", + "exportedSymbols": + { + "C": + [ + 15 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 15 + ], + "name": "C", + "scope": 16 + }, + "children": + [ + { + "attributes": + { + "anonymous": false, + "documentation": "Some comment on Evt.", + "name": "Evt" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 5, + "name": "ParameterList", + "src": "51:2:3" + } + ], + "id": 6, + "name": "EventDefinition", + "src": "42:12:3" + }, + { + "attributes": + { + "documentation": "Some comment on mod.", + "name": "mod", + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 7, + "name": "ParameterList", + "src": "96:2:3" + }, + { + "children": + [ + { + "id": 8, + "name": "PlaceholderStatement", + "src": "101:1:3" + } + ], + "id": 9, + "name": "Block", + "src": "99:6:3" + } + ], + "id": 10, + "name": "ModifierDefinition", + "src": "84:21:3" + }, + { + "attributes": + { + "documentation": "Some comment on fn.", + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": + [ + null + ], + "name": "fn", + "scope": 15, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 11, + "name": "ParameterList", + "src": "145:2:3" + }, + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 12, + "name": "ParameterList", + "src": "155:0:3" + }, + { + "attributes": + { + "statements": + [ + null + ] + }, + "children": [], + "id": 13, + "name": "Block", + "src": "155:2:3" + } + ], + "id": 14, + "name": "FunctionDefinition", + "src": "134:23:3" + } + ], + "id": 15, + "name": "ContractDefinition", + "src": "0:159:3" + } + ], + "id": 16, + "name": "SourceUnit", + "src": "0:160:3" } diff --git a/test/libsolidity/ASTJSON/enum_value.json b/test/libsolidity/ASTJSON/enum_value.json index 21afd9a78..a8562c4d4 100644 --- a/test/libsolidity/ASTJSON/enum_value.json +++ b/test/libsolidity/ASTJSON/enum_value.json @@ -1,57 +1,57 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 4 - ] - }, - "id" : 5, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 4, - "linearizedBaseContracts" : - [ - 4 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "canonicalName" : "C.E", - "id" : 3, - "members" : - [ - { - "id" : 1, - "name" : "A", - "nodeType" : "EnumValue", - "src" : "22:1:1" - }, - { - "id" : 2, - "name" : "B", - "nodeType" : "EnumValue", - "src" : "25:1:1" - } - ], - "name" : "E", - "nodeType" : "EnumDefinition", - "src" : "13:15:1" - } - ], - "scope" : 5, - "src" : "0:30:1" - } - ], - "src" : "0:31:1" + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 4 + ] + }, + "id": 5, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 4, + "linearizedBaseContracts": + [ + 4 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "canonicalName": "C.E", + "id": 3, + "members": + [ + { + "id": 1, + "name": "A", + "nodeType": "EnumValue", + "src": "22:1:1" + }, + { + "id": 2, + "name": "B", + "nodeType": "EnumValue", + "src": "25:1:1" + } + ], + "name": "E", + "nodeType": "EnumDefinition", + "src": "13:15:1" + } + ], + "scope": 5, + "src": "0:30:1" + } + ], + "src": "0:31:1" } diff --git a/test/libsolidity/ASTJSON/enum_value.sol b/test/libsolidity/ASTJSON/enum_value.sol index ef0875fbe..37e450f22 100644 --- a/test/libsolidity/ASTJSON/enum_value.sol +++ b/test/libsolidity/ASTJSON/enum_value.sol @@ -1 +1,3 @@ contract C { enum E { A, B } } + +// ---- diff --git a/test/libsolidity/ASTJSON/enum_value_legacy.json b/test/libsolidity/ASTJSON/enum_value_legacy.json index d7782969b..9bc5319bf 100644 --- a/test/libsolidity/ASTJSON/enum_value_legacy.json +++ b/test/libsolidity/ASTJSON/enum_value_legacy.json @@ -1,78 +1,78 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 4 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 4 - ], - "name" : "C", - "scope" : 5 - }, - "children" : - [ - { - "attributes" : - { - "canonicalName" : "C.E", - "name" : "E" - }, - "children" : - [ - { - "attributes" : - { - "name" : "A" - }, - "id" : 1, - "name" : "EnumValue", - "src" : "22:1:1" - }, - { - "attributes" : - { - "name" : "B" - }, - "id" : 2, - "name" : "EnumValue", - "src" : "25:1:1" - } - ], - "id" : 3, - "name" : "EnumDefinition", - "src" : "13:15:1" - } - ], - "id" : 4, - "name" : "ContractDefinition", - "src" : "0:30:1" - } - ], - "id" : 5, - "name" : "SourceUnit", - "src" : "0:31:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 4 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 4 + ], + "name": "C", + "scope": 5 + }, + "children": + [ + { + "attributes": + { + "canonicalName": "C.E", + "name": "E" + }, + "children": + [ + { + "attributes": + { + "name": "A" + }, + "id": 1, + "name": "EnumValue", + "src": "22:1:1" + }, + { + "attributes": + { + "name": "B" + }, + "id": 2, + "name": "EnumValue", + "src": "25:1:1" + } + ], + "id": 3, + "name": "EnumDefinition", + "src": "13:15:1" + } + ], + "id": 4, + "name": "ContractDefinition", + "src": "0:30:1" + } + ], + "id": 5, + "name": "SourceUnit", + "src": "0:31:1" } diff --git a/test/libsolidity/ASTJSON/event_definition.json b/test/libsolidity/ASTJSON/event_definition.json index 029062c32..45f16ba85 100644 --- a/test/libsolidity/ASTJSON/event_definition.json +++ b/test/libsolidity/ASTJSON/event_definition.json @@ -1,50 +1,50 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 3 - ] - }, - "id" : 4, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 3, - "linearizedBaseContracts" : - [ - 3 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "anonymous" : false, - "documentation" : null, - "id" : 2, - "name" : "E", - "nodeType" : "EventDefinition", - "parameters" : - { - "id" : 1, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "20:2:1" - }, - "src" : "13:10:1" - } - ], - "scope" : 4, - "src" : "0:25:1" - } - ], - "src" : "0:26:1" + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 3 + ] + }, + "id": 4, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 3, + "linearizedBaseContracts": + [ + 3 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "documentation": null, + "id": 2, + "name": "E", + "nodeType": "EventDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "20:2:1" + }, + "src": "13:10:1" + } + ], + "scope": 4, + "src": "0:25:1" + } + ], + "src": "0:26:1" } diff --git a/test/libsolidity/ASTJSON/event_definition.sol b/test/libsolidity/ASTJSON/event_definition.sol index 81b43c672..9fa7eaeb5 100644 --- a/test/libsolidity/ASTJSON/event_definition.sol +++ b/test/libsolidity/ASTJSON/event_definition.sol @@ -1 +1,3 @@ contract C { event E(); } + +// ---- diff --git a/test/libsolidity/ASTJSON/event_definition_legacy.json b/test/libsolidity/ASTJSON/event_definition_legacy.json index f5967bf4e..5f0859fea 100644 --- a/test/libsolidity/ASTJSON/event_definition_legacy.json +++ b/test/libsolidity/ASTJSON/event_definition_legacy.json @@ -1,74 +1,74 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 3 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 3 - ], - "name" : "C", - "scope" : 4 - }, - "children" : - [ - { - "attributes" : - { - "anonymous" : false, - "documentation" : null, - "name" : "E" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 1, - "name" : "ParameterList", - "src" : "20:2:1" - } - ], - "id" : 2, - "name" : "EventDefinition", - "src" : "13:10:1" - } - ], - "id" : 3, - "name" : "ContractDefinition", - "src" : "0:25:1" - } - ], - "id" : 4, - "name" : "SourceUnit", - "src" : "0:26:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 3 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 3 + ], + "name": "C", + "scope": 4 + }, + "children": + [ + { + "attributes": + { + "anonymous": false, + "documentation": null, + "name": "E" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 1, + "name": "ParameterList", + "src": "20:2:1" + } + ], + "id": 2, + "name": "EventDefinition", + "src": "13:10:1" + } + ], + "id": 3, + "name": "ContractDefinition", + "src": "0:25:1" + } + ], + "id": 4, + "name": "SourceUnit", + "src": "0:26:1" } diff --git a/test/libsolidity/ASTJSON/fallback.json b/test/libsolidity/ASTJSON/fallback.json index a9c85b2fb..2e089b2b9 100644 --- a/test/libsolidity/ASTJSON/fallback.json +++ b/test/libsolidity/ASTJSON/fallback.json @@ -1,70 +1,70 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 5 - ] - }, - "id" : 6, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 5, - "linearizedBaseContracts" : - [ - 5 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "body" : - { - "id" : 3, - "nodeType" : "Block", - "src" : "43:5:1", - "statements" : [] - }, - "documentation" : null, - "id" : 4, - "implemented" : true, - "kind" : "fallback", - "modifiers" : [], - "name" : "", - "nodeType" : "FunctionDefinition", - "parameters" : - { - "id" : 1, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "23:2:1" - }, - "returnParameters" : - { - "id" : 2, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "43:0:1" - }, - "scope" : 5, - "src" : "15:33:1", - "stateMutability" : "payable", - "superFunction" : null, - "visibility" : "external" - } - ], - "scope" : 6, - "src" : "0:50:1" - } - ], - "src" : "0:51:1" + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 5 + ] + }, + "id": 6, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 5, + "linearizedBaseContracts": + [ + 5 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 3, + "nodeType": "Block", + "src": "43:5:1", + "statements": [] + }, + "documentation": null, + "id": 4, + "implemented": true, + "kind": "fallback", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "23:2:1" + }, + "returnParameters": + { + "id": 2, + "nodeType": "ParameterList", + "parameters": [], + "src": "43:0:1" + }, + "scope": 5, + "src": "15:33:1", + "stateMutability": "payable", + "superFunction": null, + "visibility": "external" + } + ], + "scope": 6, + "src": "0:50:1" + } + ], + "src": "0:51:1" } diff --git a/test/libsolidity/ASTJSON/fallback.sol b/test/libsolidity/ASTJSON/fallback.sol index 4e318892e..7d346042d 100644 --- a/test/libsolidity/ASTJSON/fallback.sol +++ b/test/libsolidity/ASTJSON/fallback.sol @@ -2,3 +2,5 @@ contract C { function() external payable { } } + +// ---- diff --git a/test/libsolidity/ASTJSON/fallback_legacy.json b/test/libsolidity/ASTJSON/fallback_legacy.json index 0aca3128e..1b4c90926 100644 --- a/test/libsolidity/ASTJSON/fallback_legacy.json +++ b/test/libsolidity/ASTJSON/fallback_legacy.json @@ -1,110 +1,110 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 5 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 5 - ], - "name" : "C", - "scope" : 6 - }, - "children" : - [ - { - "attributes" : - { - "documentation" : null, - "implemented" : true, - "isConstructor" : false, - "kind" : "fallback", - "modifiers" : - [ - null - ], - "name" : "", - "scope" : 5, - "stateMutability" : "payable", - "superFunction" : null, - "visibility" : "external" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 1, - "name" : "ParameterList", - "src" : "23:2:1" - }, - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 2, - "name" : "ParameterList", - "src" : "43:0:1" - }, - { - "attributes" : - { - "statements" : - [ - null - ] - }, - "children" : [], - "id" : 3, - "name" : "Block", - "src" : "43:5:1" - } - ], - "id" : 4, - "name" : "FunctionDefinition", - "src" : "15:33:1" - } - ], - "id" : 5, - "name" : "ContractDefinition", - "src" : "0:50:1" - } - ], - "id" : 6, - "name" : "SourceUnit", - "src" : "0:51:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 5 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 5 + ], + "name": "C", + "scope": 6 + }, + "children": + [ + { + "attributes": + { + "documentation": null, + "implemented": true, + "isConstructor": false, + "kind": "fallback", + "modifiers": + [ + null + ], + "name": "", + "scope": 5, + "stateMutability": "payable", + "superFunction": null, + "visibility": "external" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 1, + "name": "ParameterList", + "src": "23:2:1" + }, + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 2, + "name": "ParameterList", + "src": "43:0:1" + }, + { + "attributes": + { + "statements": + [ + null + ] + }, + "children": [], + "id": 3, + "name": "Block", + "src": "43:5:1" + } + ], + "id": 4, + "name": "FunctionDefinition", + "src": "15:33:1" + } + ], + "id": 5, + "name": "ContractDefinition", + "src": "0:50:1" + } + ], + "id": 6, + "name": "SourceUnit", + "src": "0:51:1" } diff --git a/test/libsolidity/ASTJSON/fallback_payable.json b/test/libsolidity/ASTJSON/fallback_payable.json index 9d56f74bd..da8fc641d 100644 --- a/test/libsolidity/ASTJSON/fallback_payable.json +++ b/test/libsolidity/ASTJSON/fallback_payable.json @@ -1,70 +1,70 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 5 - ] - }, - "id" : 6, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 5, - "linearizedBaseContracts" : - [ - 5 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "body" : - { - "id" : 3, - "nodeType" : "Block", - "src" : "34:2:1", - "statements" : [] - }, - "documentation" : null, - "id" : 4, - "implemented" : true, - "kind" : "fallback", - "modifiers" : [], - "name" : "", - "nodeType" : "FunctionDefinition", - "parameters" : - { - "id" : 1, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "22:2:1" - }, - "returnParameters" : - { - "id" : 2, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "34:0:1" - }, - "scope" : 5, - "src" : "14:22:1", - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "external" - } - ], - "scope" : 6, - "src" : "0:38:1" - } - ], - "src" : "0:39:1" + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 5 + ] + }, + "id": 6, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 5, + "linearizedBaseContracts": + [ + 5 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 3, + "nodeType": "Block", + "src": "34:2:1", + "statements": [] + }, + "documentation": null, + "id": 4, + "implemented": true, + "kind": "fallback", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "22:2:1" + }, + "returnParameters": + { + "id": 2, + "nodeType": "ParameterList", + "parameters": [], + "src": "34:0:1" + }, + "scope": 5, + "src": "14:22:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + } + ], + "scope": 6, + "src": "0:38:1" + } + ], + "src": "0:39:1" } diff --git a/test/libsolidity/ASTJSON/fallback_payable.sol b/test/libsolidity/ASTJSON/fallback_payable.sol index 21db99ecd..4a3cee6b5 100644 --- a/test/libsolidity/ASTJSON/fallback_payable.sol +++ b/test/libsolidity/ASTJSON/fallback_payable.sol @@ -1,3 +1,5 @@ contract C { function() external {} } + +// ---- diff --git a/test/libsolidity/ASTJSON/fallback_payable_legacy.json b/test/libsolidity/ASTJSON/fallback_payable_legacy.json index 7320f574a..8776b5efd 100644 --- a/test/libsolidity/ASTJSON/fallback_payable_legacy.json +++ b/test/libsolidity/ASTJSON/fallback_payable_legacy.json @@ -1,110 +1,110 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 5 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 5 - ], - "name" : "C", - "scope" : 6 - }, - "children" : - [ - { - "attributes" : - { - "documentation" : null, - "implemented" : true, - "isConstructor" : false, - "kind" : "fallback", - "modifiers" : - [ - null - ], - "name" : "", - "scope" : 5, - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "external" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 1, - "name" : "ParameterList", - "src" : "22:2:1" - }, - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 2, - "name" : "ParameterList", - "src" : "34:0:1" - }, - { - "attributes" : - { - "statements" : - [ - null - ] - }, - "children" : [], - "id" : 3, - "name" : "Block", - "src" : "34:2:1" - } - ], - "id" : 4, - "name" : "FunctionDefinition", - "src" : "14:22:1" - } - ], - "id" : 5, - "name" : "ContractDefinition", - "src" : "0:38:1" - } - ], - "id" : 6, - "name" : "SourceUnit", - "src" : "0:39:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 5 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 5 + ], + "name": "C", + "scope": 6 + }, + "children": + [ + { + "attributes": + { + "documentation": null, + "implemented": true, + "isConstructor": false, + "kind": "fallback", + "modifiers": + [ + null + ], + "name": "", + "scope": 5, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 1, + "name": "ParameterList", + "src": "22:2:1" + }, + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 2, + "name": "ParameterList", + "src": "34:0:1" + }, + { + "attributes": + { + "statements": + [ + null + ] + }, + "children": [], + "id": 3, + "name": "Block", + "src": "34:2:1" + } + ], + "id": 4, + "name": "FunctionDefinition", + "src": "14:22:1" + } + ], + "id": 5, + "name": "ContractDefinition", + "src": "0:38:1" + } + ], + "id": 6, + "name": "SourceUnit", + "src": "0:39:1" } diff --git a/test/libsolidity/ASTJSON/function_type.json b/test/libsolidity/ASTJSON/function_type.json index b78d84463..1a0456efb 100644 --- a/test/libsolidity/ASTJSON/function_type.json +++ b/test/libsolidity/ASTJSON/function_type.json @@ -1,224 +1,224 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 17 - ] - }, - "id" : 18, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 17, - "linearizedBaseContracts" : - [ - 17 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "body" : - { - "id" : 15, - "nodeType" : "Block", - "src" : "120:2:1", - "statements" : [] - }, - "documentation" : null, - "id" : 16, - "implemented" : true, - "kind" : "function", - "modifiers" : [], - "name" : "f", - "nodeType" : "FunctionDefinition", - "parameters" : - { - "id" : 7, - "nodeType" : "ParameterList", - "parameters" : - [ - { - "constant" : false, - "id" : 6, - "name" : "x", - "nodeType" : "VariableDeclaration", - "scope" : 16, - "src" : "24:44:1", - "stateVariable" : false, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_function_external_payable$__$returns$_t_uint256_$", - "typeString" : "function () payable external returns (uint256)" - }, - "typeName" : - { - "id" : 5, - "nodeType" : "FunctionTypeName", - "parameterTypes" : - { - "id" : 1, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "32:2:1" - }, - "returnParameterTypes" : - { - "id" : 4, - "nodeType" : "ParameterList", - "parameters" : - [ - { - "constant" : false, - "id" : 3, - "name" : "", - "nodeType" : "VariableDeclaration", - "scope" : 5, - "src" : "61:4:1", - "stateVariable" : false, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - }, - "typeName" : - { - "id" : 2, - "name" : "uint", - "nodeType" : "ElementaryTypeName", - "src" : "61:4:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "value" : null, - "visibility" : "internal" - } - ], - "src" : "60:6:1" - }, - "src" : "24:44:1", - "stateMutability" : "payable", - "typeDescriptions" : - { - "typeIdentifier" : "t_function_external_payable$__$returns$_t_uint256_$", - "typeString" : "function () payable external returns (uint256)" - }, - "visibility" : "external" - }, - "value" : null, - "visibility" : "internal" - } - ], - "src" : "23:46:1" - }, - "returnParameters" : - { - "id" : 14, - "nodeType" : "ParameterList", - "parameters" : - [ - { - "constant" : false, - "id" : 13, - "name" : "", - "nodeType" : "VariableDeclaration", - "scope" : 16, - "src" : "79:40:1", - "stateVariable" : false, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_function_external_view$__$returns$_t_uint256_$", - "typeString" : "function () view external returns (uint256)" - }, - "typeName" : - { - "id" : 12, - "nodeType" : "FunctionTypeName", - "parameterTypes" : - { - "id" : 8, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "87:2:1" - }, - "returnParameterTypes" : - { - "id" : 11, - "nodeType" : "ParameterList", - "parameters" : - [ - { - "constant" : false, - "id" : 10, - "name" : "", - "nodeType" : "VariableDeclaration", - "scope" : 12, - "src" : "113:4:1", - "stateVariable" : false, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - }, - "typeName" : - { - "id" : 9, - "name" : "uint", - "nodeType" : "ElementaryTypeName", - "src" : "113:4:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "value" : null, - "visibility" : "internal" - } - ], - "src" : "112:6:1" - }, - "src" : "79:40:1", - "stateMutability" : "view", - "typeDescriptions" : - { - "typeIdentifier" : "t_function_external_view$__$returns$_t_uint256_$", - "typeString" : "function () view external returns (uint256)" - }, - "visibility" : "external" - }, - "value" : null, - "visibility" : "internal" - } - ], - "src" : "78:41:1" - }, - "scope" : 17, - "src" : "13:109:1", - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - } - ], - "scope" : 18, - "src" : "0:124:1" - } - ], - "src" : "0:125:1" + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 17 + ] + }, + "id": 18, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 17, + "linearizedBaseContracts": + [ + 17 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 15, + "nodeType": "Block", + "src": "120:2:1", + "statements": [] + }, + "documentation": null, + "id": 16, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 7, + "nodeType": "ParameterList", + "parameters": + [ + { + "constant": false, + "id": 6, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 16, + "src": "24:44:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_function_external_payable$__$returns$_t_uint256_$", + "typeString": "function () payable external returns (uint256)" + }, + "typeName": + { + "id": 5, + "nodeType": "FunctionTypeName", + "parameterTypes": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "32:2:1" + }, + "returnParameterTypes": + { + "id": 4, + "nodeType": "ParameterList", + "parameters": + [ + { + "constant": false, + "id": 3, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 5, + "src": "61:4:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": + { + "id": 2, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "61:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "60:6:1" + }, + "src": "24:44:1", + "stateMutability": "payable", + "typeDescriptions": + { + "typeIdentifier": "t_function_external_payable$__$returns$_t_uint256_$", + "typeString": "function () payable external returns (uint256)" + }, + "visibility": "external" + }, + "value": null, + "visibility": "internal" + } + ], + "src": "23:46:1" + }, + "returnParameters": + { + "id": 14, + "nodeType": "ParameterList", + "parameters": + [ + { + "constant": false, + "id": 13, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 16, + "src": "79:40:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", + "typeString": "function () view external returns (uint256)" + }, + "typeName": + { + "id": 12, + "nodeType": "FunctionTypeName", + "parameterTypes": + { + "id": 8, + "nodeType": "ParameterList", + "parameters": [], + "src": "87:2:1" + }, + "returnParameterTypes": + { + "id": 11, + "nodeType": "ParameterList", + "parameters": + [ + { + "constant": false, + "id": 10, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 12, + "src": "113:4:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": + { + "id": 9, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "113:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "112:6:1" + }, + "src": "79:40:1", + "stateMutability": "view", + "typeDescriptions": + { + "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", + "typeString": "function () view external returns (uint256)" + }, + "visibility": "external" + }, + "value": null, + "visibility": "internal" + } + ], + "src": "78:41:1" + }, + "scope": 17, + "src": "13:109:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 18, + "src": "0:124:1" + } + ], + "src": "0:125:1" } diff --git a/test/libsolidity/ASTJSON/function_type_legacy.json b/test/libsolidity/ASTJSON/function_type_legacy.json index 72ceec81e..80c8f51cf 100644 --- a/test/libsolidity/ASTJSON/function_type_legacy.json +++ b/test/libsolidity/ASTJSON/function_type_legacy.json @@ -1,266 +1,266 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 17 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 17 - ], - "name" : "C", - "scope" : 18 - }, - "children" : - [ - { - "attributes" : - { - "documentation" : null, - "implemented" : true, - "isConstructor" : false, - "kind" : "function", - "modifiers" : - [ - null - ], - "name" : "f", - "scope" : 17, - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - }, - "children" : - [ - { - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "x", - "scope" : 16, - "stateVariable" : false, - "storageLocation" : "default", - "type" : "function () payable external returns (uint256)", - "value" : null, - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "stateMutability" : "payable", - "type" : "function () payable external returns (uint256)", - "visibility" : "external" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 1, - "name" : "ParameterList", - "src" : "32:2:1" - }, - { - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "", - "scope" : 5, - "stateVariable" : false, - "storageLocation" : "default", - "type" : "uint256", - "value" : null, - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "name" : "uint", - "type" : "uint256" - }, - "id" : 2, - "name" : "ElementaryTypeName", - "src" : "61:4:1" - } - ], - "id" : 3, - "name" : "VariableDeclaration", - "src" : "61:4:1" - } - ], - "id" : 4, - "name" : "ParameterList", - "src" : "60:6:1" - } - ], - "id" : 5, - "name" : "FunctionTypeName", - "src" : "24:44:1" - } - ], - "id" : 6, - "name" : "VariableDeclaration", - "src" : "24:44:1" - } - ], - "id" : 7, - "name" : "ParameterList", - "src" : "23:46:1" - }, - { - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "", - "scope" : 16, - "stateVariable" : false, - "storageLocation" : "default", - "type" : "function () view external returns (uint256)", - "value" : null, - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "stateMutability" : "view", - "type" : "function () view external returns (uint256)", - "visibility" : "external" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 8, - "name" : "ParameterList", - "src" : "87:2:1" - }, - { - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "", - "scope" : 12, - "stateVariable" : false, - "storageLocation" : "default", - "type" : "uint256", - "value" : null, - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "name" : "uint", - "type" : "uint256" - }, - "id" : 9, - "name" : "ElementaryTypeName", - "src" : "113:4:1" - } - ], - "id" : 10, - "name" : "VariableDeclaration", - "src" : "113:4:1" - } - ], - "id" : 11, - "name" : "ParameterList", - "src" : "112:6:1" - } - ], - "id" : 12, - "name" : "FunctionTypeName", - "src" : "79:40:1" - } - ], - "id" : 13, - "name" : "VariableDeclaration", - "src" : "79:40:1" - } - ], - "id" : 14, - "name" : "ParameterList", - "src" : "78:41:1" - }, - { - "attributes" : - { - "statements" : - [ - null - ] - }, - "children" : [], - "id" : 15, - "name" : "Block", - "src" : "120:2:1" - } - ], - "id" : 16, - "name" : "FunctionDefinition", - "src" : "13:109:1" - } - ], - "id" : 17, - "name" : "ContractDefinition", - "src" : "0:124:1" - } - ], - "id" : 18, - "name" : "SourceUnit", - "src" : "0:125:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 17 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 17 + ], + "name": "C", + "scope": 18 + }, + "children": + [ + { + "attributes": + { + "documentation": null, + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": + [ + null + ], + "name": "f", + "scope": 17, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": + [ + { + "children": + [ + { + "attributes": + { + "constant": false, + "name": "x", + "scope": 16, + "stateVariable": false, + "storageLocation": "default", + "type": "function () payable external returns (uint256)", + "value": null, + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "stateMutability": "payable", + "type": "function () payable external returns (uint256)", + "visibility": "external" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 1, + "name": "ParameterList", + "src": "32:2:1" + }, + { + "children": + [ + { + "attributes": + { + "constant": false, + "name": "", + "scope": 5, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "name": "uint", + "type": "uint256" + }, + "id": 2, + "name": "ElementaryTypeName", + "src": "61:4:1" + } + ], + "id": 3, + "name": "VariableDeclaration", + "src": "61:4:1" + } + ], + "id": 4, + "name": "ParameterList", + "src": "60:6:1" + } + ], + "id": 5, + "name": "FunctionTypeName", + "src": "24:44:1" + } + ], + "id": 6, + "name": "VariableDeclaration", + "src": "24:44:1" + } + ], + "id": 7, + "name": "ParameterList", + "src": "23:46:1" + }, + { + "children": + [ + { + "attributes": + { + "constant": false, + "name": "", + "scope": 16, + "stateVariable": false, + "storageLocation": "default", + "type": "function () view external returns (uint256)", + "value": null, + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "stateMutability": "view", + "type": "function () view external returns (uint256)", + "visibility": "external" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 8, + "name": "ParameterList", + "src": "87:2:1" + }, + { + "children": + [ + { + "attributes": + { + "constant": false, + "name": "", + "scope": 12, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "name": "uint", + "type": "uint256" + }, + "id": 9, + "name": "ElementaryTypeName", + "src": "113:4:1" + } + ], + "id": 10, + "name": "VariableDeclaration", + "src": "113:4:1" + } + ], + "id": 11, + "name": "ParameterList", + "src": "112:6:1" + } + ], + "id": 12, + "name": "FunctionTypeName", + "src": "79:40:1" + } + ], + "id": 13, + "name": "VariableDeclaration", + "src": "79:40:1" + } + ], + "id": 14, + "name": "ParameterList", + "src": "78:41:1" + }, + { + "attributes": + { + "statements": + [ + null + ] + }, + "children": [], + "id": 15, + "name": "Block", + "src": "120:2:1" + } + ], + "id": 16, + "name": "FunctionDefinition", + "src": "13:109:1" + } + ], + "id": 17, + "name": "ContractDefinition", + "src": "0:124:1" + } + ], + "id": 18, + "name": "SourceUnit", + "src": "0:125:1" } diff --git a/test/libsolidity/ASTJSON/inheritance_specifier.json b/test/libsolidity/ASTJSON/inheritance_specifier.json index edef86779..9de5f68b8 100644 --- a/test/libsolidity/ASTJSON/inheritance_specifier.json +++ b/test/libsolidity/ASTJSON/inheritance_specifier.json @@ -1,80 +1,80 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "C1" : - [ - 1 - ], - "C2" : - [ - 4 - ] - }, - "id" : 5, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 1, - "linearizedBaseContracts" : - [ - 1 - ], - "name" : "C1", - "nodeType" : "ContractDefinition", - "nodes" : [], - "scope" : 5, - "src" : "0:14:1" - }, - { - "baseContracts" : - [ - { - "arguments" : null, - "baseName" : - { - "contractScope" : null, - "id" : 2, - "name" : "C1", - "nodeType" : "UserDefinedTypeName", - "referencedDeclaration" : 1, - "src" : "30:2:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_contract$_C1_$1", - "typeString" : "contract C1" - } - }, - "id" : 3, - "nodeType" : "InheritanceSpecifier", - "src" : "30:2:1" - } - ], - "contractDependencies" : - [ - 1 - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 4, - "linearizedBaseContracts" : - [ - 4, - 1 - ], - "name" : "C2", - "nodeType" : "ContractDefinition", - "nodes" : [], - "scope" : 5, - "src" : "15:20:1" - } - ], - "src" : "0:36:1" + "absolutePath": "a", + "exportedSymbols": + { + "C1": + [ + 1 + ], + "C2": + [ + 4 + ] + }, + "id": 5, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 1, + "linearizedBaseContracts": + [ + 1 + ], + "name": "C1", + "nodeType": "ContractDefinition", + "nodes": [], + "scope": 5, + "src": "0:14:1" + }, + { + "baseContracts": + [ + { + "arguments": null, + "baseName": + { + "contractScope": null, + "id": 2, + "name": "C1", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1, + "src": "30:2:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C1_$1", + "typeString": "contract C1" + } + }, + "id": 3, + "nodeType": "InheritanceSpecifier", + "src": "30:2:1" + } + ], + "contractDependencies": + [ + 1 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 4, + "linearizedBaseContracts": + [ + 4, + 1 + ], + "name": "C2", + "nodeType": "ContractDefinition", + "nodes": [], + "scope": 5, + "src": "15:20:1" + } + ], + "src": "0:36:1" } diff --git a/test/libsolidity/ASTJSON/inheritance_specifier_legacy.json b/test/libsolidity/ASTJSON/inheritance_specifier_legacy.json index 0fcf29394..8f688a4d9 100644 --- a/test/libsolidity/ASTJSON/inheritance_specifier_legacy.json +++ b/test/libsolidity/ASTJSON/inheritance_specifier_legacy.json @@ -1,105 +1,105 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "C1" : - [ - 1 - ], - "C2" : - [ - 4 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 1 - ], - "name" : "C1", - "nodes" : - [ - null - ], - "scope" : 5 - }, - "id" : 1, - "name" : "ContractDefinition", - "src" : "0:14:1" - }, - { - "attributes" : - { - "contractDependencies" : - [ - 1 - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 4, - 1 - ], - "name" : "C2", - "nodes" : - [ - null - ], - "scope" : 5 - }, - "children" : - [ - { - "attributes" : - { - "arguments" : null - }, - "children" : - [ - { - "attributes" : - { - "contractScope" : null, - "name" : "C1", - "referencedDeclaration" : 1, - "type" : "contract C1" - }, - "id" : 2, - "name" : "UserDefinedTypeName", - "src" : "30:2:1" - } - ], - "id" : 3, - "name" : "InheritanceSpecifier", - "src" : "30:2:1" - } - ], - "id" : 4, - "name" : "ContractDefinition", - "src" : "15:20:1" - } - ], - "id" : 5, - "name" : "SourceUnit", - "src" : "0:36:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "C1": + [ + 1 + ], + "C2": + [ + 4 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 1 + ], + "name": "C1", + "nodes": + [ + null + ], + "scope": 5 + }, + "id": 1, + "name": "ContractDefinition", + "src": "0:14:1" + }, + { + "attributes": + { + "contractDependencies": + [ + 1 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 4, + 1 + ], + "name": "C2", + "nodes": + [ + null + ], + "scope": 5 + }, + "children": + [ + { + "attributes": + { + "arguments": null + }, + "children": + [ + { + "attributes": + { + "contractScope": null, + "name": "C1", + "referencedDeclaration": 1, + "type": "contract C1" + }, + "id": 2, + "name": "UserDefinedTypeName", + "src": "30:2:1" + } + ], + "id": 3, + "name": "InheritanceSpecifier", + "src": "30:2:1" + } + ], + "id": 4, + "name": "ContractDefinition", + "src": "15:20:1" + } + ], + "id": 5, + "name": "SourceUnit", + "src": "0:36:1" } diff --git a/test/libsolidity/ASTJSON/long_type_name_binary_operation.json b/test/libsolidity/ASTJSON/long_type_name_binary_operation.json index c6d40af24..218280f63 100644 --- a/test/libsolidity/ASTJSON/long_type_name_binary_operation.json +++ b/test/libsolidity/ASTJSON/long_type_name_binary_operation.json @@ -1,175 +1,175 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "c" : - [ - 11 - ] - }, - "id" : 12, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 11, - "linearizedBaseContracts" : - [ - 11 - ], - "name" : "c", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "body" : - { - "id" : 9, - "nodeType" : "Block", - "src" : "33:19:1", - "statements" : - [ - { - "assignments" : - [ - 4 - ], - "declarations" : - [ - { - "constant" : false, - "id" : 4, - "name" : "a", - "nodeType" : "VariableDeclaration", - "scope" : 9, - "src" : "35:6:1", - "stateVariable" : false, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - }, - "typeName" : - { - "id" : 3, - "name" : "uint", - "nodeType" : "ElementaryTypeName", - "src" : "35:4:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "value" : null, - "visibility" : "internal" - } - ], - "id" : 8, - "initialValue" : - { - "argumentTypes" : null, - "commonType" : - { - "typeIdentifier" : "t_rational_5_by_1", - "typeString" : "int_const 5" - }, - "id" : 7, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "lValueRequested" : false, - "leftExpression" : - { - "argumentTypes" : null, - "hexValue" : "32", - "id" : 5, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "number", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "44:1:1", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : "t_rational_2_by_1", - "typeString" : "int_const 2" - }, - "value" : "2" - }, - "nodeType" : "BinaryOperation", - "operator" : "+", - "rightExpression" : - { - "argumentTypes" : null, - "hexValue" : "33", - "id" : 6, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "number", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "48:1:1", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : "t_rational_3_by_1", - "typeString" : "int_const 3" - }, - "value" : "3" - }, - "src" : "44:5:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_rational_5_by_1", - "typeString" : "int_const 5" - } - }, - "nodeType" : "VariableDeclarationStatement", - "src" : "35:14:1" - } - ] - }, - "documentation" : null, - "id" : 10, - "implemented" : true, - "kind" : "function", - "modifiers" : [], - "name" : "f", - "nodeType" : "FunctionDefinition", - "parameters" : - { - "id" : 1, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "23:2:1" - }, - "returnParameters" : - { - "id" : 2, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "33:0:1" - }, - "scope" : 11, - "src" : "13:39:1", - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - } - ], - "scope" : 12, - "src" : "0:54:1" - } - ], - "src" : "0:55:1" + "absolutePath": "a", + "exportedSymbols": + { + "c": + [ + 11 + ] + }, + "id": 12, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 11, + "linearizedBaseContracts": + [ + 11 + ], + "name": "c", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 9, + "nodeType": "Block", + "src": "33:19:1", + "statements": + [ + { + "assignments": + [ + 4 + ], + "declarations": + [ + { + "constant": false, + "id": 4, + "name": "a", + "nodeType": "VariableDeclaration", + "scope": 9, + "src": "35:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": + { + "id": 3, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "35:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 8, + "initialValue": + { + "argumentTypes": null, + "commonType": + { + "typeIdentifier": "t_rational_5_by_1", + "typeString": "int_const 5" + }, + "id": 7, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": + { + "argumentTypes": null, + "hexValue": "32", + "id": 5, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "44:1:1", + "subdenomination": null, + "typeDescriptions": + { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": + { + "argumentTypes": null, + "hexValue": "33", + "id": 6, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "48:1:1", + "subdenomination": null, + "typeDescriptions": + { + "typeIdentifier": "t_rational_3_by_1", + "typeString": "int_const 3" + }, + "value": "3" + }, + "src": "44:5:1", + "typeDescriptions": + { + "typeIdentifier": "t_rational_5_by_1", + "typeString": "int_const 5" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "35:14:1" + } + ] + }, + "documentation": null, + "id": 10, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "23:2:1" + }, + "returnParameters": + { + "id": 2, + "nodeType": "ParameterList", + "parameters": [], + "src": "33:0:1" + }, + "scope": 11, + "src": "13:39:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 12, + "src": "0:54:1" + } + ], + "src": "0:55:1" } diff --git a/test/libsolidity/ASTJSON/long_type_name_binary_operation.sol b/test/libsolidity/ASTJSON/long_type_name_binary_operation.sol index f07029d7a..745b14ae8 100644 --- a/test/libsolidity/ASTJSON/long_type_name_binary_operation.sol +++ b/test/libsolidity/ASTJSON/long_type_name_binary_operation.sol @@ -1 +1,3 @@ contract c { function f() public { uint a = 2 + 3; } } + +// ---- diff --git a/test/libsolidity/ASTJSON/long_type_name_binary_operation_legacy.json b/test/libsolidity/ASTJSON/long_type_name_binary_operation_legacy.json index b53332860..32b419908 100644 --- a/test/libsolidity/ASTJSON/long_type_name_binary_operation_legacy.json +++ b/test/libsolidity/ASTJSON/long_type_name_binary_operation_legacy.json @@ -1,208 +1,208 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "c" : - [ - 11 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 11 - ], - "name" : "c", - "scope" : 12 - }, - "children" : - [ - { - "attributes" : - { - "documentation" : null, - "implemented" : true, - "isConstructor" : false, - "kind" : "function", - "modifiers" : - [ - null - ], - "name" : "f", - "scope" : 11, - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 1, - "name" : "ParameterList", - "src" : "23:2:1" - }, - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 2, - "name" : "ParameterList", - "src" : "33:0:1" - }, - { - "children" : - [ - { - "attributes" : - { - "assignments" : - [ - 4 - ] - }, - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "a", - "scope" : 9, - "stateVariable" : false, - "storageLocation" : "default", - "type" : "uint256", - "value" : null, - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "name" : "uint", - "type" : "uint256" - }, - "id" : 3, - "name" : "ElementaryTypeName", - "src" : "35:4:1" - } - ], - "id" : 4, - "name" : "VariableDeclaration", - "src" : "35:6:1" - }, - { - "attributes" : - { - "argumentTypes" : null, - "commonType" : - { - "typeIdentifier" : "t_rational_5_by_1", - "typeString" : "int_const 5" - }, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "lValueRequested" : false, - "operator" : "+", - "type" : "int_const 5" - }, - "children" : - [ - { - "attributes" : - { - "argumentTypes" : null, - "hexvalue" : "32", - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "lValueRequested" : false, - "subdenomination" : null, - "token" : "number", - "type" : "int_const 2", - "value" : "2" - }, - "id" : 5, - "name" : "Literal", - "src" : "44:1:1" - }, - { - "attributes" : - { - "argumentTypes" : null, - "hexvalue" : "33", - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "lValueRequested" : false, - "subdenomination" : null, - "token" : "number", - "type" : "int_const 3", - "value" : "3" - }, - "id" : 6, - "name" : "Literal", - "src" : "48:1:1" - } - ], - "id" : 7, - "name" : "BinaryOperation", - "src" : "44:5:1" - } - ], - "id" : 8, - "name" : "VariableDeclarationStatement", - "src" : "35:14:1" - } - ], - "id" : 9, - "name" : "Block", - "src" : "33:19:1" - } - ], - "id" : 10, - "name" : "FunctionDefinition", - "src" : "13:39:1" - } - ], - "id" : 11, - "name" : "ContractDefinition", - "src" : "0:54:1" - } - ], - "id" : 12, - "name" : "SourceUnit", - "src" : "0:55:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "c": + [ + 11 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 11 + ], + "name": "c", + "scope": 12 + }, + "children": + [ + { + "attributes": + { + "documentation": null, + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": + [ + null + ], + "name": "f", + "scope": 11, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 1, + "name": "ParameterList", + "src": "23:2:1" + }, + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 2, + "name": "ParameterList", + "src": "33:0:1" + }, + { + "children": + [ + { + "attributes": + { + "assignments": + [ + 4 + ] + }, + "children": + [ + { + "attributes": + { + "constant": false, + "name": "a", + "scope": 9, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "name": "uint", + "type": "uint256" + }, + "id": 3, + "name": "ElementaryTypeName", + "src": "35:4:1" + } + ], + "id": 4, + "name": "VariableDeclaration", + "src": "35:6:1" + }, + { + "attributes": + { + "argumentTypes": null, + "commonType": + { + "typeIdentifier": "t_rational_5_by_1", + "typeString": "int_const 5" + }, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "operator": "+", + "type": "int_const 5" + }, + "children": + [ + { + "attributes": + { + "argumentTypes": null, + "hexvalue": "32", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 2", + "value": "2" + }, + "id": 5, + "name": "Literal", + "src": "44:1:1" + }, + { + "attributes": + { + "argumentTypes": null, + "hexvalue": "33", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 3", + "value": "3" + }, + "id": 6, + "name": "Literal", + "src": "48:1:1" + } + ], + "id": 7, + "name": "BinaryOperation", + "src": "44:5:1" + } + ], + "id": 8, + "name": "VariableDeclarationStatement", + "src": "35:14:1" + } + ], + "id": 9, + "name": "Block", + "src": "33:19:1" + } + ], + "id": 10, + "name": "FunctionDefinition", + "src": "13:39:1" + } + ], + "id": 11, + "name": "ContractDefinition", + "src": "0:54:1" + } + ], + "id": 12, + "name": "SourceUnit", + "src": "0:55:1" } diff --git a/test/libsolidity/ASTJSON/long_type_name_identifier.json b/test/libsolidity/ASTJSON/long_type_name_identifier.json index 505d260c4..8ac6ecaab 100644 --- a/test/libsolidity/ASTJSON/long_type_name_identifier.json +++ b/test/libsolidity/ASTJSON/long_type_name_identifier.json @@ -1,181 +1,181 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "c" : - [ - 14 - ] - }, - "id" : 15, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 14, - "linearizedBaseContracts" : - [ - 14 - ], - "name" : "c", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "constant" : false, - "id" : 3, - "name" : "a", - "nodeType" : "VariableDeclaration", - "scope" : 14, - "src" : "13:8:1", - "stateVariable" : true, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$dyn_storage", - "typeString" : "uint256[]" - }, - "typeName" : - { - "baseType" : - { - "id" : 1, - "name" : "uint", - "nodeType" : "ElementaryTypeName", - "src" : "13:4:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "id" : 2, - "length" : null, - "nodeType" : "ArrayTypeName", - "src" : "13:6:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$dyn_storage_ptr", - "typeString" : "uint256[]" - } - }, - "value" : null, - "visibility" : "internal" - }, - { - "body" : - { - "id" : 12, - "nodeType" : "Block", - "src" : "43:25:1", - "statements" : - [ - { - "assignments" : - [ - 9 - ], - "declarations" : - [ - { - "constant" : false, - "id" : 9, - "name" : "b", - "nodeType" : "VariableDeclaration", - "scope" : 12, - "src" : "45:16:1", - "stateVariable" : false, - "storageLocation" : "storage", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$dyn_storage_ptr", - "typeString" : "uint256[]" - }, - "typeName" : - { - "baseType" : - { - "id" : 7, - "name" : "uint", - "nodeType" : "ElementaryTypeName", - "src" : "45:4:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "id" : 8, - "length" : null, - "nodeType" : "ArrayTypeName", - "src" : "45:6:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$dyn_storage_ptr", - "typeString" : "uint256[]" - } - }, - "value" : null, - "visibility" : "internal" - } - ], - "id" : 11, - "initialValue" : - { - "argumentTypes" : null, - "id" : 10, - "name" : "a", - "nodeType" : "Identifier", - "overloadedDeclarations" : [], - "referencedDeclaration" : 3, - "src" : "64:1:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$dyn_storage", - "typeString" : "uint256[] storage ref" - } - }, - "nodeType" : "VariableDeclarationStatement", - "src" : "45:20:1" - } - ] - }, - "documentation" : null, - "id" : 13, - "implemented" : true, - "kind" : "function", - "modifiers" : [], - "name" : "f", - "nodeType" : "FunctionDefinition", - "parameters" : - { - "id" : 4, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "33:2:1" - }, - "returnParameters" : - { - "id" : 5, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "43:0:1" - }, - "scope" : 14, - "src" : "23:45:1", - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - } - ], - "scope" : 15, - "src" : "0:70:1" - } - ], - "src" : "0:71:1" + "absolutePath": "a", + "exportedSymbols": + { + "c": + [ + 14 + ] + }, + "id": 15, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 14, + "linearizedBaseContracts": + [ + 14 + ], + "name": "c", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "constant": false, + "id": 3, + "name": "a", + "nodeType": "VariableDeclaration", + "scope": 14, + "src": "13:8:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[]" + }, + "typeName": + { + "baseType": + { + "id": 1, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2, + "length": null, + "nodeType": "ArrayTypeName", + "src": "13:6:1", + "typeDescriptions": + { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "body": + { + "id": 12, + "nodeType": "Block", + "src": "43:25:1", + "statements": + [ + { + "assignments": + [ + 9 + ], + "declarations": + [ + { + "constant": false, + "id": 9, + "name": "b", + "nodeType": "VariableDeclaration", + "scope": 12, + "src": "45:16:1", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": + { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + }, + "typeName": + { + "baseType": + { + "id": 7, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "45:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 8, + "length": null, + "nodeType": "ArrayTypeName", + "src": "45:6:1", + "typeDescriptions": + { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 11, + "initialValue": + { + "argumentTypes": null, + "id": 10, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "64:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "45:20:1" + } + ] + }, + "documentation": null, + "id": 13, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 4, + "nodeType": "ParameterList", + "parameters": [], + "src": "33:2:1" + }, + "returnParameters": + { + "id": 5, + "nodeType": "ParameterList", + "parameters": [], + "src": "43:0:1" + }, + "scope": 14, + "src": "23:45:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 15, + "src": "0:70:1" + } + ], + "src": "0:71:1" } diff --git a/test/libsolidity/ASTJSON/long_type_name_identifier.sol b/test/libsolidity/ASTJSON/long_type_name_identifier.sol index f03f7a84d..60193cebb 100644 --- a/test/libsolidity/ASTJSON/long_type_name_identifier.sol +++ b/test/libsolidity/ASTJSON/long_type_name_identifier.sol @@ -1 +1,3 @@ contract c { uint[] a; function f() public { uint[] storage b = a; } } + +// ---- diff --git a/test/libsolidity/ASTJSON/long_type_name_identifier_legacy.json b/test/libsolidity/ASTJSON/long_type_name_identifier_legacy.json index d3bcda561..bfdb72f8d 100644 --- a/test/libsolidity/ASTJSON/long_type_name_identifier_legacy.json +++ b/test/libsolidity/ASTJSON/long_type_name_identifier_legacy.json @@ -1,220 +1,220 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "c" : - [ - 14 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 14 - ], - "name" : "c", - "scope" : 15 - }, - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "a", - "scope" : 14, - "stateVariable" : true, - "storageLocation" : "default", - "type" : "uint256[]", - "value" : null, - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "length" : null, - "type" : "uint256[]" - }, - "children" : - [ - { - "attributes" : - { - "name" : "uint", - "type" : "uint256" - }, - "id" : 1, - "name" : "ElementaryTypeName", - "src" : "13:4:1" - } - ], - "id" : 2, - "name" : "ArrayTypeName", - "src" : "13:6:1" - } - ], - "id" : 3, - "name" : "VariableDeclaration", - "src" : "13:8:1" - }, - { - "attributes" : - { - "documentation" : null, - "implemented" : true, - "isConstructor" : false, - "kind" : "function", - "modifiers" : - [ - null - ], - "name" : "f", - "scope" : 14, - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 4, - "name" : "ParameterList", - "src" : "33:2:1" - }, - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 5, - "name" : "ParameterList", - "src" : "43:0:1" - }, - { - "children" : - [ - { - "attributes" : - { - "assignments" : - [ - 9 - ] - }, - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "b", - "scope" : 12, - "stateVariable" : false, - "storageLocation" : "storage", - "type" : "uint256[]", - "value" : null, - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "length" : null, - "type" : "uint256[]" - }, - "children" : - [ - { - "attributes" : - { - "name" : "uint", - "type" : "uint256" - }, - "id" : 7, - "name" : "ElementaryTypeName", - "src" : "45:4:1" - } - ], - "id" : 8, - "name" : "ArrayTypeName", - "src" : "45:6:1" - } - ], - "id" : 9, - "name" : "VariableDeclaration", - "src" : "45:16:1" - }, - { - "attributes" : - { - "argumentTypes" : null, - "overloadedDeclarations" : - [ - null - ], - "referencedDeclaration" : 3, - "type" : "uint256[] storage ref", - "value" : "a" - }, - "id" : 10, - "name" : "Identifier", - "src" : "64:1:1" - } - ], - "id" : 11, - "name" : "VariableDeclarationStatement", - "src" : "45:20:1" - } - ], - "id" : 12, - "name" : "Block", - "src" : "43:25:1" - } - ], - "id" : 13, - "name" : "FunctionDefinition", - "src" : "23:45:1" - } - ], - "id" : 14, - "name" : "ContractDefinition", - "src" : "0:70:1" - } - ], - "id" : 15, - "name" : "SourceUnit", - "src" : "0:71:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "c": + [ + 14 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 14 + ], + "name": "c", + "scope": 15 + }, + "children": + [ + { + "attributes": + { + "constant": false, + "name": "a", + "scope": 14, + "stateVariable": true, + "storageLocation": "default", + "type": "uint256[]", + "value": null, + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "length": null, + "type": "uint256[]" + }, + "children": + [ + { + "attributes": + { + "name": "uint", + "type": "uint256" + }, + "id": 1, + "name": "ElementaryTypeName", + "src": "13:4:1" + } + ], + "id": 2, + "name": "ArrayTypeName", + "src": "13:6:1" + } + ], + "id": 3, + "name": "VariableDeclaration", + "src": "13:8:1" + }, + { + "attributes": + { + "documentation": null, + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": + [ + null + ], + "name": "f", + "scope": 14, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 4, + "name": "ParameterList", + "src": "33:2:1" + }, + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 5, + "name": "ParameterList", + "src": "43:0:1" + }, + { + "children": + [ + { + "attributes": + { + "assignments": + [ + 9 + ] + }, + "children": + [ + { + "attributes": + { + "constant": false, + "name": "b", + "scope": 12, + "stateVariable": false, + "storageLocation": "storage", + "type": "uint256[]", + "value": null, + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "length": null, + "type": "uint256[]" + }, + "children": + [ + { + "attributes": + { + "name": "uint", + "type": "uint256" + }, + "id": 7, + "name": "ElementaryTypeName", + "src": "45:4:1" + } + ], + "id": 8, + "name": "ArrayTypeName", + "src": "45:6:1" + } + ], + "id": 9, + "name": "VariableDeclaration", + "src": "45:16:1" + }, + { + "attributes": + { + "argumentTypes": null, + "overloadedDeclarations": + [ + null + ], + "referencedDeclaration": 3, + "type": "uint256[] storage ref", + "value": "a" + }, + "id": 10, + "name": "Identifier", + "src": "64:1:1" + } + ], + "id": 11, + "name": "VariableDeclarationStatement", + "src": "45:20:1" + } + ], + "id": 12, + "name": "Block", + "src": "43:25:1" + } + ], + "id": 13, + "name": "FunctionDefinition", + "src": "23:45:1" + } + ], + "id": 14, + "name": "ContractDefinition", + "src": "0:70:1" + } + ], + "id": 15, + "name": "SourceUnit", + "src": "0:71:1" } diff --git a/test/libsolidity/ASTJSON/modifier_definition.json b/test/libsolidity/ASTJSON/modifier_definition.json index 66359453c..b7eb257dd 100644 --- a/test/libsolidity/ASTJSON/modifier_definition.json +++ b/test/libsolidity/ASTJSON/modifier_definition.json @@ -1,174 +1,174 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 14 - ] - }, - "id" : 15, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 14, - "linearizedBaseContracts" : - [ - 14 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "body" : - { - "id" : 5, - "nodeType" : "Block", - "src" : "32:6:1", - "statements" : - [ - { - "id" : 4, - "nodeType" : "PlaceholderStatement", - "src" : "34:1:1" - } - ] - }, - "documentation" : null, - "id" : 6, - "name" : "M", - "nodeType" : "ModifierDefinition", - "parameters" : - { - "id" : 3, - "nodeType" : "ParameterList", - "parameters" : - [ - { - "constant" : false, - "id" : 2, - "name" : "i", - "nodeType" : "VariableDeclaration", - "scope" : 6, - "src" : "24:6:1", - "stateVariable" : false, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - }, - "typeName" : - { - "id" : 1, - "name" : "uint", - "nodeType" : "ElementaryTypeName", - "src" : "24:4:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "value" : null, - "visibility" : "internal" - } - ], - "src" : "23:8:1" - }, - "src" : "13:25:1", - "visibility" : "internal" - }, - { - "body" : - { - "id" : 12, - "nodeType" : "Block", - "src" : "64:2:1", - "statements" : [] - }, - "documentation" : null, - "id" : 13, - "implemented" : true, - "kind" : "function", - "modifiers" : - [ - { - "arguments" : - [ - { - "argumentTypes" : null, - "hexValue" : "31", - "id" : 9, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "number", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "54:1:1", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : "t_rational_1_by_1", - "typeString" : "int_const 1" - }, - "value" : "1" - } - ], - "id" : 10, - "modifierName" : - { - "argumentTypes" : null, - "id" : 8, - "name" : "M", - "nodeType" : "Identifier", - "overloadedDeclarations" : [], - "referencedDeclaration" : 6, - "src" : "52:1:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_modifier$_t_uint256_$", - "typeString" : "modifier (uint256)" - } - }, - "nodeType" : "ModifierInvocation", - "src" : "52:4:1" - } - ], - "name" : "F", - "nodeType" : "FunctionDefinition", - "parameters" : - { - "id" : 7, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "49:2:1" - }, - "returnParameters" : - { - "id" : 11, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "64:0:1" - }, - "scope" : 14, - "src" : "39:27:1", - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - } - ], - "scope" : 15, - "src" : "0:68:1" - } - ], - "src" : "0:69:1" + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 14 + ] + }, + "id": 15, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 14, + "linearizedBaseContracts": + [ + 14 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 5, + "nodeType": "Block", + "src": "32:6:1", + "statements": + [ + { + "id": 4, + "nodeType": "PlaceholderStatement", + "src": "34:1:1" + } + ] + }, + "documentation": null, + "id": 6, + "name": "M", + "nodeType": "ModifierDefinition", + "parameters": + { + "id": 3, + "nodeType": "ParameterList", + "parameters": + [ + { + "constant": false, + "id": 2, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 6, + "src": "24:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": + { + "id": 1, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "24:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "23:8:1" + }, + "src": "13:25:1", + "visibility": "internal" + }, + { + "body": + { + "id": 12, + "nodeType": "Block", + "src": "64:2:1", + "statements": [] + }, + "documentation": null, + "id": 13, + "implemented": true, + "kind": "function", + "modifiers": + [ + { + "arguments": + [ + { + "argumentTypes": null, + "hexValue": "31", + "id": 9, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "54:1:1", + "subdenomination": null, + "typeDescriptions": + { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + } + ], + "id": 10, + "modifierName": + { + "argumentTypes": null, + "id": 8, + "name": "M", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6, + "src": "52:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_modifier$_t_uint256_$", + "typeString": "modifier (uint256)" + } + }, + "nodeType": "ModifierInvocation", + "src": "52:4:1" + } + ], + "name": "F", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 7, + "nodeType": "ParameterList", + "parameters": [], + "src": "49:2:1" + }, + "returnParameters": + { + "id": 11, + "nodeType": "ParameterList", + "parameters": [], + "src": "64:0:1" + }, + "scope": 14, + "src": "39:27:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 15, + "src": "0:68:1" + } + ], + "src": "0:69:1" } diff --git a/test/libsolidity/ASTJSON/modifier_definition.sol b/test/libsolidity/ASTJSON/modifier_definition.sol index 96474e0f3..1dcdb5946 100644 --- a/test/libsolidity/ASTJSON/modifier_definition.sol +++ b/test/libsolidity/ASTJSON/modifier_definition.sol @@ -1 +1,3 @@ contract C { modifier M(uint i) { _; } function F() M(1) public {} } + +// ---- diff --git a/test/libsolidity/ASTJSON/modifier_definition_legacy.json b/test/libsolidity/ASTJSON/modifier_definition_legacy.json index 5186912c8..3aa67cd14 100644 --- a/test/libsolidity/ASTJSON/modifier_definition_legacy.json +++ b/test/libsolidity/ASTJSON/modifier_definition_legacy.json @@ -1,212 +1,212 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 14 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 14 - ], - "name" : "C", - "scope" : 15 - }, - "children" : - [ - { - "attributes" : - { - "documentation" : null, - "name" : "M", - "visibility" : "internal" - }, - "children" : - [ - { - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "i", - "scope" : 6, - "stateVariable" : false, - "storageLocation" : "default", - "type" : "uint256", - "value" : null, - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "name" : "uint", - "type" : "uint256" - }, - "id" : 1, - "name" : "ElementaryTypeName", - "src" : "24:4:1" - } - ], - "id" : 2, - "name" : "VariableDeclaration", - "src" : "24:6:1" - } - ], - "id" : 3, - "name" : "ParameterList", - "src" : "23:8:1" - }, - { - "children" : - [ - { - "id" : 4, - "name" : "PlaceholderStatement", - "src" : "34:1:1" - } - ], - "id" : 5, - "name" : "Block", - "src" : "32:6:1" - } - ], - "id" : 6, - "name" : "ModifierDefinition", - "src" : "13:25:1" - }, - { - "attributes" : - { - "documentation" : null, - "implemented" : true, - "isConstructor" : false, - "kind" : "function", - "name" : "F", - "scope" : 14, - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 7, - "name" : "ParameterList", - "src" : "49:2:1" - }, - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 11, - "name" : "ParameterList", - "src" : "64:0:1" - }, - { - "children" : - [ - { - "attributes" : - { - "argumentTypes" : null, - "overloadedDeclarations" : - [ - null - ], - "referencedDeclaration" : 6, - "type" : "modifier (uint256)", - "value" : "M" - }, - "id" : 8, - "name" : "Identifier", - "src" : "52:1:1" - }, - { - "attributes" : - { - "argumentTypes" : null, - "hexvalue" : "31", - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "lValueRequested" : false, - "subdenomination" : null, - "token" : "number", - "type" : "int_const 1", - "value" : "1" - }, - "id" : 9, - "name" : "Literal", - "src" : "54:1:1" - } - ], - "id" : 10, - "name" : "ModifierInvocation", - "src" : "52:4:1" - }, - { - "attributes" : - { - "statements" : - [ - null - ] - }, - "children" : [], - "id" : 12, - "name" : "Block", - "src" : "64:2:1" - } - ], - "id" : 13, - "name" : "FunctionDefinition", - "src" : "39:27:1" - } - ], - "id" : 14, - "name" : "ContractDefinition", - "src" : "0:68:1" - } - ], - "id" : 15, - "name" : "SourceUnit", - "src" : "0:69:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 14 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 14 + ], + "name": "C", + "scope": 15 + }, + "children": + [ + { + "attributes": + { + "documentation": null, + "name": "M", + "visibility": "internal" + }, + "children": + [ + { + "children": + [ + { + "attributes": + { + "constant": false, + "name": "i", + "scope": 6, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "name": "uint", + "type": "uint256" + }, + "id": 1, + "name": "ElementaryTypeName", + "src": "24:4:1" + } + ], + "id": 2, + "name": "VariableDeclaration", + "src": "24:6:1" + } + ], + "id": 3, + "name": "ParameterList", + "src": "23:8:1" + }, + { + "children": + [ + { + "id": 4, + "name": "PlaceholderStatement", + "src": "34:1:1" + } + ], + "id": 5, + "name": "Block", + "src": "32:6:1" + } + ], + "id": 6, + "name": "ModifierDefinition", + "src": "13:25:1" + }, + { + "attributes": + { + "documentation": null, + "implemented": true, + "isConstructor": false, + "kind": "function", + "name": "F", + "scope": 14, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 7, + "name": "ParameterList", + "src": "49:2:1" + }, + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 11, + "name": "ParameterList", + "src": "64:0:1" + }, + { + "children": + [ + { + "attributes": + { + "argumentTypes": null, + "overloadedDeclarations": + [ + null + ], + "referencedDeclaration": 6, + "type": "modifier (uint256)", + "value": "M" + }, + "id": 8, + "name": "Identifier", + "src": "52:1:1" + }, + { + "attributes": + { + "argumentTypes": null, + "hexvalue": "31", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 1", + "value": "1" + }, + "id": 9, + "name": "Literal", + "src": "54:1:1" + } + ], + "id": 10, + "name": "ModifierInvocation", + "src": "52:4:1" + }, + { + "attributes": + { + "statements": + [ + null + ] + }, + "children": [], + "id": 12, + "name": "Block", + "src": "64:2:1" + } + ], + "id": 13, + "name": "FunctionDefinition", + "src": "39:27:1" + } + ], + "id": 14, + "name": "ContractDefinition", + "src": "0:68:1" + } + ], + "id": 15, + "name": "SourceUnit", + "src": "0:69:1" } diff --git a/test/libsolidity/ASTJSON/modifier_invocation.json b/test/libsolidity/ASTJSON/modifier_invocation.json index 66359453c..b7eb257dd 100644 --- a/test/libsolidity/ASTJSON/modifier_invocation.json +++ b/test/libsolidity/ASTJSON/modifier_invocation.json @@ -1,174 +1,174 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 14 - ] - }, - "id" : 15, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 14, - "linearizedBaseContracts" : - [ - 14 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "body" : - { - "id" : 5, - "nodeType" : "Block", - "src" : "32:6:1", - "statements" : - [ - { - "id" : 4, - "nodeType" : "PlaceholderStatement", - "src" : "34:1:1" - } - ] - }, - "documentation" : null, - "id" : 6, - "name" : "M", - "nodeType" : "ModifierDefinition", - "parameters" : - { - "id" : 3, - "nodeType" : "ParameterList", - "parameters" : - [ - { - "constant" : false, - "id" : 2, - "name" : "i", - "nodeType" : "VariableDeclaration", - "scope" : 6, - "src" : "24:6:1", - "stateVariable" : false, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - }, - "typeName" : - { - "id" : 1, - "name" : "uint", - "nodeType" : "ElementaryTypeName", - "src" : "24:4:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "value" : null, - "visibility" : "internal" - } - ], - "src" : "23:8:1" - }, - "src" : "13:25:1", - "visibility" : "internal" - }, - { - "body" : - { - "id" : 12, - "nodeType" : "Block", - "src" : "64:2:1", - "statements" : [] - }, - "documentation" : null, - "id" : 13, - "implemented" : true, - "kind" : "function", - "modifiers" : - [ - { - "arguments" : - [ - { - "argumentTypes" : null, - "hexValue" : "31", - "id" : 9, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "number", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "54:1:1", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : "t_rational_1_by_1", - "typeString" : "int_const 1" - }, - "value" : "1" - } - ], - "id" : 10, - "modifierName" : - { - "argumentTypes" : null, - "id" : 8, - "name" : "M", - "nodeType" : "Identifier", - "overloadedDeclarations" : [], - "referencedDeclaration" : 6, - "src" : "52:1:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_modifier$_t_uint256_$", - "typeString" : "modifier (uint256)" - } - }, - "nodeType" : "ModifierInvocation", - "src" : "52:4:1" - } - ], - "name" : "F", - "nodeType" : "FunctionDefinition", - "parameters" : - { - "id" : 7, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "49:2:1" - }, - "returnParameters" : - { - "id" : 11, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "64:0:1" - }, - "scope" : 14, - "src" : "39:27:1", - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - } - ], - "scope" : 15, - "src" : "0:68:1" - } - ], - "src" : "0:69:1" + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 14 + ] + }, + "id": 15, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 14, + "linearizedBaseContracts": + [ + 14 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 5, + "nodeType": "Block", + "src": "32:6:1", + "statements": + [ + { + "id": 4, + "nodeType": "PlaceholderStatement", + "src": "34:1:1" + } + ] + }, + "documentation": null, + "id": 6, + "name": "M", + "nodeType": "ModifierDefinition", + "parameters": + { + "id": 3, + "nodeType": "ParameterList", + "parameters": + [ + { + "constant": false, + "id": 2, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 6, + "src": "24:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": + { + "id": 1, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "24:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "23:8:1" + }, + "src": "13:25:1", + "visibility": "internal" + }, + { + "body": + { + "id": 12, + "nodeType": "Block", + "src": "64:2:1", + "statements": [] + }, + "documentation": null, + "id": 13, + "implemented": true, + "kind": "function", + "modifiers": + [ + { + "arguments": + [ + { + "argumentTypes": null, + "hexValue": "31", + "id": 9, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "54:1:1", + "subdenomination": null, + "typeDescriptions": + { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + } + ], + "id": 10, + "modifierName": + { + "argumentTypes": null, + "id": 8, + "name": "M", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6, + "src": "52:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_modifier$_t_uint256_$", + "typeString": "modifier (uint256)" + } + }, + "nodeType": "ModifierInvocation", + "src": "52:4:1" + } + ], + "name": "F", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 7, + "nodeType": "ParameterList", + "parameters": [], + "src": "49:2:1" + }, + "returnParameters": + { + "id": 11, + "nodeType": "ParameterList", + "parameters": [], + "src": "64:0:1" + }, + "scope": 14, + "src": "39:27:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 15, + "src": "0:68:1" + } + ], + "src": "0:69:1" } diff --git a/test/libsolidity/ASTJSON/modifier_invocation.sol b/test/libsolidity/ASTJSON/modifier_invocation.sol index 96474e0f3..1dcdb5946 100644 --- a/test/libsolidity/ASTJSON/modifier_invocation.sol +++ b/test/libsolidity/ASTJSON/modifier_invocation.sol @@ -1 +1,3 @@ contract C { modifier M(uint i) { _; } function F() M(1) public {} } + +// ---- diff --git a/test/libsolidity/ASTJSON/modifier_invocation_legacy.json b/test/libsolidity/ASTJSON/modifier_invocation_legacy.json index 5186912c8..3aa67cd14 100644 --- a/test/libsolidity/ASTJSON/modifier_invocation_legacy.json +++ b/test/libsolidity/ASTJSON/modifier_invocation_legacy.json @@ -1,212 +1,212 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 14 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 14 - ], - "name" : "C", - "scope" : 15 - }, - "children" : - [ - { - "attributes" : - { - "documentation" : null, - "name" : "M", - "visibility" : "internal" - }, - "children" : - [ - { - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "i", - "scope" : 6, - "stateVariable" : false, - "storageLocation" : "default", - "type" : "uint256", - "value" : null, - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "name" : "uint", - "type" : "uint256" - }, - "id" : 1, - "name" : "ElementaryTypeName", - "src" : "24:4:1" - } - ], - "id" : 2, - "name" : "VariableDeclaration", - "src" : "24:6:1" - } - ], - "id" : 3, - "name" : "ParameterList", - "src" : "23:8:1" - }, - { - "children" : - [ - { - "id" : 4, - "name" : "PlaceholderStatement", - "src" : "34:1:1" - } - ], - "id" : 5, - "name" : "Block", - "src" : "32:6:1" - } - ], - "id" : 6, - "name" : "ModifierDefinition", - "src" : "13:25:1" - }, - { - "attributes" : - { - "documentation" : null, - "implemented" : true, - "isConstructor" : false, - "kind" : "function", - "name" : "F", - "scope" : 14, - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 7, - "name" : "ParameterList", - "src" : "49:2:1" - }, - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 11, - "name" : "ParameterList", - "src" : "64:0:1" - }, - { - "children" : - [ - { - "attributes" : - { - "argumentTypes" : null, - "overloadedDeclarations" : - [ - null - ], - "referencedDeclaration" : 6, - "type" : "modifier (uint256)", - "value" : "M" - }, - "id" : 8, - "name" : "Identifier", - "src" : "52:1:1" - }, - { - "attributes" : - { - "argumentTypes" : null, - "hexvalue" : "31", - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "lValueRequested" : false, - "subdenomination" : null, - "token" : "number", - "type" : "int_const 1", - "value" : "1" - }, - "id" : 9, - "name" : "Literal", - "src" : "54:1:1" - } - ], - "id" : 10, - "name" : "ModifierInvocation", - "src" : "52:4:1" - }, - { - "attributes" : - { - "statements" : - [ - null - ] - }, - "children" : [], - "id" : 12, - "name" : "Block", - "src" : "64:2:1" - } - ], - "id" : 13, - "name" : "FunctionDefinition", - "src" : "39:27:1" - } - ], - "id" : 14, - "name" : "ContractDefinition", - "src" : "0:68:1" - } - ], - "id" : 15, - "name" : "SourceUnit", - "src" : "0:69:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 14 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 14 + ], + "name": "C", + "scope": 15 + }, + "children": + [ + { + "attributes": + { + "documentation": null, + "name": "M", + "visibility": "internal" + }, + "children": + [ + { + "children": + [ + { + "attributes": + { + "constant": false, + "name": "i", + "scope": 6, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "name": "uint", + "type": "uint256" + }, + "id": 1, + "name": "ElementaryTypeName", + "src": "24:4:1" + } + ], + "id": 2, + "name": "VariableDeclaration", + "src": "24:6:1" + } + ], + "id": 3, + "name": "ParameterList", + "src": "23:8:1" + }, + { + "children": + [ + { + "id": 4, + "name": "PlaceholderStatement", + "src": "34:1:1" + } + ], + "id": 5, + "name": "Block", + "src": "32:6:1" + } + ], + "id": 6, + "name": "ModifierDefinition", + "src": "13:25:1" + }, + { + "attributes": + { + "documentation": null, + "implemented": true, + "isConstructor": false, + "kind": "function", + "name": "F", + "scope": 14, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 7, + "name": "ParameterList", + "src": "49:2:1" + }, + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 11, + "name": "ParameterList", + "src": "64:0:1" + }, + { + "children": + [ + { + "attributes": + { + "argumentTypes": null, + "overloadedDeclarations": + [ + null + ], + "referencedDeclaration": 6, + "type": "modifier (uint256)", + "value": "M" + }, + "id": 8, + "name": "Identifier", + "src": "52:1:1" + }, + { + "attributes": + { + "argumentTypes": null, + "hexvalue": "31", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 1", + "value": "1" + }, + "id": 9, + "name": "Literal", + "src": "54:1:1" + } + ], + "id": 10, + "name": "ModifierInvocation", + "src": "52:4:1" + }, + { + "attributes": + { + "statements": + [ + null + ] + }, + "children": [], + "id": 12, + "name": "Block", + "src": "64:2:1" + } + ], + "id": 13, + "name": "FunctionDefinition", + "src": "39:27:1" + } + ], + "id": 14, + "name": "ContractDefinition", + "src": "0:68:1" + } + ], + "id": 15, + "name": "SourceUnit", + "src": "0:69:1" } diff --git a/test/libsolidity/ASTJSON/non_utf8.json b/test/libsolidity/ASTJSON/non_utf8.json index 1852bd38f..1544c7715 100644 --- a/test/libsolidity/ASTJSON/non_utf8.json +++ b/test/libsolidity/ASTJSON/non_utf8.json @@ -1,122 +1,122 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 8 - ] - }, - "id" : 9, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 8, - "linearizedBaseContracts" : - [ - 8 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "body" : - { - "id" : 6, - "nodeType" : "Block", - "src" : "33:20:1", - "statements" : - [ - { - "assignments" : - [ - 3 - ], - "declarations" : - [ - { - "constant" : false, - "id" : 3, - "name" : "x", - "nodeType" : "VariableDeclaration", - "scope" : 6, - "src" : "35:5:1", - "stateVariable" : false, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_string_memory_ptr", - "typeString" : "string" - }, - "typeName" : null, - "value" : null, - "visibility" : "internal" - } - ], - "id" : 5, - "initialValue" : - { - "argumentTypes" : null, - "hexValue" : "ff", - "id" : 4, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "string", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "43:7:1", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : "t_stringliteral_8b1a944cf13a9a1c08facb2c9e98623ef3254d2ddb48113885c3e8e97fec8db9", - "typeString" : "literal_string (contains invalid UTF-8 sequence at position 0)" - }, - "value" : null - }, - "nodeType" : "VariableDeclarationStatement", - "src" : "35:15:1" - } - ] - }, - "documentation" : null, - "id" : 7, - "implemented" : true, - "kind" : "function", - "modifiers" : [], - "name" : "f", - "nodeType" : "FunctionDefinition", - "parameters" : - { - "id" : 1, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "23:2:1" - }, - "returnParameters" : - { - "id" : 2, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "33:0:1" - }, - "scope" : 8, - "src" : "13:40:1", - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - } - ], - "scope" : 9, - "src" : "0:55:1" - } - ], - "src" : "0:56:1" + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 8 + ] + }, + "id": 9, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 8, + "linearizedBaseContracts": + [ + 8 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 6, + "nodeType": "Block", + "src": "33:20:1", + "statements": + [ + { + "assignments": + [ + 3 + ], + "declarations": + [ + { + "constant": false, + "id": 3, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 6, + "src": "35:5:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": null, + "value": null, + "visibility": "internal" + } + ], + "id": 5, + "initialValue": + { + "argumentTypes": null, + "hexValue": "ff", + "id": 4, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "43:7:1", + "subdenomination": null, + "typeDescriptions": + { + "typeIdentifier": "t_stringliteral_8b1a944cf13a9a1c08facb2c9e98623ef3254d2ddb48113885c3e8e97fec8db9", + "typeString": "literal_string (contains invalid UTF-8 sequence at position 0)" + }, + "value": null + }, + "nodeType": "VariableDeclarationStatement", + "src": "35:15:1" + } + ] + }, + "documentation": null, + "id": 7, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "23:2:1" + }, + "returnParameters": + { + "id": 2, + "nodeType": "ParameterList", + "parameters": [], + "src": "33:0:1" + }, + "scope": 8, + "src": "13:40:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 9, + "src": "0:55:1" + } + ], + "src": "0:56:1" } diff --git a/test/libsolidity/ASTJSON/non_utf8.sol b/test/libsolidity/ASTJSON/non_utf8.sol index b83f3d706..f9a79d2fa 100644 --- a/test/libsolidity/ASTJSON/non_utf8.sol +++ b/test/libsolidity/ASTJSON/non_utf8.sol @@ -1 +1,3 @@ contract C { function f() public { var x = hex"ff"; } } + +// ---- diff --git a/test/libsolidity/ASTJSON/non_utf8_legacy.json b/test/libsolidity/ASTJSON/non_utf8_legacy.json index df1050966..438d4c3da 100644 --- a/test/libsolidity/ASTJSON/non_utf8_legacy.json +++ b/test/libsolidity/ASTJSON/non_utf8_legacy.json @@ -1,156 +1,156 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 8 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 8 - ], - "name" : "C", - "scope" : 9 - }, - "children" : - [ - { - "attributes" : - { - "documentation" : null, - "implemented" : true, - "isConstructor" : false, - "kind" : "function", - "modifiers" : - [ - null - ], - "name" : "f", - "scope" : 8, - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 1, - "name" : "ParameterList", - "src" : "23:2:1" - }, - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 2, - "name" : "ParameterList", - "src" : "33:0:1" - }, - { - "children" : - [ - { - "attributes" : - { - "assignments" : - [ - 3 - ] - }, - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "x", - "scope" : 6, - "stateVariable" : false, - "storageLocation" : "default", - "type" : "string", - "typeName" : null, - "value" : null, - "visibility" : "internal" - }, - "children" : [], - "id" : 3, - "name" : "VariableDeclaration", - "src" : "35:5:1" - }, - { - "attributes" : - { - "argumentTypes" : null, - "hexvalue" : "ff", - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "lValueRequested" : false, - "subdenomination" : null, - "token" : "string", - "type" : "literal_string (contains invalid UTF-8 sequence at position 0)", - "value" : null - }, - "id" : 4, - "name" : "Literal", - "src" : "43:7:1" - } - ], - "id" : 5, - "name" : "VariableDeclarationStatement", - "src" : "35:15:1" - } - ], - "id" : 6, - "name" : "Block", - "src" : "33:20:1" - } - ], - "id" : 7, - "name" : "FunctionDefinition", - "src" : "13:40:1" - } - ], - "id" : 8, - "name" : "ContractDefinition", - "src" : "0:55:1" - } - ], - "id" : 9, - "name" : "SourceUnit", - "src" : "0:56:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 8 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 8 + ], + "name": "C", + "scope": 9 + }, + "children": + [ + { + "attributes": + { + "documentation": null, + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": + [ + null + ], + "name": "f", + "scope": 8, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 1, + "name": "ParameterList", + "src": "23:2:1" + }, + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 2, + "name": "ParameterList", + "src": "33:0:1" + }, + { + "children": + [ + { + "attributes": + { + "assignments": + [ + 3 + ] + }, + "children": + [ + { + "attributes": + { + "constant": false, + "name": "x", + "scope": 6, + "stateVariable": false, + "storageLocation": "default", + "type": "string", + "typeName": null, + "value": null, + "visibility": "internal" + }, + "children": [], + "id": 3, + "name": "VariableDeclaration", + "src": "35:5:1" + }, + { + "attributes": + { + "argumentTypes": null, + "hexvalue": "ff", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "string", + "type": "literal_string (contains invalid UTF-8 sequence at position 0)", + "value": null + }, + "id": 4, + "name": "Literal", + "src": "43:7:1" + } + ], + "id": 5, + "name": "VariableDeclarationStatement", + "src": "35:15:1" + } + ], + "id": 6, + "name": "Block", + "src": "33:20:1" + } + ], + "id": 7, + "name": "FunctionDefinition", + "src": "13:40:1" + } + ], + "id": 8, + "name": "ContractDefinition", + "src": "0:55:1" + } + ], + "id": 9, + "name": "SourceUnit", + "src": "0:56:1" } diff --git a/test/libsolidity/ASTJSON/placeholder_statement.json b/test/libsolidity/ASTJSON/placeholder_statement.json index 496e15001..1a7b005dc 100644 --- a/test/libsolidity/ASTJSON/placeholder_statement.json +++ b/test/libsolidity/ASTJSON/placeholder_statement.json @@ -1,64 +1,64 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 5 - ] - }, - "id" : 6, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 5, - "linearizedBaseContracts" : - [ - 5 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "body" : - { - "id" : 3, - "nodeType" : "Block", - "src" : "24:6:1", - "statements" : - [ - { - "id" : 2, - "nodeType" : "PlaceholderStatement", - "src" : "26:1:1" - } - ] - }, - "documentation" : null, - "id" : 4, - "name" : "M", - "nodeType" : "ModifierDefinition", - "parameters" : - { - "id" : 1, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "24:0:1" - }, - "src" : "13:17:1", - "visibility" : "internal" - } - ], - "scope" : 6, - "src" : "0:32:1" - } - ], - "src" : "0:33:1" + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 5 + ] + }, + "id": 6, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 5, + "linearizedBaseContracts": + [ + 5 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 3, + "nodeType": "Block", + "src": "24:6:1", + "statements": + [ + { + "id": 2, + "nodeType": "PlaceholderStatement", + "src": "26:1:1" + } + ] + }, + "documentation": null, + "id": 4, + "name": "M", + "nodeType": "ModifierDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "24:0:1" + }, + "src": "13:17:1", + "visibility": "internal" + } + ], + "scope": 6, + "src": "0:32:1" + } + ], + "src": "0:33:1" } diff --git a/test/libsolidity/ASTJSON/placeholder_statement.sol b/test/libsolidity/ASTJSON/placeholder_statement.sol index cb2c0990d..22a719fa4 100644 --- a/test/libsolidity/ASTJSON/placeholder_statement.sol +++ b/test/libsolidity/ASTJSON/placeholder_statement.sol @@ -1 +1,3 @@ contract C { modifier M { _; } } + +// ---- diff --git a/test/libsolidity/ASTJSON/placeholder_statement_legacy.json b/test/libsolidity/ASTJSON/placeholder_statement_legacy.json index a55829762..8b79618f2 100644 --- a/test/libsolidity/ASTJSON/placeholder_statement_legacy.json +++ b/test/libsolidity/ASTJSON/placeholder_statement_legacy.json @@ -1,87 +1,87 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 5 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 5 - ], - "name" : "C", - "scope" : 6 - }, - "children" : - [ - { - "attributes" : - { - "documentation" : null, - "name" : "M", - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 1, - "name" : "ParameterList", - "src" : "24:0:1" - }, - { - "children" : - [ - { - "id" : 2, - "name" : "PlaceholderStatement", - "src" : "26:1:1" - } - ], - "id" : 3, - "name" : "Block", - "src" : "24:6:1" - } - ], - "id" : 4, - "name" : "ModifierDefinition", - "src" : "13:17:1" - } - ], - "id" : 5, - "name" : "ContractDefinition", - "src" : "0:32:1" - } - ], - "id" : 6, - "name" : "SourceUnit", - "src" : "0:33:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 5 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 5 + ], + "name": "C", + "scope": 6 + }, + "children": + [ + { + "attributes": + { + "documentation": null, + "name": "M", + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 1, + "name": "ParameterList", + "src": "24:0:1" + }, + { + "children": + [ + { + "id": 2, + "name": "PlaceholderStatement", + "src": "26:1:1" + } + ], + "id": 3, + "name": "Block", + "src": "24:6:1" + } + ], + "id": 4, + "name": "ModifierDefinition", + "src": "13:17:1" + } + ], + "id": 5, + "name": "ContractDefinition", + "src": "0:32:1" + } + ], + "id": 6, + "name": "SourceUnit", + "src": "0:33:1" } diff --git a/test/libsolidity/ASTJSON/short_type_name.json b/test/libsolidity/ASTJSON/short_type_name.json index acb461571..41921c0af 100644 --- a/test/libsolidity/ASTJSON/short_type_name.json +++ b/test/libsolidity/ASTJSON/short_type_name.json @@ -1,126 +1,126 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "c" : - [ - 10 - ] - }, - "id" : 11, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 10, - "linearizedBaseContracts" : - [ - 10 - ], - "name" : "c", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "body" : - { - "id" : 8, - "nodeType" : "Block", - "src" : "33:20:1", - "statements" : - [ - { - "assignments" : - [ - 6 - ], - "declarations" : - [ - { - "constant" : false, - "id" : 6, - "name" : "x", - "nodeType" : "VariableDeclaration", - "scope" : 8, - "src" : "35:15:1", - "stateVariable" : false, - "storageLocation" : "memory", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$dyn_memory_ptr", - "typeString" : "uint256[]" - }, - "typeName" : - { - "baseType" : - { - "id" : 4, - "name" : "uint", - "nodeType" : "ElementaryTypeName", - "src" : "35:4:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "id" : 5, - "length" : null, - "nodeType" : "ArrayTypeName", - "src" : "35:6:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$dyn_storage_ptr", - "typeString" : "uint256[]" - } - }, - "value" : null, - "visibility" : "internal" - } - ], - "id" : 7, - "initialValue" : null, - "nodeType" : "VariableDeclarationStatement", - "src" : "35:15:1" - } - ] - }, - "documentation" : null, - "id" : 9, - "implemented" : true, - "kind" : "function", - "modifiers" : [], - "name" : "f", - "nodeType" : "FunctionDefinition", - "parameters" : - { - "id" : 1, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "23:2:1" - }, - "returnParameters" : - { - "id" : 2, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "33:0:1" - }, - "scope" : 10, - "src" : "13:40:1", - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - } - ], - "scope" : 11, - "src" : "0:55:1" - } - ], - "src" : "0:56:1" + "absolutePath": "a", + "exportedSymbols": + { + "c": + [ + 10 + ] + }, + "id": 11, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 10, + "linearizedBaseContracts": + [ + 10 + ], + "name": "c", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 8, + "nodeType": "Block", + "src": "33:20:1", + "statements": + [ + { + "assignments": + [ + 6 + ], + "declarations": + [ + { + "constant": false, + "id": 6, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 8, + "src": "35:15:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": + { + "baseType": + { + "id": 4, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "35:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 5, + "length": null, + "nodeType": "ArrayTypeName", + "src": "35:6:1", + "typeDescriptions": + { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 7, + "initialValue": null, + "nodeType": "VariableDeclarationStatement", + "src": "35:15:1" + } + ] + }, + "documentation": null, + "id": 9, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "23:2:1" + }, + "returnParameters": + { + "id": 2, + "nodeType": "ParameterList", + "parameters": [], + "src": "33:0:1" + }, + "scope": 10, + "src": "13:40:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 11, + "src": "0:55:1" + } + ], + "src": "0:56:1" } diff --git a/test/libsolidity/ASTJSON/short_type_name.sol b/test/libsolidity/ASTJSON/short_type_name.sol index 533874ae4..077e715b9 100644 --- a/test/libsolidity/ASTJSON/short_type_name.sol +++ b/test/libsolidity/ASTJSON/short_type_name.sol @@ -1 +1,3 @@ contract c { function f() public { uint[] memory x; } } + +// ---- diff --git a/test/libsolidity/ASTJSON/short_type_name_legacy.json b/test/libsolidity/ASTJSON/short_type_name_legacy.json index 1f9b19687..20219d809 100644 --- a/test/libsolidity/ASTJSON/short_type_name_legacy.json +++ b/test/libsolidity/ASTJSON/short_type_name_legacy.json @@ -1,163 +1,163 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "c" : - [ - 10 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 10 - ], - "name" : "c", - "scope" : 11 - }, - "children" : - [ - { - "attributes" : - { - "documentation" : null, - "implemented" : true, - "isConstructor" : false, - "kind" : "function", - "modifiers" : - [ - null - ], - "name" : "f", - "scope" : 10, - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 1, - "name" : "ParameterList", - "src" : "23:2:1" - }, - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 2, - "name" : "ParameterList", - "src" : "33:0:1" - }, - { - "children" : - [ - { - "attributes" : - { - "assignments" : - [ - 6 - ], - "initialValue" : null - }, - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "x", - "scope" : 8, - "stateVariable" : false, - "storageLocation" : "memory", - "type" : "uint256[]", - "value" : null, - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "length" : null, - "type" : "uint256[]" - }, - "children" : - [ - { - "attributes" : - { - "name" : "uint", - "type" : "uint256" - }, - "id" : 4, - "name" : "ElementaryTypeName", - "src" : "35:4:1" - } - ], - "id" : 5, - "name" : "ArrayTypeName", - "src" : "35:6:1" - } - ], - "id" : 6, - "name" : "VariableDeclaration", - "src" : "35:15:1" - } - ], - "id" : 7, - "name" : "VariableDeclarationStatement", - "src" : "35:15:1" - } - ], - "id" : 8, - "name" : "Block", - "src" : "33:20:1" - } - ], - "id" : 9, - "name" : "FunctionDefinition", - "src" : "13:40:1" - } - ], - "id" : 10, - "name" : "ContractDefinition", - "src" : "0:55:1" - } - ], - "id" : 11, - "name" : "SourceUnit", - "src" : "0:56:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "c": + [ + 10 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 10 + ], + "name": "c", + "scope": 11 + }, + "children": + [ + { + "attributes": + { + "documentation": null, + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": + [ + null + ], + "name": "f", + "scope": 10, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 1, + "name": "ParameterList", + "src": "23:2:1" + }, + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 2, + "name": "ParameterList", + "src": "33:0:1" + }, + { + "children": + [ + { + "attributes": + { + "assignments": + [ + 6 + ], + "initialValue": null + }, + "children": + [ + { + "attributes": + { + "constant": false, + "name": "x", + "scope": 8, + "stateVariable": false, + "storageLocation": "memory", + "type": "uint256[]", + "value": null, + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "length": null, + "type": "uint256[]" + }, + "children": + [ + { + "attributes": + { + "name": "uint", + "type": "uint256" + }, + "id": 4, + "name": "ElementaryTypeName", + "src": "35:4:1" + } + ], + "id": 5, + "name": "ArrayTypeName", + "src": "35:6:1" + } + ], + "id": 6, + "name": "VariableDeclaration", + "src": "35:15:1" + } + ], + "id": 7, + "name": "VariableDeclarationStatement", + "src": "35:15:1" + } + ], + "id": 8, + "name": "Block", + "src": "33:20:1" + } + ], + "id": 9, + "name": "FunctionDefinition", + "src": "13:40:1" + } + ], + "id": 10, + "name": "ContractDefinition", + "src": "0:55:1" + } + ], + "id": 11, + "name": "SourceUnit", + "src": "0:56:1" } diff --git a/test/libsolidity/ASTJSON/short_type_name_ref.json b/test/libsolidity/ASTJSON/short_type_name_ref.json index b6b7bca5d..22df04355 100644 --- a/test/libsolidity/ASTJSON/short_type_name_ref.json +++ b/test/libsolidity/ASTJSON/short_type_name_ref.json @@ -1,138 +1,138 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "c" : - [ - 11 - ] - }, - "id" : 12, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 11, - "linearizedBaseContracts" : - [ - 11 - ], - "name" : "c", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "body" : - { - "id" : 9, - "nodeType" : "Block", - "src" : "33:25:1", - "statements" : - [ - { - "assignments" : - [ - 7 - ], - "declarations" : - [ - { - "constant" : false, - "id" : 7, - "name" : "rows", - "nodeType" : "VariableDeclaration", - "scope" : 9, - "src" : "35:20:1", - "stateVariable" : false, - "storageLocation" : "memory", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_array$_t_uint256_$dyn_memory_$dyn_memory_ptr", - "typeString" : "uint256[][]" - }, - "typeName" : - { - "baseType" : - { - "baseType" : - { - "id" : 4, - "name" : "uint", - "nodeType" : "ElementaryTypeName", - "src" : "35:4:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - }, - "id" : 5, - "length" : null, - "nodeType" : "ArrayTypeName", - "src" : "35:6:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_uint256_$dyn_storage_ptr", - "typeString" : "uint256[]" - } - }, - "id" : 6, - "length" : null, - "nodeType" : "ArrayTypeName", - "src" : "35:8:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_array$_t_array$_t_uint256_$dyn_storage_$dyn_storage_ptr", - "typeString" : "uint256[][]" - } - }, - "value" : null, - "visibility" : "internal" - } - ], - "id" : 8, - "initialValue" : null, - "nodeType" : "VariableDeclarationStatement", - "src" : "35:20:1" - } - ] - }, - "documentation" : null, - "id" : 10, - "implemented" : true, - "kind" : "function", - "modifiers" : [], - "name" : "f", - "nodeType" : "FunctionDefinition", - "parameters" : - { - "id" : 1, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "23:2:1" - }, - "returnParameters" : - { - "id" : 2, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "33:0:1" - }, - "scope" : 11, - "src" : "13:45:1", - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - } - ], - "scope" : 12, - "src" : "0:60:1" - } - ], - "src" : "0:61:1" + "absolutePath": "a", + "exportedSymbols": + { + "c": + [ + 11 + ] + }, + "id": 12, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 11, + "linearizedBaseContracts": + [ + 11 + ], + "name": "c", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 9, + "nodeType": "Block", + "src": "33:25:1", + "statements": + [ + { + "assignments": + [ + 7 + ], + "declarations": + [ + { + "constant": false, + "id": 7, + "name": "rows", + "nodeType": "VariableDeclaration", + "scope": 9, + "src": "35:20:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": + { + "typeIdentifier": "t_array$_t_array$_t_uint256_$dyn_memory_$dyn_memory_ptr", + "typeString": "uint256[][]" + }, + "typeName": + { + "baseType": + { + "baseType": + { + "id": 4, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "35:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 5, + "length": null, + "nodeType": "ArrayTypeName", + "src": "35:6:1", + "typeDescriptions": + { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "id": 6, + "length": null, + "nodeType": "ArrayTypeName", + "src": "35:8:1", + "typeDescriptions": + { + "typeIdentifier": "t_array$_t_array$_t_uint256_$dyn_storage_$dyn_storage_ptr", + "typeString": "uint256[][]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 8, + "initialValue": null, + "nodeType": "VariableDeclarationStatement", + "src": "35:20:1" + } + ] + }, + "documentation": null, + "id": 10, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "23:2:1" + }, + "returnParameters": + { + "id": 2, + "nodeType": "ParameterList", + "parameters": [], + "src": "33:0:1" + }, + "scope": 11, + "src": "13:45:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 12, + "src": "0:60:1" + } + ], + "src": "0:61:1" } diff --git a/test/libsolidity/ASTJSON/short_type_name_ref.sol b/test/libsolidity/ASTJSON/short_type_name_ref.sol index a808b982b..9128d69d6 100644 --- a/test/libsolidity/ASTJSON/short_type_name_ref.sol +++ b/test/libsolidity/ASTJSON/short_type_name_ref.sol @@ -1 +1,3 @@ contract c { function f() public { uint[][] memory rows; } } + +// ---- diff --git a/test/libsolidity/ASTJSON/short_type_name_ref_legacy.json b/test/libsolidity/ASTJSON/short_type_name_ref_legacy.json index 420b0f609..ce9178a79 100644 --- a/test/libsolidity/ASTJSON/short_type_name_ref_legacy.json +++ b/test/libsolidity/ASTJSON/short_type_name_ref_legacy.json @@ -1,176 +1,176 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "c" : - [ - 11 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 11 - ], - "name" : "c", - "scope" : 12 - }, - "children" : - [ - { - "attributes" : - { - "documentation" : null, - "implemented" : true, - "isConstructor" : false, - "kind" : "function", - "modifiers" : - [ - null - ], - "name" : "f", - "scope" : 11, - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 1, - "name" : "ParameterList", - "src" : "23:2:1" - }, - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 2, - "name" : "ParameterList", - "src" : "33:0:1" - }, - { - "children" : - [ - { - "attributes" : - { - "assignments" : - [ - 7 - ], - "initialValue" : null - }, - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "rows", - "scope" : 9, - "stateVariable" : false, - "storageLocation" : "memory", - "type" : "uint256[][]", - "value" : null, - "visibility" : "internal" - }, - "children" : - [ - { - "attributes" : - { - "length" : null, - "type" : "uint256[][]" - }, - "children" : - [ - { - "attributes" : - { - "length" : null, - "type" : "uint256[]" - }, - "children" : - [ - { - "attributes" : - { - "name" : "uint", - "type" : "uint256" - }, - "id" : 4, - "name" : "ElementaryTypeName", - "src" : "35:4:1" - } - ], - "id" : 5, - "name" : "ArrayTypeName", - "src" : "35:6:1" - } - ], - "id" : 6, - "name" : "ArrayTypeName", - "src" : "35:8:1" - } - ], - "id" : 7, - "name" : "VariableDeclaration", - "src" : "35:20:1" - } - ], - "id" : 8, - "name" : "VariableDeclarationStatement", - "src" : "35:20:1" - } - ], - "id" : 9, - "name" : "Block", - "src" : "33:25:1" - } - ], - "id" : 10, - "name" : "FunctionDefinition", - "src" : "13:45:1" - } - ], - "id" : 11, - "name" : "ContractDefinition", - "src" : "0:60:1" - } - ], - "id" : 12, - "name" : "SourceUnit", - "src" : "0:61:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "c": + [ + 11 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 11 + ], + "name": "c", + "scope": 12 + }, + "children": + [ + { + "attributes": + { + "documentation": null, + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": + [ + null + ], + "name": "f", + "scope": 11, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 1, + "name": "ParameterList", + "src": "23:2:1" + }, + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 2, + "name": "ParameterList", + "src": "33:0:1" + }, + { + "children": + [ + { + "attributes": + { + "assignments": + [ + 7 + ], + "initialValue": null + }, + "children": + [ + { + "attributes": + { + "constant": false, + "name": "rows", + "scope": 9, + "stateVariable": false, + "storageLocation": "memory", + "type": "uint256[][]", + "value": null, + "visibility": "internal" + }, + "children": + [ + { + "attributes": + { + "length": null, + "type": "uint256[][]" + }, + "children": + [ + { + "attributes": + { + "length": null, + "type": "uint256[]" + }, + "children": + [ + { + "attributes": + { + "name": "uint", + "type": "uint256" + }, + "id": 4, + "name": "ElementaryTypeName", + "src": "35:4:1" + } + ], + "id": 5, + "name": "ArrayTypeName", + "src": "35:6:1" + } + ], + "id": 6, + "name": "ArrayTypeName", + "src": "35:8:1" + } + ], + "id": 7, + "name": "VariableDeclaration", + "src": "35:20:1" + } + ], + "id": 8, + "name": "VariableDeclarationStatement", + "src": "35:20:1" + } + ], + "id": 9, + "name": "Block", + "src": "33:25:1" + } + ], + "id": 10, + "name": "FunctionDefinition", + "src": "13:45:1" + } + ], + "id": 11, + "name": "ContractDefinition", + "src": "0:60:1" + } + ], + "id": 12, + "name": "SourceUnit", + "src": "0:61:1" } diff --git a/test/libsolidity/ASTJSON/smoke.json b/test/libsolidity/ASTJSON/smoke.json index f5369bfc8..039ad3750 100644 --- a/test/libsolidity/ASTJSON/smoke.json +++ b/test/libsolidity/ASTJSON/smoke.json @@ -1,33 +1,33 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 1 - ] - }, - "id" : 2, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 1, - "linearizedBaseContracts" : - [ - 1 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : [], - "scope" : 2, - "src" : "0:13:1" - } - ], - "src" : "0:14:1" + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 1 + ] + }, + "id": 2, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 1, + "linearizedBaseContracts": + [ + 1 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": [], + "scope": 2, + "src": "0:13:1" + } + ], + "src": "0:14:1" } diff --git a/test/libsolidity/ASTJSON/smoke.sol b/test/libsolidity/ASTJSON/smoke.sol index 2dde0d209..3796bf807 100644 --- a/test/libsolidity/ASTJSON/smoke.sol +++ b/test/libsolidity/ASTJSON/smoke.sol @@ -1 +1,3 @@ contract C {} + +// ---- diff --git a/test/libsolidity/ASTJSON/smoke_legacy.json b/test/libsolidity/ASTJSON/smoke_legacy.json index e01a3c9b2..0cb99ef43 100644 --- a/test/libsolidity/ASTJSON/smoke_legacy.json +++ b/test/libsolidity/ASTJSON/smoke_legacy.json @@ -1,48 +1,48 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 1 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 1 - ], - "name" : "C", - "nodes" : - [ - null - ], - "scope" : 2 - }, - "id" : 1, - "name" : "ContractDefinition", - "src" : "0:13:1" - } - ], - "id" : 2, - "name" : "SourceUnit", - "src" : "0:14:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 1 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 1 + ], + "name": "C", + "nodes": + [ + null + ], + "scope": 2 + }, + "id": 1, + "name": "ContractDefinition", + "src": "0:13:1" + } + ], + "id": 2, + "name": "SourceUnit", + "src": "0:14:1" } diff --git a/test/libsolidity/ASTJSON/source_location.json b/test/libsolidity/ASTJSON/source_location.json index f0ed216db..c64cc115b 100644 --- a/test/libsolidity/ASTJSON/source_location.json +++ b/test/libsolidity/ASTJSON/source_location.json @@ -1,160 +1,160 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 11 - ] - }, - "id" : 12, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 11, - "linearizedBaseContracts" : - [ - 11 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "body" : - { - "id" : 9, - "nodeType" : "Block", - "src" : "26:19:1", - "statements" : - [ - { - "assignments" : - [ - 3 - ], - "declarations" : - [ - { - "constant" : false, - "id" : 3, - "name" : "x", - "nodeType" : "VariableDeclaration", - "scope" : 9, - "src" : "28:5:1", - "stateVariable" : false, - "storageLocation" : "default", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint8", - "typeString" : "uint8" - }, - "typeName" : null, - "value" : null, - "visibility" : "internal" - } - ], - "id" : 5, - "initialValue" : - { - "argumentTypes" : null, - "hexValue" : "32", - "id" : 4, - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "kind" : "number", - "lValueRequested" : false, - "nodeType" : "Literal", - "src" : "36:1:1", - "subdenomination" : null, - "typeDescriptions" : - { - "typeIdentifier" : "t_rational_2_by_1", - "typeString" : "int_const 2" - }, - "value" : "2" - }, - "nodeType" : "VariableDeclarationStatement", - "src" : "28:9:1" - }, - { - "expression" : - { - "argumentTypes" : null, - "id" : 7, - "isConstant" : false, - "isLValue" : false, - "isPure" : false, - "lValueRequested" : false, - "nodeType" : "UnaryOperation", - "operator" : "++", - "prefix" : false, - "src" : "39:3:1", - "subExpression" : - { - "argumentTypes" : null, - "id" : 6, - "name" : "x", - "nodeType" : "Identifier", - "overloadedDeclarations" : [], - "referencedDeclaration" : 3, - "src" : "39:1:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint8", - "typeString" : "uint8" - } - }, - "typeDescriptions" : - { - "typeIdentifier" : "t_uint8", - "typeString" : "uint8" - } - }, - "id" : 8, - "nodeType" : "ExpressionStatement", - "src" : "39:3:1" - } - ] - }, - "documentation" : null, - "id" : 10, - "implemented" : true, - "kind" : "function", - "modifiers" : [], - "name" : "f", - "nodeType" : "FunctionDefinition", - "parameters" : - { - "id" : 1, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "23:2:1" - }, - "returnParameters" : - { - "id" : 2, - "nodeType" : "ParameterList", - "parameters" : [], - "src" : "26:0:1" - }, - "scope" : 11, - "src" : "13:32:1", - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - } - ], - "scope" : 12, - "src" : "0:47:1" - } - ], - "src" : "0:48:1" + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 11 + ] + }, + "id": 12, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 11, + "linearizedBaseContracts": + [ + 11 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 9, + "nodeType": "Block", + "src": "26:19:1", + "statements": + [ + { + "assignments": + [ + 3 + ], + "declarations": + [ + { + "constant": false, + "id": 3, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 9, + "src": "28:5:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": null, + "value": null, + "visibility": "internal" + } + ], + "id": 5, + "initialValue": + { + "argumentTypes": null, + "hexValue": "32", + "id": 4, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "36:1:1", + "subdenomination": null, + "typeDescriptions": + { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "VariableDeclarationStatement", + "src": "28:9:1" + }, + { + "expression": + { + "argumentTypes": null, + "id": 7, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "39:3:1", + "subExpression": + { + "argumentTypes": null, + "id": 6, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "39:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "typeDescriptions": + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "id": 8, + "nodeType": "ExpressionStatement", + "src": "39:3:1" + } + ] + }, + "documentation": null, + "id": 10, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "23:2:1" + }, + "returnParameters": + { + "id": 2, + "nodeType": "ParameterList", + "parameters": [], + "src": "26:0:1" + }, + "scope": 11, + "src": "13:32:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 12, + "src": "0:47:1" + } + ], + "src": "0:48:1" } diff --git a/test/libsolidity/ASTJSON/source_location.sol b/test/libsolidity/ASTJSON/source_location.sol index 1fcec2e66..1b763646d 100644 --- a/test/libsolidity/ASTJSON/source_location.sol +++ b/test/libsolidity/ASTJSON/source_location.sol @@ -1 +1,3 @@ contract C { function f() { var x = 2; x++; } } + +// ---- diff --git a/test/libsolidity/ASTJSON/source_location_legacy.json b/test/libsolidity/ASTJSON/source_location_legacy.json index a65979d66..4b48233da 100644 --- a/test/libsolidity/ASTJSON/source_location_legacy.json +++ b/test/libsolidity/ASTJSON/source_location_legacy.json @@ -1,199 +1,199 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 11 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 11 - ], - "name" : "C", - "scope" : 12 - }, - "children" : - [ - { - "attributes" : - { - "documentation" : null, - "implemented" : true, - "isConstructor" : false, - "kind" : "function", - "modifiers" : - [ - null - ], - "name" : "f", - "scope" : 11, - "stateMutability" : "nonpayable", - "superFunction" : null, - "visibility" : "public" - }, - "children" : - [ - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 1, - "name" : "ParameterList", - "src" : "23:2:1" - }, - { - "attributes" : - { - "parameters" : - [ - null - ] - }, - "children" : [], - "id" : 2, - "name" : "ParameterList", - "src" : "26:0:1" - }, - { - "children" : - [ - { - "attributes" : - { - "assignments" : - [ - 3 - ] - }, - "children" : - [ - { - "attributes" : - { - "constant" : false, - "name" : "x", - "scope" : 9, - "stateVariable" : false, - "storageLocation" : "default", - "type" : "uint8", - "typeName" : null, - "value" : null, - "visibility" : "internal" - }, - "children" : [], - "id" : 3, - "name" : "VariableDeclaration", - "src" : "28:5:1" - }, - { - "attributes" : - { - "argumentTypes" : null, - "hexvalue" : "32", - "isConstant" : false, - "isLValue" : false, - "isPure" : true, - "lValueRequested" : false, - "subdenomination" : null, - "token" : "number", - "type" : "int_const 2", - "value" : "2" - }, - "id" : 4, - "name" : "Literal", - "src" : "36:1:1" - } - ], - "id" : 5, - "name" : "VariableDeclarationStatement", - "src" : "28:9:1" - }, - { - "children" : - [ - { - "attributes" : - { - "argumentTypes" : null, - "isConstant" : false, - "isLValue" : false, - "isPure" : false, - "lValueRequested" : false, - "operator" : "++", - "prefix" : false, - "type" : "uint8" - }, - "children" : - [ - { - "attributes" : - { - "argumentTypes" : null, - "overloadedDeclarations" : - [ - null - ], - "referencedDeclaration" : 3, - "type" : "uint8", - "value" : "x" - }, - "id" : 6, - "name" : "Identifier", - "src" : "39:1:1" - } - ], - "id" : 7, - "name" : "UnaryOperation", - "src" : "39:3:1" - } - ], - "id" : 8, - "name" : "ExpressionStatement", - "src" : "39:3:1" - } - ], - "id" : 9, - "name" : "Block", - "src" : "26:19:1" - } - ], - "id" : 10, - "name" : "FunctionDefinition", - "src" : "13:32:1" - } - ], - "id" : 11, - "name" : "ContractDefinition", - "src" : "0:47:1" - } - ], - "id" : 12, - "name" : "SourceUnit", - "src" : "0:48:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 11 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 11 + ], + "name": "C", + "scope": 12 + }, + "children": + [ + { + "attributes": + { + "documentation": null, + "implemented": true, + "isConstructor": false, + "kind": "function", + "modifiers": + [ + null + ], + "name": "f", + "scope": 11, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": + [ + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 1, + "name": "ParameterList", + "src": "23:2:1" + }, + { + "attributes": + { + "parameters": + [ + null + ] + }, + "children": [], + "id": 2, + "name": "ParameterList", + "src": "26:0:1" + }, + { + "children": + [ + { + "attributes": + { + "assignments": + [ + 3 + ] + }, + "children": + [ + { + "attributes": + { + "constant": false, + "name": "x", + "scope": 9, + "stateVariable": false, + "storageLocation": "default", + "type": "uint8", + "typeName": null, + "value": null, + "visibility": "internal" + }, + "children": [], + "id": 3, + "name": "VariableDeclaration", + "src": "28:5:1" + }, + { + "attributes": + { + "argumentTypes": null, + "hexvalue": "32", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 2", + "value": "2" + }, + "id": 4, + "name": "Literal", + "src": "36:1:1" + } + ], + "id": 5, + "name": "VariableDeclarationStatement", + "src": "28:9:1" + }, + { + "children": + [ + { + "attributes": + { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "++", + "prefix": false, + "type": "uint8" + }, + "children": + [ + { + "attributes": + { + "argumentTypes": null, + "overloadedDeclarations": + [ + null + ], + "referencedDeclaration": 3, + "type": "uint8", + "value": "x" + }, + "id": 6, + "name": "Identifier", + "src": "39:1:1" + } + ], + "id": 7, + "name": "UnaryOperation", + "src": "39:3:1" + } + ], + "id": 8, + "name": "ExpressionStatement", + "src": "39:3:1" + } + ], + "id": 9, + "name": "Block", + "src": "26:19:1" + } + ], + "id": 10, + "name": "FunctionDefinition", + "src": "13:32:1" + } + ], + "id": 11, + "name": "ContractDefinition", + "src": "0:47:1" + } + ], + "id": 12, + "name": "SourceUnit", + "src": "0:48:1" } diff --git a/test/libsolidity/ASTJSON/using_for_directive.json b/test/libsolidity/ASTJSON/using_for_directive.json index 33caabb47..016e8c744 100644 --- a/test/libsolidity/ASTJSON/using_for_directive.json +++ b/test/libsolidity/ASTJSON/using_for_directive.json @@ -1,87 +1,87 @@ { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 5 - ], - "L" : - [ - 1 - ] - }, - "id" : 6, - "nodeType" : "SourceUnit", - "nodes" : - [ - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "library", - "documentation" : null, - "fullyImplemented" : true, - "id" : 1, - "linearizedBaseContracts" : - [ - 1 - ], - "name" : "L", - "nodeType" : "ContractDefinition", - "nodes" : [], - "scope" : 6, - "src" : "0:12:1" - }, - { - "baseContracts" : [], - "contractDependencies" : [], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "id" : 5, - "linearizedBaseContracts" : - [ - 5 - ], - "name" : "C", - "nodeType" : "ContractDefinition", - "nodes" : - [ - { - "id" : 4, - "libraryName" : - { - "contractScope" : null, - "id" : 2, - "name" : "L", - "nodeType" : "UserDefinedTypeName", - "referencedDeclaration" : 1, - "src" : "32:1:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_contract$_L_$1", - "typeString" : "library L" - } - }, - "nodeType" : "UsingForDirective", - "src" : "26:17:1", - "typeName" : - { - "id" : 3, - "name" : "uint", - "nodeType" : "ElementaryTypeName", - "src" : "38:4:1", - "typeDescriptions" : - { - "typeIdentifier" : "t_uint256", - "typeString" : "uint256" - } - } - } - ], - "scope" : 6, - "src" : "13:32:1" - } - ], - "src" : "0:46:1" + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 5 + ], + "L": + [ + 1 + ] + }, + "id": 6, + "nodeType": "SourceUnit", + "nodes": + [ + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "library", + "documentation": null, + "fullyImplemented": true, + "id": 1, + "linearizedBaseContracts": + [ + 1 + ], + "name": "L", + "nodeType": "ContractDefinition", + "nodes": [], + "scope": 6, + "src": "0:12:1" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 5, + "linearizedBaseContracts": + [ + 5 + ], + "name": "C", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "id": 4, + "libraryName": + { + "contractScope": null, + "id": 2, + "name": "L", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1, + "src": "32:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_L_$1", + "typeString": "library L" + } + }, + "nodeType": "UsingForDirective", + "src": "26:17:1", + "typeName": + { + "id": 3, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "38:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + } + ], + "scope": 6, + "src": "13:32:1" + } + ], + "src": "0:46:1" } diff --git a/test/libsolidity/ASTJSON/using_for_directive.sol b/test/libsolidity/ASTJSON/using_for_directive.sol index a882ad887..be6e5288f 100644 --- a/test/libsolidity/ASTJSON/using_for_directive.sol +++ b/test/libsolidity/ASTJSON/using_for_directive.sol @@ -1 +1,3 @@ library L {} contract C { using L for uint; } + +// ---- diff --git a/test/libsolidity/ASTJSON/using_for_directive_legacy.json b/test/libsolidity/ASTJSON/using_for_directive_legacy.json index 0827ef90f..889fb56c0 100644 --- a/test/libsolidity/ASTJSON/using_for_directive_legacy.json +++ b/test/libsolidity/ASTJSON/using_for_directive_legacy.json @@ -1,110 +1,110 @@ { - "attributes" : - { - "absolutePath" : "a", - "exportedSymbols" : - { - "C" : - [ - 5 - ], - "L" : - [ - 1 - ] - } - }, - "children" : - [ - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "library", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 1 - ], - "name" : "L", - "nodes" : - [ - null - ], - "scope" : 6 - }, - "id" : 1, - "name" : "ContractDefinition", - "src" : "0:12:1" - }, - { - "attributes" : - { - "baseContracts" : - [ - null - ], - "contractDependencies" : - [ - null - ], - "contractKind" : "contract", - "documentation" : null, - "fullyImplemented" : true, - "linearizedBaseContracts" : - [ - 5 - ], - "name" : "C", - "scope" : 6 - }, - "children" : - [ - { - "children" : - [ - { - "attributes" : - { - "contractScope" : null, - "name" : "L", - "referencedDeclaration" : 1, - "type" : "library L" - }, - "id" : 2, - "name" : "UserDefinedTypeName", - "src" : "32:1:1" - }, - { - "attributes" : - { - "name" : "uint", - "type" : "uint256" - }, - "id" : 3, - "name" : "ElementaryTypeName", - "src" : "38:4:1" - } - ], - "id" : 4, - "name" : "UsingForDirective", - "src" : "26:17:1" - } - ], - "id" : 5, - "name" : "ContractDefinition", - "src" : "13:32:1" - } - ], - "id" : 6, - "name" : "SourceUnit", - "src" : "0:46:1" + "attributes": + { + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 5 + ], + "L": + [ + 1 + ] + } + }, + "children": + [ + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "library", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 1 + ], + "name": "L", + "nodes": + [ + null + ], + "scope": 6 + }, + "id": 1, + "name": "ContractDefinition", + "src": "0:12:1" + }, + { + "attributes": + { + "baseContracts": + [ + null + ], + "contractDependencies": + [ + null + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "linearizedBaseContracts": + [ + 5 + ], + "name": "C", + "scope": 6 + }, + "children": + [ + { + "children": + [ + { + "attributes": + { + "contractScope": null, + "name": "L", + "referencedDeclaration": 1, + "type": "library L" + }, + "id": 2, + "name": "UserDefinedTypeName", + "src": "32:1:1" + }, + { + "attributes": + { + "name": "uint", + "type": "uint256" + }, + "id": 3, + "name": "ElementaryTypeName", + "src": "38:4:1" + } + ], + "id": 4, + "name": "UsingForDirective", + "src": "26:17:1" + } + ], + "id": 5, + "name": "ContractDefinition", + "src": "13:32:1" + } + ], + "id": 6, + "name": "SourceUnit", + "src": "0:46:1" }