private bool ExpectIdentifier(ref TokenInfo tokenInfo) { tokenInfo = GetNextToken(); if (tokenInfo.Is(Token.Identifier)) { return true; } Report.AddItem(VBErrors.IdentifierExpected, SourceFile, new SourceSpan(tokenInfo.GetSourceLocation(), default(SourceLocation)), null); return false; }
private bool Expect(Token token, ref TokenInfo tokenInfo) { tokenInfo = GetNextToken(); if (tokenInfo.Is(token)) { return true; } Expected(Report, token, ref tokenInfo); return false; }
private bool Expect(Token token, ref TokenInfo tokenInfo, string message) { tokenInfo = GetNextToken(); if (tokenInfo.Is(token)) { return true; } Report.AddError("?", message, tokenInfo.SourceFile, new SourceSpan(tokenInfo.GetSourceLocation(), default(SourceLocation)), null); return false; }
private bool charStringCond(TokenInfo token) { return !token.Is(Token.DoubleQuote) && !(token.Is(Token.EOL) || token.Is(Token.EOF)); }