-
-
Save anonymous/f97a83461914d83e0b1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static bool ParseImportStmt(TokenIterator& it, const TokenIterator& end) | |
{ | |
if ((*it).type == TokenType::Import) | |
{ | |
std::vector<Token> idChain; | |
do | |
{ | |
Token id = *(++it); | |
if (it->type != TokenType::Identifier) | |
{ | |
return false; | |
} | |
idChain.push_back(id); | |
} | |
while ((++it)->type == TokenType::Dot); | |
if (it->type == TokenType::Semicolon) | |
{ | |
return ParseImportStmt(it, end); | |
} | |
else | |
{ | |
return false; | |
} | |
} | |
else | |
{ | |
return ParseFunctionDefinition(it, end); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment