diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-10 01:08:56 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-14 06:16:14 +0800 |
commit | a295417f3476428c286f96433a42a96bfe29fee3 (patch) | |
tree | e5f9b374407dfcdc4f11943d91df69e4ec559b0a /AST.cpp | |
parent | 54ed8877aa673fd6765c1238bcef598331ae41ae (diff) | |
download | dexon-solidity-a295417f3476428c286f96433a42a96bfe29fee3.tar dexon-solidity-a295417f3476428c286f96433a42a96bfe29fee3.tar.gz dexon-solidity-a295417f3476428c286f96433a42a96bfe29fee3.tar.bz2 dexon-solidity-a295417f3476428c286f96433a42a96bfe29fee3.tar.lz dexon-solidity-a295417f3476428c286f96433a42a96bfe29fee3.tar.xz dexon-solidity-a295417f3476428c286f96433a42a96bfe29fee3.tar.zst dexon-solidity-a295417f3476428c286f96433a42a96bfe29fee3.zip |
Parsing enums for Solidity - WIP
Diffstat (limited to 'AST.cpp')
-rw-r--r-- | AST.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -255,6 +255,22 @@ void StructDefinition::checkRecursion() const } } +void EnumDefinition::checkValidityOfMembers() const +{ +#if 0 // LTODO: Make this work for the Declarations + vector<ASTPointer<ASTString>> members = getMembers(); + sort(begin(members), end(members)); + for (size_t i = 0; i < members.size(); ++i) + if (members[i] == members[i + 1]) + BOOST_THROW_EXCEPTION(createTypeError("Duplicate member detected in Enum")); +#endif +} + +TypePointer EnumDefinition::getType(ContractDefinition const*) const +{ + return make_shared<TypeType>(make_shared<EnumType>(*this)); +} + TypePointer FunctionDefinition::getType(ContractDefinition const*) const { return make_shared<FunctionType>(*this); |