diff options
-rw-r--r-- | CMakeLists.txt | 7 | ||||
-rw-r--r-- | Compiler.cpp | 6 | ||||
-rw-r--r-- | Parser.cpp | 13 |
3 files changed, 18 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2356b7d9..99d6d980 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,11 @@ aux_source_directory(. SRC_LIST) set(EXECUTABLE lll) # set(CMAKE_INSTALL_PREFIX ../lib) -add_library(${EXECUTABLE} SHARED ${SRC_LIST}) +if(ETH_STATIC) + add_library(${EXECUTABLE} STATIC ${SRC_LIST}) +else() + add_library(${EXECUTABLE} SHARED ${SRC_LIST}) +endif() file(GLOB HEADERS "*.h") @@ -15,7 +19,6 @@ include_directories(..) target_link_libraries(${EXECUTABLE} evmface) target_link_libraries(${EXECUTABLE} ethential) -target_link_libraries(${EXECUTABLE} gmp) if(${TARGET_PLATFORM} STREQUAL "w64") diff --git a/Compiler.cpp b/Compiler.cpp index 0faf478d..1621acf9 100644 --- a/Compiler.cpp +++ b/Compiler.cpp @@ -84,7 +84,11 @@ std::string eth::compileLLLToAsm(std::string const& _src, bool _opt, std::vector string eth::parseLLL(string const& _src) { sp::utree o; - parseTreeLLL(_src, o); + try + { + parseTreeLLL(_src, o); + } + catch (...) {} ostringstream ret; debugOutAST(ret, o); killBigints(o); @@ -21,6 +21,8 @@ #include "Parser.h" +#define BOOST_RESULT_OF_USE_DECLTYPE +#define BOOST_SPIRIT_USE_PHOENIX_V3 #include <boost/spirit/include/qi.hpp> #include <boost/spirit/include/phoenix.hpp> #include <boost/spirit/include/support_utree.hpp> @@ -93,12 +95,13 @@ void eth::parseTreeLLL(string const& _s, sp::utree& o_out) qi::rule<it, qi::ascii::space_type, sp::utree::list_type()> list = '(' > *element > ')'; // todo: fix compound compile errors in this line for Visual Studio 2013 -#ifndef _MSC_VER - qi::rule<it, qi::ascii::space_type, sp::utree()> extra = sload[qi::_val = qi::_1, bind(&sp::utree::tag, qi::_val, 2)] | mload[qi::_val = qi::_1, bind(&sp::utree::tag, qi::_val, 1)] | sstore[qi::_val = qi::_1, bind(&sp::utree::tag, qi::_val, 4)] | mstore[qi::_val = qi::_1, bind(&sp::utree::tag, qi::_val, 3)] | seq[qi::_val = qi::_1, bind(&sp::utree::tag, qi::_val, 5)]; +//#ifndef _MSC_VER + 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 = mload[x(1)] | sload[x(2)] | mstore[x(3)] | sstore[x(4)] | seq[x(5)]; element = atom | list | extra; -#else - element = atom | list/* | extra*/; -#endif +/*#else + element = atom | list; +#endif*/ string s; |