From 281fb1bf0ad76a0be9ab47464ef5eb152c508059 Mon Sep 17 00:00:00 2001 From: Giacomo Tazzari Date: Sat, 9 Aug 2014 23:42:38 +0200 Subject: [PATCH 1/2] Minor GUI improvement to prevent the Block Chain text widget, the Contracts text widget and the Pending text widget from automatically scrolling down to the bottom --- alethzero/MainWin.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index c9d8e22ca..6c18d39bd 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -1018,6 +1018,7 @@ void Main::on_transactionQueue_currentItemChanged() } ui->pendingInfo->setHtml(QString::fromStdString(s.str())); + ui->pendingInfo->moveCursor(QTextCursor::Start); } void Main::ourAccountsRowsMoved() @@ -1122,6 +1123,7 @@ void Main::on_blocks_currentItemChanged() } ui->info->appendHtml(QString::fromStdString(s.str())); + ui->info->moveCursor(QTextCursor::Start); } } @@ -1237,6 +1239,7 @@ void Main::on_contracts_currentItemChanged() { ui->contractInfo->appendHtml("Corrupted trie."); } + ui->contractInfo->moveCursor(QTextCursor::Start); } } From 02f1ed465c894d0b48435a25dd5180433cc38924 Mon Sep 17 00:00:00 2001 From: Giacomo Tazzari Date: Sun, 10 Aug 2014 00:42:34 +0200 Subject: [PATCH 2/2] Using boost::spirit::standard namespace instead of boost::spirit::ascii in parseTreeLLL() to prevent crashing when parsing code containing non-ascii characters --- liblll/Parser.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/liblll/Parser.cpp b/liblll/Parser.cpp index 1907fd17c..edcd38f32 100644 --- a/liblll/Parser.cpp +++ b/liblll/Parser.cpp @@ -85,7 +85,8 @@ struct tagNode void eth::parseTreeLLL(string const& _s, sp::utree& o_out) { - using qi::ascii::space; + using qi::standard::space; + using qi::standard::space_type; using eth::parseTreeLLL_::tagNode; typedef sp::basic_string symbol_type; typedef string::const_iterator it; @@ -94,24 +95,24 @@ void eth::parseTreeLLL(string const& _s, sp::utree& o_out) static const u256 finney = u256(1000000000) * 1000000; static const u256 szabo = u256(1000000000) * 1000; - qi::rule element; + qi::rule element; qi::rule str = '"' > qi::lexeme[+(~qi::char_(std::string("\"") + '\0'))] > '"'; qi::rule strsh = '\'' > qi::lexeme[+(~qi::char_(std::string(" ;$@()[]{}:\n\t") + '\0'))]; qi::rule symbol = qi::lexeme[+(~qi::char_(std::string(" $@[]{}:();\"\x01-\x1f\x7f") + '\0'))]; qi::rule intstr = qi::lexeme[ qi::no_case["0x"][qi::_val = "0x"] >> *qi::char_("0-9a-fA-F")[qi::_val += qi::_1]] | qi::lexeme[+qi::char_("0-9")[qi::_val += qi::_1]]; qi::rule integer = intstr; qi::rule multiplier = qi::lit("wei")[qi::_val = 1] | qi::lit("szabo")[qi::_val = szabo] | qi::lit("finney")[qi::_val = finney] | qi::lit("ether")[qi::_val = ether]; - qi::rule quantity = integer[qi::_val = qi::_1] >> -multiplier[qi::_val *= qi::_1]; - qi::rule atom = quantity[qi::_val = px::construct(px::new_(qi::_1))] | (str | strsh)[qi::_val = qi::_1] | symbol[qi::_val = qi::_1]; - qi::rule seq = '{' > *element > '}'; - qi::rule mload = '@' > element; - qi::rule sload = qi::lit("@@") > element; - qi::rule mstore = '[' > element > ']' > -qi::lit(":") > element; - qi::rule sstore = qi::lit("[[") > element > qi::lit("]]") > -qi::lit(":") > element; - qi::rule calldataload = qi::lit("$") > element; - qi::rule list = '(' > *element > ')'; - - qi::rule extra = sload[tagNode<2>()] | mload[tagNode<1>()] | sstore[tagNode<4>()] | mstore[tagNode<3>()] | seq[tagNode<5>()] | calldataload[tagNode<6>()]; + qi::rule quantity = integer[qi::_val = qi::_1] >> -multiplier[qi::_val *= qi::_1]; + qi::rule atom = quantity[qi::_val = px::construct(px::new_(qi::_1))] | (str | strsh)[qi::_val = qi::_1] | symbol[qi::_val = qi::_1]; + qi::rule seq = '{' > *element > '}'; + qi::rule mload = '@' > element; + qi::rule sload = qi::lit("@@") > element; + qi::rule mstore = '[' > element > ']' > -qi::lit(":") > element; + qi::rule sstore = qi::lit("[[") > element > qi::lit("]]") > -qi::lit(":") > element; + qi::rule calldataload = qi::lit("$") > element; + qi::rule list = '(' > *element > ')'; + + qi::rule extra = sload[tagNode<2>()] | mload[tagNode<1>()] | sstore[tagNode<4>()] | mstore[tagNode<3>()] | seq[tagNode<5>()] | calldataload[tagNode<6>()]; element = atom | list | extra; string s;