Merge branch 'origin/develop' into develop_060

This commit is contained in:
chriseth
2019-10-02 16:29:36 +02:00
21 changed files with 175 additions and 50 deletions
+5 -3
View File
@@ -186,7 +186,7 @@ ASTPointer<ImportDirective> Parser::parseImportDirective()
expectToken(Token::Import);
ASTPointer<ASTString> path;
ASTPointer<ASTString> unitAlias = make_shared<string>();
vector<pair<ASTPointer<Identifier>, ASTPointer<ASTString>>> symbolAliases;
ImportDirective::SymbolAliasList symbolAliases;
if (m_scanner->currentToken() == Token::StringLiteral)
{
@@ -204,14 +204,16 @@ ASTPointer<ImportDirective> Parser::parseImportDirective()
m_scanner->next();
while (true)
{
ASTPointer<Identifier> id = parseIdentifier();
ASTPointer<ASTString> alias;
SourceLocation aliasLocation = SourceLocation{position(), endPosition(), source()};
ASTPointer<Identifier> id = parseIdentifier();
if (m_scanner->currentToken() == Token::As)
{
expectToken(Token::As);
aliasLocation = SourceLocation{position(), endPosition(), source()};
alias = expectIdentifierToken();
}
symbolAliases.emplace_back(move(id), move(alias));
symbolAliases.emplace_back(ImportDirective::SymbolAlias{move(id), move(alias), aliasLocation});
if (m_scanner->currentToken() != Token::Comma)
break;
m_scanner->next();