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, string message) { tokenInfo = GetNextToken(); if (tokenInfo.Is(token)) { return true; } Report.AddError("?", message, tokenInfo.SourceFile, new SourceSpan(tokenInfo.GetSourceLocation(), default(SourceLocation)), null); return false; }