Skip to content

Instantly share code, notes, and snippets.

Created July 6, 2014 17:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/f97a83461914d83e0b1f to your computer and use it in GitHub Desktop.
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