mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
added Error class for all kind of errors
Conflicts: libsolidity/Exceptions.h
This commit is contained in:
@@ -85,9 +85,12 @@ Declaration const& resolveDeclaration(
|
||||
return *declaration;
|
||||
}
|
||||
|
||||
bytes compileFirstExpression(const string& _sourceCode, vector<vector<string>> _functions = {},
|
||||
vector<vector<string>> _localVariables = {},
|
||||
vector<shared_ptr<MagicVariableDeclaration const>> _globalDeclarations = {})
|
||||
bytes compileFirstExpression(
|
||||
const string& _sourceCode,
|
||||
vector<vector<string>> _functions = {},
|
||||
vector<vector<string>> _localVariables = {},
|
||||
vector<shared_ptr<MagicVariableDeclaration const>> _globalDeclarations = {}
|
||||
)
|
||||
{
|
||||
Parser parser;
|
||||
ASTPointer<SourceUnit> sourceUnit;
|
||||
@@ -105,7 +108,9 @@ bytes compileFirstExpression(const string& _sourceCode, vector<vector<string>> _
|
||||
declarations.reserve(_globalDeclarations.size() + 1);
|
||||
for (ASTPointer<Declaration const> const& variable: _globalDeclarations)
|
||||
declarations.push_back(variable.get());
|
||||
NameAndTypeResolver resolver(declarations);
|
||||
/// TODO:
|
||||
ErrorList errorList;
|
||||
NameAndTypeResolver resolver(declarations, errorList);
|
||||
resolver.registerDeclarations(*sourceUnit);
|
||||
|
||||
vector<ContractDefinition const*> inheritanceHierarchy;
|
||||
|
||||
@@ -76,7 +76,7 @@ BOOST_AUTO_TEST_CASE(missing_variable_name_in_declaration)
|
||||
char const* text = "contract test {\n"
|
||||
" uint256 ;\n"
|
||||
"}\n";
|
||||
BOOST_CHECK_THROW(parseText(text), ParserError);
|
||||
BOOST_CHECK_THROW(parseText(text), Error);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(empty_function)
|
||||
|
||||
Reference in New Issue
Block a user