@@ -509,14 +509,16 @@ class ContractDefinition: public Declaration, public StructurallyDocumented, pub
509
509
std::vector<ASTPointer<InheritanceSpecifier>> _baseContracts,
510
510
std::vector<ASTPointer<ASTNode>> _subNodes,
511
511
ContractKind _contractKind = ContractKind::Contract,
512
- bool _abstract = false
512
+ bool _abstract = false ,
513
+ ASTPointer<StorageLayoutSpecifier> _storageLayoutSpecifier = nullptr
513
514
):
514
515
Declaration (_id, _location, _name, std::move(_nameLocation)),
515
516
StructurallyDocumented (_documentation),
516
517
m_baseContracts (std::move(_baseContracts)),
517
518
m_subNodes (std::move(_subNodes)),
518
519
m_contractKind (_contractKind),
519
- m_abstract (_abstract)
520
+ m_abstract (_abstract),
521
+ m_storageLayoutSpecifier (_storageLayoutSpecifier)
520
522
{}
521
523
522
524
void accept (ASTVisitor& _visitor) override ;
@@ -586,6 +588,9 @@ class ContractDefinition: public Declaration, public StructurallyDocumented, pub
586
588
587
589
bool abstract () const { return m_abstract; }
588
590
591
+ StorageLayoutSpecifier const * storageLayoutSpecifier () const { return m_storageLayoutSpecifier.get (); }
592
+ StorageLayoutSpecifier* storageLayoutSpecifier () { return m_storageLayoutSpecifier.get (); }
593
+
589
594
ContractDefinition const * superContract (ContractDefinition const & _mostDerivedContract) const ;
590
595
// / @returns the next constructor in the inheritance hierarchy.
591
596
FunctionDefinition const * nextConstructor (ContractDefinition const & _mostDerivedContract) const ;
@@ -597,12 +602,30 @@ class ContractDefinition: public Declaration, public StructurallyDocumented, pub
597
602
std::vector<ASTPointer<ASTNode>> m_subNodes;
598
603
ContractKind m_contractKind;
599
604
bool m_abstract{false };
605
+ ASTPointer<StorageLayoutSpecifier> m_storageLayoutSpecifier;
600
606
601
607
util::LazyInit<std::vector<std::pair<util::FixedHash<4 >, FunctionTypePointer>>> m_interfaceFunctionList[2 ];
602
608
util::LazyInit<std::vector<EventDefinition const *>> m_interfaceEvents;
603
609
util::LazyInit<std::multimap<std::string, FunctionDefinition const *>> m_definedFunctionsByName;
604
610
};
605
611
612
+
613
+ class StorageLayoutSpecifier : public ASTNode
614
+ {
615
+ public:
616
+ StorageLayoutSpecifier (
617
+ int64_t _id,
618
+ SourceLocation const & _location,
619
+ ASTPointer<Expression> _baseSlotExpression
620
+ );
621
+ void accept (ASTVisitor& _visitor) override ;
622
+ void accept (ASTConstVisitor& _visitor) const override ;
623
+
624
+ Expression const & baseSlotExpression () const { solAssert (m_baseSlotExpression); return *m_baseSlotExpression; }
625
+ private:
626
+ ASTPointer<Expression> m_baseSlotExpression;
627
+ };
628
+
606
629
/* *
607
630
* A sequence of identifiers separated by dots used outside the expression context. Inside the expression context, this is a sequence of Identifier and MemberAccess.
608
631
*/
0 commit comments