Skip to content

Instantly share code, notes, and snippets.

/gist:f97a83461914d83e0b1f Secret

Created Jul 6, 2014
Embed
What would you like to do?
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