Disallow empty import statements

This commit is contained in:
Alex Beregszaszi
2019-01-28 13:52:15 +00:00
parent 2fc7928697
commit 9aafa32825
4 changed files with 8 additions and 1 deletions
+2
View File
@@ -221,6 +221,8 @@ ASTPointer<ImportDirective> Parser::parseImportDirective()
fatalParserError("Expected import path.");
path = getLiteralAndAdvance();
}
if (path->empty())
fatalParserError("Import path cannot be empty.");
nodeFactory.markEndPosition();
expectToken(Token::Semicolon);
return nodeFactory.createNode<ImportDirective>(path, unitAlias, move(symbolAliases));