diff options
author | Christian <c@ethdev.com> | 2015-01-12 19:46:52 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2015-01-12 19:46:52 +0800 |
commit | 307a83e1dea95cd144a955aa0891476e7dd159de (patch) | |
tree | 5adca427a0debe24ba729bd3cd917c821c92ebca /GlobalContext.cpp | |
parent | 94cff9684f8b1d4a5e2eeba58444a99e32e8a7ae (diff) | |
download | dexon-solidity-307a83e1dea95cd144a955aa0891476e7dd159de.tar dexon-solidity-307a83e1dea95cd144a955aa0891476e7dd159de.tar.gz dexon-solidity-307a83e1dea95cd144a955aa0891476e7dd159de.tar.bz2 dexon-solidity-307a83e1dea95cd144a955aa0891476e7dd159de.tar.lz dexon-solidity-307a83e1dea95cd144a955aa0891476e7dd159de.tar.xz dexon-solidity-307a83e1dea95cd144a955aa0891476e7dd159de.tar.zst dexon-solidity-307a83e1dea95cd144a955aa0891476e7dd159de.zip |
More convenient function type construction.
Diffstat (limited to 'GlobalContext.cpp')
-rw-r--r-- | GlobalContext.cpp | 45 |
1 files changed, 10 insertions, 35 deletions
diff --git a/GlobalContext.cpp b/GlobalContext.cpp index 633331a9..26a52fd1 100644 --- a/GlobalContext.cpp +++ b/GlobalContext.cpp @@ -34,54 +34,29 @@ namespace solidity { GlobalContext::GlobalContext(): -// TODO: make this cleaner. m_magicVariables(vector<shared_ptr<MagicVariableDeclaration const>>{make_shared<MagicVariableDeclaration>("block", make_shared<MagicType>(MagicType::Kind::BLOCK)), make_shared<MagicVariableDeclaration>("msg", make_shared<MagicType>(MagicType::Kind::MSG)), make_shared<MagicVariableDeclaration>("tx", make_shared<MagicType>(MagicType::Kind::TX)), make_shared<MagicVariableDeclaration>("suicide", - make_shared<FunctionType>(TypePointers({std::make_shared<IntegerType>(0, - IntegerType::Modifier::ADDRESS)}), - TypePointers(), - FunctionType::Location::SUICIDE)), + make_shared<FunctionType>(vector<string>{"address"}, vector<string>{}, FunctionType::Location::SUICIDE)), make_shared<MagicVariableDeclaration>("sha3", - make_shared<FunctionType>(TypePointers({std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH)}), - TypePointers({std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH)}), - FunctionType::Location::SHA3)), + make_shared<FunctionType>(vector<string>{"hash"}, vector<string>{"hash"}, FunctionType::Location::SHA3)), make_shared<MagicVariableDeclaration>("log0", - make_shared<FunctionType>(TypePointers({std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH)}), - TypePointers(), - FunctionType::Location::LOG0)), + make_shared<FunctionType>(vector<string>{"hash"},vector<string>{}, FunctionType::Location::LOG0)), make_shared<MagicVariableDeclaration>("log1", - make_shared<FunctionType>(TypePointers({std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH), std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH)}), - TypePointers(), - FunctionType::Location::LOG1)), + make_shared<FunctionType>(vector<string>{"hash", "hash"},vector<string>{}, FunctionType::Location::LOG1)), make_shared<MagicVariableDeclaration>("log2", - make_shared<FunctionType>(TypePointers({std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH), std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH), std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH)}), - TypePointers(), - FunctionType::Location::LOG2)), + make_shared<FunctionType>(vector<string>{"hash", "hash", "hash"},vector<string>{}, FunctionType::Location::LOG2)), make_shared<MagicVariableDeclaration>("log3", - make_shared<FunctionType>(TypePointers({std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH), std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH), std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH), std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH)}), - TypePointers(), - FunctionType::Location::LOG3)), + make_shared<FunctionType>(vector<string>{"hash", "hash", "hash", "hash"},vector<string>{}, FunctionType::Location::LOG3)), make_shared<MagicVariableDeclaration>("log4", - make_shared<FunctionType>(TypePointers({std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH), std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH), std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH), std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH), std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH)}), - TypePointers(), - FunctionType::Location::LOG4)), + make_shared<FunctionType>(vector<string>{"hash", "hash", "hash", "hash", "hash"},vector<string>{}, FunctionType::Location::LOG4)), make_shared<MagicVariableDeclaration>("sha256", - make_shared<FunctionType>(TypePointers({std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH)}), - TypePointers({std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH)}), - FunctionType::Location::SHA256)), + make_shared<FunctionType>(vector<string>{"hash"}, vector<string>{"hash"}, FunctionType::Location::SHA256)), make_shared<MagicVariableDeclaration>("ecrecover", - make_shared<FunctionType>(TypePointers({std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH), - std::make_shared<IntegerType>(8, IntegerType::Modifier::HASH), - std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH), - std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH)}), - TypePointers({std::make_shared<IntegerType>(0, IntegerType::Modifier::ADDRESS)}), - FunctionType::Location::ECRECOVER)), + make_shared<FunctionType>(vector<string>{"hash", "hash8", "hash", "hash"}, vector<string>{"address"}, FunctionType::Location::ECRECOVER)), make_shared<MagicVariableDeclaration>("ripemd160", - make_shared<FunctionType>(TypePointers({std::make_shared<IntegerType>(256, IntegerType::Modifier::HASH)}), - TypePointers({std::make_shared<IntegerType>(160, IntegerType::Modifier::HASH)}), - FunctionType::Location::RIPEMD160))}) + make_shared<FunctionType>(vector<string>{"hash"}, vector<string>{"hash160"}, FunctionType::Location::RIPEMD160))}) { } |