Remove linking to unqualified library name

- SemanticTests accepts fully qualified library name and also unqualifed library name when
the library is defined in the same file for convenience.
- commandline tests are added!

Signed-off-by: soroosh-sdi <soroosh.sardari@gmail.com>
This commit is contained in:
soroosh-sdi
2021-10-20 18:11:58 +03:30
parent 1e630fc584
commit 816d8021e4
33 changed files with 242 additions and 64 deletions
+20 -2
View File
@@ -100,8 +100,26 @@ vector<solidity::frontend::test::FunctionCall> TestFileParser::parseFunctionCall
if (accept(Token::Library, true))
{
expect(Token::Colon);
call.signature = m_scanner.currentLiteral();
expect(Token::Identifier);
string libraryName;
if (accept(Token::String))
{
libraryName = m_scanner.currentLiteral();
expect(Token::String);
expect(Token::Colon);
libraryName += ':' + m_scanner.currentLiteral();
expect(Token::Identifier);
}
else if (accept(Token::Colon, true))
{
libraryName = ':' + m_scanner.currentLiteral();
expect(Token::Identifier);
}
else
{
libraryName = m_scanner.currentLiteral();
expect(Token::Identifier);
}
call.signature = libraryName;
call.kind = FunctionCall::Kind::Library;
call.expectations.failure = false;
}