From fc8e50f688bad9c13259fc926142b838d7aba5d3 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 27 Jan 2017 18:27:59 +0100 Subject: Refactor NameAndTypeResolver and SyntaxChecker to allow other entry points. --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 0151d244..29856d31 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -1080,7 +1080,7 @@ BOOST_AUTO_TEST_CASE(modifier_returns_value) modifier mod(uint a) { _; return 7; } } )"; - CHECK_ERROR(text, TypeError, ""); + CHECK_ERROR(text, TypeError, "Return arguments not allowed."); } BOOST_AUTO_TEST_CASE(state_variable_accessors) -- cgit v1.2.3 From e67faa9839ebd0dadef2adf3ed1ef69fac6f65e1 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 31 Jan 2017 22:59:56 +0100 Subject: Extract scopes into compiler stack. --- test/libsolidity/Assembly.cpp | 3 ++- test/libsolidity/SolidityExpressionCompiler.cpp | 3 ++- test/libsolidity/SolidityNameAndTypeResolution.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/libsolidity/Assembly.cpp b/test/libsolidity/Assembly.cpp index 497bfc77..c4ec0d20 100644 --- a/test/libsolidity/Assembly.cpp +++ b/test/libsolidity/Assembly.cpp @@ -53,7 +53,8 @@ eth::AssemblyItems compileContract(const string& _sourceCode) BOOST_REQUIRE_NO_THROW(sourceUnit = parser.parse(make_shared(CharStream(_sourceCode)))); BOOST_CHECK(!!sourceUnit); - NameAndTypeResolver resolver({}, errors); + map> scopes; + NameAndTypeResolver resolver({}, scopes, errors); solAssert(Error::containsOnlyWarnings(errors), ""); resolver.registerDeclarations(*sourceUnit); for (ASTPointer const& node: sourceUnit->nodes()) diff --git a/test/libsolidity/SolidityExpressionCompiler.cpp b/test/libsolidity/SolidityExpressionCompiler.cpp index a769776e..3116aea8 100644 --- a/test/libsolidity/SolidityExpressionCompiler.cpp +++ b/test/libsolidity/SolidityExpressionCompiler.cpp @@ -114,7 +114,8 @@ bytes compileFirstExpression( declarations.push_back(variable.get()); ErrorList errors; - NameAndTypeResolver resolver(declarations, errors); + map> scopes; + NameAndTypeResolver resolver(declarations, scopes, errors); resolver.registerDeclarations(*sourceUnit); vector inheritanceHierarchy; diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 29856d31..1a4f3cdc 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -66,7 +66,8 @@ parseAnalyseAndReturnError(string const& _source, bool _reportWarnings = false, return make_pair(sourceUnit, errors.at(0)); std::shared_ptr globalContext = make_shared(); - NameAndTypeResolver resolver(globalContext->declarations(), errors); + map> scopes; + NameAndTypeResolver resolver(globalContext->declarations(), scopes, errors); solAssert(Error::containsOnlyWarnings(errors), ""); resolver.registerDeclarations(*sourceUnit); -- cgit v1.2.3