Browse Source

Merge branch 'develop' into crypto

cl-refactor
subtly 11 years ago
parent
commit
7316d779fa
  1. 2
      cmake/EthDependenciesDeprecated.cmake
  2. 8
      libsolidity/Parser.cpp
  3. 10
      test/solidityParser.cpp

2
cmake/EthDependenciesDeprecated.cmake

@ -128,6 +128,7 @@ else()
find_path( JSONRPC_ID jsonrpc/rpc.h find_path( JSONRPC_ID jsonrpc/rpc.h
/usr/include /usr/include
/usr/local/include /usr/local/include
../libjson-rpc-cpp/src
) )
if ( JSONRPC_ID ) if ( JSONRPC_ID )
message(STATUS "Found jsonrpc headers") message(STATUS "Found jsonrpc headers")
@ -137,6 +138,7 @@ else()
/usr/local/lib /usr/local/lib
/opt/local/lib /opt/local/lib
/usr/lib/*/ /usr/lib/*/
../libjson-rpc-cpp/build/out
) )
if ( JSONRPC_LS ) if ( JSONRPC_LS )
message(STATUS "Found jsonrpc library: ${JSONRPC_LS}") message(STATUS "Found jsonrpc library: ${JSONRPC_LS}")

8
libsolidity/Parser.cpp

@ -290,10 +290,10 @@ ASTPointer<Statement> Parser::parseStatement()
// We have a variable definition if we ge a keyword that specifies a type name, or // 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. // in the case of a user-defined type, we have two identifiers following each other.
if (m_scanner->getCurrentToken() == Token::MAPPING || if (m_scanner->getCurrentToken() == Token::MAPPING ||
m_scanner->getCurrentToken() == Token::VAR || m_scanner->getCurrentToken() == Token::VAR ||
Token::isElementaryTypeName(m_scanner->getCurrentToken()) || ((Token::isElementaryTypeName(m_scanner->getCurrentToken()) ||
(m_scanner->getCurrentToken() == Token::IDENTIFIER && m_scanner->getCurrentToken() == Token::IDENTIFIER) &&
m_scanner->peekNextToken() == Token::IDENTIFIER)) m_scanner->peekNextToken() == Token::IDENTIFIER))
statement = parseVariableDefinition(); statement = parseVariableDefinition();
else // "ordinary" expression else // "ordinary" expression
statement = parseExpression(); statement = parseExpression();

10
test/solidityParser.cpp

@ -211,7 +211,15 @@ BOOST_AUTO_TEST_CASE(else_if_statement)
BOOST_CHECK_NO_THROW(parseText(text)); 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() BOOST_AUTO_TEST_SUITE_END()

Loading…
Cancel
Save