public void TokenAfterFromIsEof() { FirstTokenIsFrom(); IPyCompiler.Token token = tokenizer.GetNextToken(); Assert.AreEqual(IPyCompiler.TokenKind.EndOfFile, token.Kind); }
public void FirstTokenIsFrom() { string text = "from"; tokenizer = CreateTokenizer(text); IPyCompiler.Token token = tokenizer.GetNextToken(); Assert.AreEqual(IPyCompiler.TokenKind.KeywordFrom, token.Kind); }
IPyCompiler.Token GetToken(string text, int tokenNumber) { tokenizer = CreateTokenizer(text); IPyCompiler.Token token = null; for (int i = 0; i < tokenNumber; ++i) { token = tokenizer.GetNextToken(); } return token; }
IPyCompiler.Token GetToken(string text, int tokenNumber) { tokenizer = CreateTokenizer(text); IPyCompiler.Token token = null; for (int i = 0; i < tokenNumber; ++i) { token = tokenizer.GetNextToken(); } return(token); }