aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGav Wood <i@gavwood.com>2014-07-10 03:15:56 +0800
committerGav Wood <i@gavwood.com>2014-07-10 03:15:56 +0800
commit9aea975ddea00a7891bb6376450e9a24eb25738f (patch)
treeea1b3f5872404d1e0983d850ec50e7f23d3831da
parente128f34b6ba7b3dd2337fde54a2cf1e16489de1e (diff)
parentf9612d61be27af23446fe1fb0cae9e2743c1e58d (diff)
downloaddexon-solidity-9aea975ddea00a7891bb6376450e9a24eb25738f.tar.gz
dexon-solidity-9aea975ddea00a7891bb6376450e9a24eb25738f.tar.zst
dexon-solidity-9aea975ddea00a7891bb6376450e9a24eb25738f.zip
Merge pull request #235 from programmerTim/develop
Fixed MSVC build errors and updated projects.
-rw-r--r--Parser.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/Parser.cpp b/Parser.cpp
index 314e6cf7..1907fd17 100644
--- a/Parser.cpp
+++ b/Parser.cpp
@@ -69,9 +69,24 @@ void eth::debugOutAST(ostream& _out, sp::utree const& _this)
}
}
+namespace eth {
+namespace parseTreeLLL_ {
+
+template<unsigned N>
+struct tagNode
+{
+ void operator()(sp::utree& n, qi::rule<string::const_iterator, qi::ascii::space_type, sp::utree()>::context_type& c) const
+ {
+ (boost::fusion::at_c<0>(c.attributes) = n).tag(N);
+ }
+};
+
+}}
+
void eth::parseTreeLLL(string const& _s, sp::utree& o_out)
{
using qi::ascii::space;
+ using eth::parseTreeLLL_::tagNode;
typedef sp::basic_string<std::string, sp::utree_type::symbol_type> symbol_type;
typedef string::const_iterator it;
@@ -96,8 +111,7 @@ void eth::parseTreeLLL(string const& _s, sp::utree& o_out)
qi::rule<it, qi::ascii::space_type, sp::utree::list_type()> calldataload = qi::lit("$") > element;
qi::rule<it, qi::ascii::space_type, sp::utree::list_type()> list = '(' > *element > ')';
- auto x = [](int a) { return [=](sp::utree& n, typename qi::rule<it, qi::ascii::space_type, sp::utree()>::context_type& c) { (boost::fusion::at_c<0>(c.attributes) = n).tag(a); }; };
- qi::rule<it, qi::ascii::space_type, sp::utree()> extra = sload[x(2)] | mload[x(1)] | sstore[x(4)] | mstore[x(3)] | seq[x(5)] | calldataload[x(6)];
+ qi::rule<it, qi::ascii::space_type, sp::utree()> 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;