diff options
-rw-r--r-- | docs/solidity-by-example.rst | 9 | ||||
-rw-r--r-- | liblll/CodeFragment.cpp | 4 | ||||
-rw-r--r-- | lllc/main.cpp | 9 |
3 files changed, 21 insertions, 1 deletions
diff --git a/docs/solidity-by-example.rst b/docs/solidity-by-example.rst index 2e53b78c..915cfa76 100644 --- a/docs/solidity-by-example.rst +++ b/docs/solidity-by-example.rst @@ -170,6 +170,15 @@ of votes. } } } + + // Calls winningProposal() function to get the index + // of the winner contained in the proposals array and then + // returns the name of the winner + function winnerName() constant + returns (bytes32 winnerName) + { + winnerName = proposals[winningProposal()].name; + } } Possible Improvements diff --git a/liblll/CodeFragment.cpp b/liblll/CodeFragment.cpp index bc53d777..39b6376c 100644 --- a/liblll/CodeFragment.cpp +++ b/liblll/CodeFragment.cpp @@ -581,6 +581,10 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s) { m_asm.appendJump(m_asm.errorTag()); } + else if (us == "BYTECODESIZE") + { + m_asm.appendProgramSize(); + } else if (us.find_first_of("1234567890") != 0 && us.find_first_not_of("QWERTYUIOPASDFGHJKLZXCVBNM1234567890_-") == string::npos) m_asm.append((u256)varAddress(s)); else diff --git a/lllc/main.cpp b/lllc/main.cpp index f8677be0..9763e820 100644 --- a/lllc/main.cpp +++ b/lllc/main.cpp @@ -27,11 +27,18 @@ #include <libdevcore/CommonIO.h> #include <libdevcore/CommonData.h> #include <libevmasm/Instruction.h> +#include <solidity/BuildInfo.h> + using namespace std; using namespace dev; using namespace dev::solidity; using namespace dev::eth; +static string const VersionString = + string(ETH_PROJECT_VERSION) + + (string(SOL_VERSION_PRERELEASE).empty() ? "" : "-" + string(SOL_VERSION_PRERELEASE)) + + (string(SOL_VERSION_BUILDINFO).empty() ? "" : "+" + string(SOL_VERSION_BUILDINFO)); + void help() { cout @@ -50,7 +57,7 @@ void help() void version() { cout << "LLLC, the Lovely Little Language Compiler " << endl; - cout << " By Gav Wood, (c) 2014." << endl; + cout << "Version: " << VersionString << endl; exit(0); } |