diff --git a/cmake/EthDependenciesDeprecated.cmake b/cmake/EthDependenciesDeprecated.cmake index d1c51f6c4..17b937c5c 100644 --- a/cmake/EthDependenciesDeprecated.cmake +++ b/cmake/EthDependenciesDeprecated.cmake @@ -128,6 +128,7 @@ else() find_path( JSONRPC_ID jsonrpc/rpc.h /usr/include /usr/local/include + ../libjson-rpc-cpp/src ) if ( JSONRPC_ID ) message(STATUS "Found jsonrpc headers") @@ -137,6 +138,7 @@ else() /usr/local/lib /opt/local/lib /usr/lib/*/ + ../libjson-rpc-cpp/build/out ) if ( JSONRPC_LS ) message(STATUS "Found jsonrpc library: ${JSONRPC_LS}") diff --git a/libsolidity/Parser.cpp b/libsolidity/Parser.cpp index 44f0a54ad..72770f679 100644 --- a/libsolidity/Parser.cpp +++ b/libsolidity/Parser.cpp @@ -290,10 +290,10 @@ ASTPointer Parser::parseStatement() // We have a variable definition if we ge a keyword that specifies a type name, or // in the case of a user-defined type, we have two identifiers following each other. if (m_scanner->getCurrentToken() == Token::MAPPING || - m_scanner->getCurrentToken() == Token::VAR || - Token::isElementaryTypeName(m_scanner->getCurrentToken()) || - (m_scanner->getCurrentToken() == Token::IDENTIFIER && - m_scanner->peekNextToken() == Token::IDENTIFIER)) + m_scanner->getCurrentToken() == Token::VAR || + ((Token::isElementaryTypeName(m_scanner->getCurrentToken()) || + m_scanner->getCurrentToken() == Token::IDENTIFIER) && + m_scanner->peekNextToken() == Token::IDENTIFIER)) statement = parseVariableDefinition(); else // "ordinary" expression statement = parseExpression(); diff --git a/test/solidityParser.cpp b/test/solidityParser.cpp index 4ca9370d6..9319a02c5 100644 --- a/test/solidityParser.cpp +++ b/test/solidityParser.cpp @@ -211,7 +211,15 @@ BOOST_AUTO_TEST_CASE(else_if_statement) BOOST_CHECK_NO_THROW(parseText(text)); } - +BOOST_AUTO_TEST_CASE(statement_starting_with_type_conversion) +{ + char const* text = "contract test {\n" + " function fun() {\n" + " uint64(2);\n" + " }\n" + "}\n"; + BOOST_CHECK_NO_THROW(parseText(text)); +} BOOST_AUTO_TEST_SUITE_END()