public Token PreCompleteClass()
{
Token tok = this.Next();
while (!tok.IsEnd() && !tok.IsLeftBracket())
{
tok = tok.Next();
}
if (tok.IsEnd())
{
Program.Log("Bad class definition?\n");
return(tok);
}
int depth = 1;
while (depth > 0)
{
tok = tok.Next();
if (tok.IsEnd())
{
Program.Log("Failure on class closure: " + this.Next().Value);
return(tok);
}
if (tok.IsLeftBracket())
{
depth++;
}
else if (tok.IsRightBracket())
{
depth--;
}
}
return(tok);
}