1 write to _lexer
Microsoft.CodeAnalysis.CSharp (1)
Parser\Lexer_StringLiteral.cs (1)
357_lexer = lexer;
127 references to _lexer
Microsoft.CodeAnalysis.CSharp (127)
Parser\Lexer_StringLiteral.cs (127)
368char ch = _lexer.TextWindow.PeekChar(); 371(ch == SlidingTextWindow.InvalidCharacter && _lexer.TextWindow.IsReallyAtEnd()); 388var start = _lexer.TextWindow.Position; 390Debug.Assert(_lexer.TextWindow.Position != start); 392openQuoteRange = start.._lexer.TextWindow.Position; 398closeQuoteRange = _lexer.TextWindow.Position.._lexer.TextWindow.Position; 421ref var window = ref _lexer.TextWindow; 453var prefixAtCount = _lexer.ConsumeAtSignSequence(); 454startingDollarSignCount = _lexer.ConsumeDollarSignSequence(); 456var suffixAtCount = _lexer.ConsumeAtSignSequence(); 457startingQuoteCount = _lexer.ConsumeQuoteSequence(); 480TrySetError(_lexer.MakeError(start, window.Position - start, ErrorCode.ERR_StringMustStartWithQuoteCharacter)); 491TrySetError(_lexer.MakeError(start, window.Position - start, ErrorCode.ERR_IllegalAtSequence)); 497TrySetError(_lexer.MakeError(window.Position - startingQuoteCount, startingQuoteCount, ErrorCode.ERR_NotEnoughQuotesForRawString)); 503_lexer.ConsumeWhitespace(); 526var closeQuotePosition = _lexer.TextWindow.Position; 538_lexer.ScanUtf8Suffix(); 543closeQuoteRange = closeQuotePosition.._lexer.TextWindow.Position; 550if (_lexer.TextWindow.PeekChar() != '"') 556TrySetError(_lexer.MakeError( 557IsAtEnd(allowNewline: true) ? _lexer.TextWindow.Position - 1 : _lexer.TextWindow.Position, 563_lexer.TextWindow.AdvanceChar(); // " 573if (_lexer.TextWindow.PeekChar() != '"') 579TrySetError(_lexer.MakeError( 580_lexer.TextWindow.Position, 581width: SyntaxFacts.IsNewLine(_lexer.TextWindow.PeekChar()) ? 1 : 0, ErrorCode.ERR_UnterminatedRawString)); 585var closeQuoteCount = _lexer.ConsumeQuoteSequence(); 597TrySetError(_lexer.MakeError( 598position: _lexer.TextWindow.Position - excessQuoteCount, 614TrySetError(_lexer.MakeError( 615_lexer.TextWindow.Position, width: 0, ErrorCode.ERR_UnterminatedRawString)); 617else if (_lexer.TextWindow.PeekChar() == '"') 620var closeQuoteCount = _lexer.ConsumeQuoteSequence(); 625TrySetError(_lexer.MakeError( 626position: _lexer.TextWindow.Position - closeQuoteCount, 632_lexer.TextWindow.AdvancePastNewLine(); 633_lexer.ConsumeWhitespace(); 635var closeQuoteCount = _lexer.ConsumeQuoteSequence(); 644TrySetError(_lexer.MakeError( 645position: _lexer.TextWindow.Position - excessQuoteCount, 677switch (_lexer.TextWindow.PeekChar()) 697var escapeStart = _lexer.TextWindow.Position; 698char ch = _lexer.ScanEscapeSequence(surrogateCharacter: out _); 701TrySetError(_lexer.MakeError(escapeStart, _lexer.TextWindow.Position - escapeStart, ErrorCode.ERR_EscapedCurly, ch)); 706_lexer.TextWindow.AdvanceChar(); 713_lexer.TextWindow.AdvanceChar(); 723_lexer.ConsumeWhitespace(); 724var beforeQuotesPosition = _lexer.TextWindow.Position; 725var closeQuoteCount = _lexer.ConsumeQuoteSequence(); 731this.TrySetError(_lexer.MakeError( 732_lexer.TextWindow.Position - closeQuoteCount, closeQuoteCount, ErrorCode.ERR_RawStringMustContainContent)); 733_lexer.TextWindow.Reset(beforeQuotesPosition); 747var startPosition = _lexer.TextWindow.Position; 748if (SyntaxFacts.IsNewLine(_lexer.TextWindow.PeekChar())) 750_lexer.TextWindow.AdvancePastNewLine(); 751_lexer.ConsumeWhitespace(); 752var closeQuoteCount = _lexer.ConsumeQuoteSequence(); 754_lexer.TextWindow.Reset(startPosition); 790if (_lexer.TextWindow.PeekChar(1) != '"') 796_lexer.TextWindow.AdvanceChar(2); // "" 802var beforeQuotePosition = _lexer.TextWindow.Position; 803var currentQuoteCount = _lexer.ConsumeQuoteSequence(); 809_lexer.TextWindow.Reset(beforeQuotePosition); 822var pos = _lexer.TextWindow.Position; 823_lexer.TextWindow.AdvanceChar(); // } 826if (_lexer.TextWindow.PeekChar() == '}') 828_lexer.TextWindow.AdvanceChar(); // } 832TrySetError(_lexer.MakeError(pos, 1, ErrorCode.ERR_UnescapedCurly, "}")); 844var closeBraceCount = _lexer.ConsumeCloseBraceSequence(); 847TrySetError(_lexer.MakeError( 848position: _lexer.TextWindow.Position - closeBraceCount, 870if (_lexer.TextWindow.PeekChar(1) == '{') 872_lexer.TextWindow.AdvanceChar(2); // {{ 876int openBracePosition = _lexer.TextWindow.Position; 877_lexer.TextWindow.AdvanceChar(); 879int closeBracePosition = _lexer.TextWindow.Position; 880if (_lexer.TextWindow.PeekChar() == '}') 882_lexer.TextWindow.AdvanceChar(); 886TrySetError(_lexer.MakeError(openBracePosition - 1, 2, ErrorCode.ERR_UnclosedExpressionHole)); 892new Range(closeBracePosition, _lexer.TextWindow.Position))); 905var beforeOpenBracesPosition = _lexer.TextWindow.Position; 906var openBraceCount = _lexer.ConsumeOpenBraceSequence(); 913var afterOpenBracePosition = _lexer.TextWindow.Position; 918TrySetError(_lexer.MakeError( 927var beforeCloseBracePosition = _lexer.TextWindow.Position; 928var closeBraceCount = _lexer.ConsumeCloseBraceSequence(); 933TrySetError(_lexer.MakeError( 941TrySetError(_lexer.MakeError( 950_lexer.TextWindow.Reset(beforeCloseBracePosition + startingDollarSignCount); 956beforeCloseBracePosition.._lexer.TextWindow.Position)); 972Debug.Assert(_lexer.TextWindow.PeekChar() == ':'); 973_lexer.TextWindow.AdvanceChar(); 976char ch = _lexer.TextWindow.PeekChar(); 980var pos = _lexer.TextWindow.Position; 981ch = _lexer.ScanEscapeSequence(surrogateCharacter: out _); 984TrySetError(_lexer.MakeError(pos, 1, ErrorCode.ERR_EscapedCurly, ch)); 989if (kind is InterpolatedStringKind.Verbatim && _lexer.TextWindow.PeekChar(1) == '"') 991_lexer.TextWindow.AdvanceChar(2); // "" 1000TrySetError(_lexer.MakeError( 1001_lexer.TextWindow.Position, 1, ErrorCode.ERR_UnexpectedCharacter, ch)); 1002_lexer.TextWindow.AdvanceChar(); 1014_lexer.TextWindow.AdvanceChar(); 1027char ch = _lexer.TextWindow.PeekChar(); 1041TrySetError(_lexer.MakeError(_lexer.TextWindow.Position, 1, ErrorCode.ERR_SyntaxError, endingChar.ToString())); 1042_lexer.TextWindow.AdvanceChar(); 1047if (_lexer.TryScanInterpolatedString(ref discarded)) 1059colonRange = new Range(_lexer.TextWindow.Position, _lexer.TextWindow.Position + 1); 1073TrySetError(_lexer.MakeError(_lexer.TextWindow.Position, 1, ErrorCode.ERR_SyntaxError, endingChar.ToString())); 1096if (_lexer.TryScanAtStringToken(ref discarded)) 1099if (_lexer.TextWindow.PeekChar(1) == '*') 1103_lexer.ScanMultiLineComment(isTerminated: out _, delimiter: '@'); 1111switch (_lexer.TextWindow.PeekChar(1)) 1114_lexer.ScanToEndOfLine(); 1117_lexer.ScanMultiLineComment(isTerminated: out _, '/'); 1120_lexer.TextWindow.AdvanceChar(); 1137_lexer.TextWindow.AdvanceChar(); 1153_lexer.ScanStringLiteral(ref info, inDirective: false); 1158Debug.Assert(start == _lexer.TextWindow.PeekChar()); 1159_lexer.TextWindow.AdvanceChar(); 1161if (_lexer.TextWindow.PeekChar() == end) 1163_lexer.TextWindow.AdvanceChar();