From 5d2e1343788f3374980091ee7fec87fa17d06c26 Mon Sep 17 00:00:00 2001 From: Marenz Date: Wed, 8 Jun 2022 18:13:49 +0200 Subject: [PATCH] Add all path locations to the IdentifierPath ASTNode --- libsolidity/ast/AST.h | 15 +++++++++-- libsolidity/ast/ASTJsonExporter.cpp | 6 +++++ libsolidity/ast/ASTJsonImporter.cpp | 19 ++++++++++++- libsolidity/parsing/Parser.cpp | 27 +++++++++++++++---- .../ASTJSON/assembly/slot_offset.json | 4 +++ .../assembly/slot_offset_parseOnly.json | 4 +++ .../ASTJSON/base_constructor_call.json | 8 ++++++ .../base_constructor_call_parseOnly.json | 8 ++++++ .../ASTJSON/contract_dep_order.json | 16 +++++++++++ .../ASTJSON/contract_dep_order_parseOnly.json | 16 +++++++++++ .../ASTJSON/enum_value_declaration.json | 4 +++ .../enum_value_declaration_parseOnly.json | 4 +++ .../ASTJSON/fail_after_parsing_parseOnly.json | 12 +++++++++ .../ASTJSON/inheritance_specifier.json | 4 +++ .../inheritance_specifier_parseOnly.json | 4 +++ test/libsolidity/ASTJSON/mappings.json | 8 ++++++ .../ASTJSON/mappings_parseOnly.json | 8 ++++++ .../ASTJSON/modifier_definition.json | 4 +++ .../modifier_definition_parseOnly.json | 4 +++ .../ASTJSON/modifier_invocation.json | 4 +++ .../modifier_invocation_parseOnly.json | 4 +++ .../not_existing_import_parseOnly.json | 10 +++++++ test/libsolidity/ASTJSON/override.json | 8 ++++++ .../ASTJSON/override_parseOnly.json | 8 ++++++ .../ASTJSON/two_base_functions.json | 16 +++++++++++ .../ASTJSON/two_base_functions_parseOnly.json | 16 +++++++++++ .../ASTJSON/userDefinedValueType.json | 16 +++++++++++ .../userDefinedValueType_parseOnly.json | 16 +++++++++++ .../ASTJSON/using_for_directive.json | 8 ++++++ .../using_for_directive_parseOnly.json | 8 ++++++ 30 files changed, 281 insertions(+), 8 deletions(-) diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index 4eba73c5d..9c4c10b2f 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -587,10 +587,19 @@ private: class IdentifierPath: public ASTNode { public: - IdentifierPath(int64_t _id, SourceLocation const& _location, std::vector _path): - ASTNode(_id, _location), m_path(std::move(_path)) {} + IdentifierPath( + int64_t _id, + SourceLocation const& _location, + std::vector _path, + std::vector _pathLocations + ): + ASTNode(_id, _location), m_path(std::move(_path)), m_pathLocations(std::move(_pathLocations)) + { + solAssert(m_pathLocations.size() == m_path.size()); + } std::vector const& path() const { return m_path; } + std::vector const& pathLocations() const { return m_pathLocations; } IdentifierPathAnnotation& annotation() const override { return initAnnotation(); @@ -600,6 +609,8 @@ public: void accept(ASTConstVisitor& _visitor) const override; private: std::vector m_path; + // Corresponding locations for m_path. Array has same length and indices as m_path. + std::vector m_pathLocations; }; class InheritanceSpecifier: public ASTNode diff --git a/libsolidity/ast/ASTJsonExporter.cpp b/libsolidity/ast/ASTJsonExporter.cpp index dffd51c30..dfd4a2f93 100644 --- a/libsolidity/ast/ASTJsonExporter.cpp +++ b/libsolidity/ast/ASTJsonExporter.cpp @@ -294,8 +294,14 @@ bool ASTJsonExporter::visit(ContractDefinition const& _node) bool ASTJsonExporter::visit(IdentifierPath const& _node) { + Json::Value nameLocations = Json::arrayValue; + + for (SourceLocation location: _node.pathLocations()) + nameLocations.append(sourceLocationToString(location)); + setJsonNode(_node, "IdentifierPath", { make_pair("name", namePathToString(_node.path())), + make_pair("nameLocations", nameLocations), make_pair("referencedDeclaration", idOrNull(_node.annotation().referencedDeclaration)) }); return false; diff --git a/libsolidity/ast/ASTJsonImporter.cpp b/libsolidity/ast/ASTJsonImporter.cpp index 4fcea9aff..0f692376c 100644 --- a/libsolidity/ast/ASTJsonImporter.cpp +++ b/libsolidity/ast/ASTJsonImporter.cpp @@ -325,6 +325,7 @@ ASTPointer ASTJsonImporter::createIdentifierPath(Json::Value con astAssert(_node["name"].isString(), "Expected 'name' to be a string!"); vector namePath; + vector namePathLocations; vector strs; string nameString = member(_node, "name").asString(); boost::algorithm::split(strs, nameString, boost::is_any_of(".")); @@ -334,7 +335,23 @@ ASTPointer ASTJsonImporter::createIdentifierPath(Json::Value con astAssert(!s.empty(), "Expected non-empty string for IdentifierPath element."); namePath.emplace_back(s); } - return createASTNode(_node, namePath); + + if (_node.isMember("nameLocations") && _node["nameLocations"].isArray()) + for (auto const& val: _node["nameLocations"]) + namePathLocations.emplace_back(langutil::parseSourceLocation(val.asString(), m_sourceNames)); + else + namePathLocations.resize(namePath.size()); + + astAssert( + namePath.size() == namePathLocations.size(), + "SourceLocations don't match name paths." + ); + + return createASTNode( + _node, + namePath, + namePathLocations + ); } ASTPointer ASTJsonImporter::createInheritanceSpecifier(Json::Value const& _node) diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index 554ebf75c..15e9f6c53 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -1061,14 +1061,24 @@ ASTPointer Parser::parseIdentifierPath() RecursionGuard recursionGuard(*this); ASTNodeFactory nodeFactory(*this); nodeFactory.markEndPosition(); - vector identifierPath{*expectIdentifierToken()}; + + auto [name, nameLocation] = expectIdentifierWithLocation(); + + vector identifierPath{*name}; + vector identifierPathLocations{nameLocation}; + while (m_scanner->currentToken() == Token::Period) { advance(); + nodeFactory.markEndPosition(); - identifierPath.push_back(*expectIdentifierTokenOrAddress()); + + tie(name, nameLocation) = expectIdentifierWithLocation(); + + identifierPath.push_back(*name); + identifierPathLocations.push_back(nameLocation); } - return nodeFactory.createNode(identifierPath); + return nodeFactory.createNode(identifierPath, identifierPathLocations); } ASTPointer Parser::parseTypeNameSuffix(ASTPointer type, ASTNodeFactory& nodeFactory) @@ -2286,9 +2296,16 @@ ASTPointer Parser::typeNameFromIndexAccessStructure(Parser::IndexAcces else { vector path; + vector pathLocations; + for (auto const& el: _iap.path) - path.push_back(dynamic_cast(*el).name()); - type = nodeFactory.createNode(nodeFactory.createNode(path)); + { + auto& identifier = dynamic_cast(*el); + path.push_back(identifier.name()); + pathLocations.push_back(identifier.location()); + } + + type = nodeFactory.createNode(nodeFactory.createNode(path, pathLocations)); } for (auto const& lengthExpression: _iap.indices) { diff --git a/test/libsolidity/ASTJSON/assembly/slot_offset.json b/test/libsolidity/ASTJSON/assembly/slot_offset.json index cc22c76e8..1e6fe1447 100644 --- a/test/libsolidity/ASTJSON/assembly/slot_offset.json +++ b/test/libsolidity/ASTJSON/assembly/slot_offset.json @@ -95,6 +95,10 @@ { "id": 4, "name": "S", + "nameLocations": + [ + "42:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 3, "src": "42:1:1" diff --git a/test/libsolidity/ASTJSON/assembly/slot_offset_parseOnly.json b/test/libsolidity/ASTJSON/assembly/slot_offset_parseOnly.json index 6407e4519..4135bb343 100644 --- a/test/libsolidity/ASTJSON/assembly/slot_offset_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/slot_offset_parseOnly.json @@ -66,6 +66,10 @@ { "id": 4, "name": "S", + "nameLocations": + [ + "42:1:1" + ], "nodeType": "IdentifierPath", "src": "42:1:1" }, diff --git a/test/libsolidity/ASTJSON/base_constructor_call.json b/test/libsolidity/ASTJSON/base_constructor_call.json index bfbd716da..774981fa9 100644 --- a/test/libsolidity/ASTJSON/base_constructor_call.json +++ b/test/libsolidity/ASTJSON/base_constructor_call.json @@ -113,6 +113,10 @@ { "id": 8, "name": "A", + "nameLocations": + [ + "50:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 7, "src": "50:1:1" @@ -177,6 +181,10 @@ { "id": 11, "name": "A", + "nameLocations": + [ + "68:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 7, "src": "68:1:1" diff --git a/test/libsolidity/ASTJSON/base_constructor_call_parseOnly.json b/test/libsolidity/ASTJSON/base_constructor_call_parseOnly.json index bd101b9b8..8af0c0b2c 100644 --- a/test/libsolidity/ASTJSON/base_constructor_call_parseOnly.json +++ b/test/libsolidity/ASTJSON/base_constructor_call_parseOnly.json @@ -84,6 +84,10 @@ { "id": 8, "name": "A", + "nameLocations": + [ + "50:1:1" + ], "nodeType": "IdentifierPath", "src": "50:1:1" }, @@ -131,6 +135,10 @@ { "id": 11, "name": "A", + "nameLocations": + [ + "68:1:1" + ], "nodeType": "IdentifierPath", "src": "68:1:1" }, diff --git a/test/libsolidity/ASTJSON/contract_dep_order.json b/test/libsolidity/ASTJSON/contract_dep_order.json index 754e14f4d..83865d7d4 100644 --- a/test/libsolidity/ASTJSON/contract_dep_order.json +++ b/test/libsolidity/ASTJSON/contract_dep_order.json @@ -56,6 +56,10 @@ { "id": 2, "name": "A", + "nameLocations": + [ + "29:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 1, "src": "29:1:1" @@ -92,6 +96,10 @@ { "id": 5, "name": "B", + "nameLocations": + [ + "49:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 4, "src": "49:1:1" @@ -129,6 +137,10 @@ { "id": 8, "name": "C", + "nameLocations": + [ + "69:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 7, "src": "69:1:1" @@ -167,6 +179,10 @@ { "id": 11, "name": "D", + "nameLocations": + [ + "89:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 10, "src": "89:1:1" diff --git a/test/libsolidity/ASTJSON/contract_dep_order_parseOnly.json b/test/libsolidity/ASTJSON/contract_dep_order_parseOnly.json index 5fe9bb195..2c8bdc745 100644 --- a/test/libsolidity/ASTJSON/contract_dep_order_parseOnly.json +++ b/test/libsolidity/ASTJSON/contract_dep_order_parseOnly.json @@ -26,6 +26,10 @@ { "id": 2, "name": "A", + "nameLocations": + [ + "29:1:1" + ], "nodeType": "IdentifierPath", "src": "29:1:1" }, @@ -53,6 +57,10 @@ { "id": 5, "name": "B", + "nameLocations": + [ + "49:1:1" + ], "nodeType": "IdentifierPath", "src": "49:1:1" }, @@ -80,6 +88,10 @@ { "id": 8, "name": "C", + "nameLocations": + [ + "69:1:1" + ], "nodeType": "IdentifierPath", "src": "69:1:1" }, @@ -107,6 +119,10 @@ { "id": 11, "name": "D", + "nameLocations": + [ + "89:1:1" + ], "nodeType": "IdentifierPath", "src": "89:1:1" }, diff --git a/test/libsolidity/ASTJSON/enum_value_declaration.json b/test/libsolidity/ASTJSON/enum_value_declaration.json index fc8506c2a..3e6e7c24c 100644 --- a/test/libsolidity/ASTJSON/enum_value_declaration.json +++ b/test/libsolidity/ASTJSON/enum_value_declaration.json @@ -131,6 +131,10 @@ { "id": 5, "name": "A", + "nameLocations": + [ + "43:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 3, "src": "43:1:1" diff --git a/test/libsolidity/ASTJSON/enum_value_declaration_parseOnly.json b/test/libsolidity/ASTJSON/enum_value_declaration_parseOnly.json index f99b7cb87..f19bb2d9b 100644 --- a/test/libsolidity/ASTJSON/enum_value_declaration_parseOnly.json +++ b/test/libsolidity/ASTJSON/enum_value_declaration_parseOnly.json @@ -99,6 +99,10 @@ { "id": 5, "name": "A", + "nameLocations": + [ + "43:1:1" + ], "nodeType": "IdentifierPath", "src": "43:1:1" }, diff --git a/test/libsolidity/ASTJSON/fail_after_parsing_parseOnly.json b/test/libsolidity/ASTJSON/fail_after_parsing_parseOnly.json index a5c7669ef..e13cd2bff 100644 --- a/test/libsolidity/ASTJSON/fail_after_parsing_parseOnly.json +++ b/test/libsolidity/ASTJSON/fail_after_parsing_parseOnly.json @@ -65,6 +65,10 @@ { "id": 4, "name": "S", + "nameLocations": + [ + "50:1:1" + ], "nodeType": "IdentifierPath", "src": "50:1:1" }, @@ -114,6 +118,10 @@ { "id": 13, "name": "error", + "nameLocations": + [ + "95:5:1" + ], "nodeType": "IdentifierPath", "src": "95:5:1" }, @@ -251,6 +259,10 @@ { "id": 8, "name": "E", + "nameLocations": + [ + "72:1:1" + ], "nodeType": "IdentifierPath", "src": "72:1:1" }, diff --git a/test/libsolidity/ASTJSON/inheritance_specifier.json b/test/libsolidity/ASTJSON/inheritance_specifier.json index b74604265..8959d5b5d 100644 --- a/test/libsolidity/ASTJSON/inheritance_specifier.json +++ b/test/libsolidity/ASTJSON/inheritance_specifier.json @@ -44,6 +44,10 @@ { "id": 2, "name": "C1", + "nameLocations": + [ + "30:2:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 1, "src": "30:2:1" diff --git a/test/libsolidity/ASTJSON/inheritance_specifier_parseOnly.json b/test/libsolidity/ASTJSON/inheritance_specifier_parseOnly.json index deddb5224..72da9ad2c 100644 --- a/test/libsolidity/ASTJSON/inheritance_specifier_parseOnly.json +++ b/test/libsolidity/ASTJSON/inheritance_specifier_parseOnly.json @@ -26,6 +26,10 @@ { "id": 2, "name": "C1", + "nameLocations": + [ + "30:2:1" + ], "nodeType": "IdentifierPath", "src": "30:2:1" }, diff --git a/test/libsolidity/ASTJSON/mappings.json b/test/libsolidity/ASTJSON/mappings.json index 16904ec8a..e414b56fa 100644 --- a/test/libsolidity/ASTJSON/mappings.json +++ b/test/libsolidity/ASTJSON/mappings.json @@ -87,6 +87,10 @@ { "id": 5, "name": "C", + "nameLocations": + [ + "48:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 19, "src": "48:1:1" @@ -201,6 +205,10 @@ { "id": 14, "name": "E", + "nameLocations": + [ + "106:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 4, "src": "106:1:1" diff --git a/test/libsolidity/ASTJSON/mappings_parseOnly.json b/test/libsolidity/ASTJSON/mappings_parseOnly.json index 977ee776c..e4f7ee21a 100644 --- a/test/libsolidity/ASTJSON/mappings_parseOnly.json +++ b/test/libsolidity/ASTJSON/mappings_parseOnly.json @@ -68,6 +68,10 @@ { "id": 5, "name": "C", + "nameLocations": + [ + "48:1:1" + ], "nodeType": "IdentifierPath", "src": "48:1:1" }, @@ -146,6 +150,10 @@ { "id": 14, "name": "E", + "nameLocations": + [ + "106:1:1" + ], "nodeType": "IdentifierPath", "src": "106:1:1" }, diff --git a/test/libsolidity/ASTJSON/modifier_definition.json b/test/libsolidity/ASTJSON/modifier_definition.json index 67aa3e1ea..aa448568c 100644 --- a/test/libsolidity/ASTJSON/modifier_definition.json +++ b/test/libsolidity/ASTJSON/modifier_definition.json @@ -131,6 +131,10 @@ { "id": 8, "name": "M", + "nameLocations": + [ + "52:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 6, "src": "52:1:1" diff --git a/test/libsolidity/ASTJSON/modifier_definition_parseOnly.json b/test/libsolidity/ASTJSON/modifier_definition_parseOnly.json index a31b1f240..9344e419a 100644 --- a/test/libsolidity/ASTJSON/modifier_definition_parseOnly.json +++ b/test/libsolidity/ASTJSON/modifier_definition_parseOnly.json @@ -99,6 +99,10 @@ { "id": 8, "name": "M", + "nameLocations": + [ + "52:1:1" + ], "nodeType": "IdentifierPath", "src": "52:1:1" }, diff --git a/test/libsolidity/ASTJSON/modifier_invocation.json b/test/libsolidity/ASTJSON/modifier_invocation.json index 67aa3e1ea..aa448568c 100644 --- a/test/libsolidity/ASTJSON/modifier_invocation.json +++ b/test/libsolidity/ASTJSON/modifier_invocation.json @@ -131,6 +131,10 @@ { "id": 8, "name": "M", + "nameLocations": + [ + "52:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 6, "src": "52:1:1" diff --git a/test/libsolidity/ASTJSON/modifier_invocation_parseOnly.json b/test/libsolidity/ASTJSON/modifier_invocation_parseOnly.json index a31b1f240..9344e419a 100644 --- a/test/libsolidity/ASTJSON/modifier_invocation_parseOnly.json +++ b/test/libsolidity/ASTJSON/modifier_invocation_parseOnly.json @@ -99,6 +99,10 @@ { "id": 8, "name": "M", + "nameLocations": + [ + "52:1:1" + ], "nodeType": "IdentifierPath", "src": "52:1:1" }, diff --git a/test/libsolidity/ASTJSON/not_existing_import_parseOnly.json b/test/libsolidity/ASTJSON/not_existing_import_parseOnly.json index a36c59fff..de14043f3 100644 --- a/test/libsolidity/ASTJSON/not_existing_import_parseOnly.json +++ b/test/libsolidity/ASTJSON/not_existing_import_parseOnly.json @@ -23,6 +23,11 @@ { "id": 2, "name": "NotExisting.X", + "nameLocations": + [ + "55:11:1", + "67:1:1" + ], "nodeType": "IdentifierPath", "src": "55:13:1" }, @@ -58,6 +63,11 @@ { "id": 4, "name": "NotExisting.SomeStruct", + "nameLocations": + [ + "72:11:1", + "84:10:1" + ], "nodeType": "IdentifierPath", "src": "72:22:1" }, diff --git a/test/libsolidity/ASTJSON/override.json b/test/libsolidity/ASTJSON/override.json index 639572c54..a7c43767f 100644 --- a/test/libsolidity/ASTJSON/override.json +++ b/test/libsolidity/ASTJSON/override.json @@ -86,6 +86,10 @@ { "id": 6, "name": "A", + "nameLocations": + [ + "72:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 5, "src": "72:1:1" @@ -200,6 +204,10 @@ { "id": 17, "name": "B", + "nameLocations": + [ + "167:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 16, "src": "167:1:1" diff --git a/test/libsolidity/ASTJSON/override_parseOnly.json b/test/libsolidity/ASTJSON/override_parseOnly.json index b092df459..fe9d8a7c6 100644 --- a/test/libsolidity/ASTJSON/override_parseOnly.json +++ b/test/libsolidity/ASTJSON/override_parseOnly.json @@ -62,6 +62,10 @@ { "id": 6, "name": "A", + "nameLocations": + [ + "72:1:1" + ], "nodeType": "IdentifierPath", "src": "72:1:1" }, @@ -159,6 +163,10 @@ { "id": 17, "name": "B", + "nameLocations": + [ + "167:1:1" + ], "nodeType": "IdentifierPath", "src": "167:1:1" }, diff --git a/test/libsolidity/ASTJSON/two_base_functions.json b/test/libsolidity/ASTJSON/two_base_functions.json index 2098b3cd5..23bdf6efe 100644 --- a/test/libsolidity/ASTJSON/two_base_functions.json +++ b/test/libsolidity/ASTJSON/two_base_functions.json @@ -144,6 +144,10 @@ { "id": 11, "name": "A", + "nameLocations": + [ + "114:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 5, "src": "114:1:1" @@ -157,6 +161,10 @@ { "id": 13, "name": "B", + "nameLocations": + [ + "117:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 10, "src": "117:1:1" @@ -212,6 +220,10 @@ { "id": 16, "name": "A", + "nameLocations": + [ + "154:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 5, "src": "154:1:1" @@ -219,6 +231,10 @@ { "id": 17, "name": "B", + "nameLocations": + [ + "157:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 10, "src": "157:1:1" diff --git a/test/libsolidity/ASTJSON/two_base_functions_parseOnly.json b/test/libsolidity/ASTJSON/two_base_functions_parseOnly.json index 7a077e705..078dc5daa 100644 --- a/test/libsolidity/ASTJSON/two_base_functions_parseOnly.json +++ b/test/libsolidity/ASTJSON/two_base_functions_parseOnly.json @@ -111,6 +111,10 @@ { "id": 11, "name": "A", + "nameLocations": + [ + "114:1:1" + ], "nodeType": "IdentifierPath", "src": "114:1:1" }, @@ -123,6 +127,10 @@ { "id": 13, "name": "B", + "nameLocations": + [ + "117:1:1" + ], "nodeType": "IdentifierPath", "src": "117:1:1" }, @@ -163,12 +171,20 @@ { "id": 16, "name": "A", + "nameLocations": + [ + "154:1:1" + ], "nodeType": "IdentifierPath", "src": "154:1:1" }, { "id": 17, "name": "B", + "nameLocations": + [ + "157:1:1" + ], "nodeType": "IdentifierPath", "src": "157:1:1" } diff --git a/test/libsolidity/ASTJSON/userDefinedValueType.json b/test/libsolidity/ASTJSON/userDefinedValueType.json index df7aa69c8..17bb19efa 100644 --- a/test/libsolidity/ASTJSON/userDefinedValueType.json +++ b/test/libsolidity/ASTJSON/userDefinedValueType.json @@ -103,6 +103,10 @@ { "id": 7, "name": "MyAddress", + "nameLocations": + [ + "67:9:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 2, "src": "67:9:1" @@ -153,6 +157,10 @@ { "id": 11, "name": "MyUInt", + "nameLocations": + [ + "84:6:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 4, "src": "84:6:1" @@ -287,6 +295,10 @@ { "id": 21, "name": "MyAddress", + "nameLocations": + [ + "177:9:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 18, "src": "177:9:1" @@ -314,6 +326,10 @@ { "id": 23, "name": "MyUInt", + "nameLocations": + [ + "190:6:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 20, "src": "190:6:1" diff --git a/test/libsolidity/ASTJSON/userDefinedValueType_parseOnly.json b/test/libsolidity/ASTJSON/userDefinedValueType_parseOnly.json index 36315b443..3cef5ea47 100644 --- a/test/libsolidity/ASTJSON/userDefinedValueType_parseOnly.json +++ b/test/libsolidity/ASTJSON/userDefinedValueType_parseOnly.json @@ -69,6 +69,10 @@ { "id": 7, "name": "MyAddress", + "nameLocations": + [ + "67:9:1" + ], "nodeType": "IdentifierPath", "src": "67:9:1" }, @@ -108,6 +112,10 @@ { "id": 11, "name": "MyUInt", + "nameLocations": + [ + "84:6:1" + ], "nodeType": "IdentifierPath", "src": "84:6:1" }, @@ -213,6 +221,10 @@ { "id": 21, "name": "MyAddress", + "nameLocations": + [ + "177:9:1" + ], "nodeType": "IdentifierPath", "src": "177:9:1" }, @@ -230,6 +242,10 @@ { "id": 23, "name": "MyUInt", + "nameLocations": + [ + "190:6:1" + ], "nodeType": "IdentifierPath", "src": "190:6:1" }, diff --git a/test/libsolidity/ASTJSON/using_for_directive.json b/test/libsolidity/ASTJSON/using_for_directive.json index c9052b0d7..57658134d 100644 --- a/test/libsolidity/ASTJSON/using_for_directive.json +++ b/test/libsolidity/ASTJSON/using_for_directive.json @@ -27,6 +27,10 @@ { "id": 1, "name": "f", + "nameLocations": + [ + "7:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 10, "src": "7:1:1" @@ -161,6 +165,10 @@ { "id": 11, "name": "L", + "nameLocations": + [ + "72:1:1" + ], "nodeType": "IdentifierPath", "referencedDeclaration": 4, "src": "72:1:1" diff --git a/test/libsolidity/ASTJSON/using_for_directive_parseOnly.json b/test/libsolidity/ASTJSON/using_for_directive_parseOnly.json index d704b4e81..84de310c0 100644 --- a/test/libsolidity/ASTJSON/using_for_directive_parseOnly.json +++ b/test/libsolidity/ASTJSON/using_for_directive_parseOnly.json @@ -12,6 +12,10 @@ { "id": 1, "name": "f", + "nameLocations": + [ + "7:1:1" + ], "nodeType": "IdentifierPath", "src": "7:1:1" } @@ -118,6 +122,10 @@ { "id": 11, "name": "L", + "nameLocations": + [ + "72:1:1" + ], "nodeType": "IdentifierPath", "src": "72:1:1" },