1 write to _lexer
Microsoft.CodeAnalysis.CSharp (1)
Parser\Lexer_StringLiteral.cs (1)
351_lexer = lexer;
126 references to _lexer
Microsoft.CodeAnalysis.CSharp (126)
Parser\Lexer_StringLiteral.cs (126)
361char ch = _lexer.TextWindow.PeekChar(); 364(ch == SlidingTextWindow.InvalidCharacter && _lexer.TextWindow.IsReallyAtEnd()); 381var start = _lexer.TextWindow.Position; 383Debug.Assert(_lexer.TextWindow.Position != start); 385openQuoteRange = start.._lexer.TextWindow.Position; 391closeQuoteRange = _lexer.TextWindow.Position.._lexer.TextWindow.Position; 414var window = _lexer.TextWindow; 446var prefixAtCount = _lexer.ConsumeAtSignSequence(); 447startingDollarSignCount = _lexer.ConsumeDollarSignSequence(); 450var suffixAtCount = _lexer.ConsumeAtSignSequence(); 451startingQuoteCount = _lexer.ConsumeQuoteSequence(); 464TrySetError(_lexer.MakeError(start, window.Position - start, ErrorCode.ERR_StringMustStartWithQuoteCharacter)); 475TrySetError(_lexer.MakeError(start, window.Position - start, ErrorCode.ERR_IllegalAtSequence)); 481TrySetError(_lexer.MakeError(window.Position - startingQuoteCount, startingQuoteCount, ErrorCode.ERR_NotEnoughQuotesForRawString)); 487_lexer.ConsumeWhitespace(builder: null); 510var closeQuotePosition = _lexer.TextWindow.Position; 524closeQuoteRange = closeQuotePosition.._lexer.TextWindow.Position; 531if (_lexer.TextWindow.PeekChar() != '"') 537TrySetError(_lexer.MakeError( 538IsAtEnd(allowNewline: true) ? _lexer.TextWindow.Position - 1 : _lexer.TextWindow.Position, 544_lexer.TextWindow.AdvanceChar(); // " 554if (_lexer.TextWindow.PeekChar() != '"') 560TrySetError(_lexer.MakeError( 561IsAtEnd(allowNewline: true) ? _lexer.TextWindow.Position - 1 : _lexer.TextWindow.Position, 566var closeQuoteCount = _lexer.ConsumeQuoteSequence(); 578TrySetError(_lexer.MakeError( 579position: _lexer.TextWindow.Position - excessQuoteCount, 595TrySetError(_lexer.MakeError( 596_lexer.TextWindow.Position - 1, width: 1, ErrorCode.ERR_UnterminatedRawString)); 598else if (_lexer.TextWindow.PeekChar() == '"') 601var closeQuoteCount = _lexer.ConsumeQuoteSequence(); 606TrySetError(_lexer.MakeError( 607position: _lexer.TextWindow.Position - closeQuoteCount, 613_lexer.TextWindow.AdvancePastNewLine(); 614_lexer.ConsumeWhitespace(builder: null); 616var closeQuoteCount = _lexer.ConsumeQuoteSequence(); 625TrySetError(_lexer.MakeError( 626position: _lexer.TextWindow.Position - excessQuoteCount, 658switch (_lexer.TextWindow.PeekChar()) 678var escapeStart = _lexer.TextWindow.Position; 679char ch = _lexer.ScanEscapeSequence(surrogateCharacter: out _); 682TrySetError(_lexer.MakeError(escapeStart, _lexer.TextWindow.Position - escapeStart, ErrorCode.ERR_EscapedCurly, ch)); 687_lexer.TextWindow.AdvanceChar(); 694_lexer.TextWindow.AdvanceChar(); 704_lexer.ConsumeWhitespace(builder: null); 705var beforeQuotesPosition = _lexer.TextWindow.Position; 706var closeQuoteCount = _lexer.ConsumeQuoteSequence(); 712this.TrySetError(_lexer.MakeError( 713_lexer.TextWindow.Position - closeQuoteCount, closeQuoteCount, ErrorCode.ERR_RawStringMustContainContent)); 714_lexer.TextWindow.Reset(beforeQuotesPosition); 728var startPosition = _lexer.TextWindow.Position; 729if (SyntaxFacts.IsNewLine(_lexer.TextWindow.PeekChar())) 731_lexer.TextWindow.AdvancePastNewLine(); 732_lexer.ConsumeWhitespace(builder: null); 733var closeQuoteCount = _lexer.ConsumeQuoteSequence(); 735_lexer.TextWindow.Reset(startPosition); 771if (_lexer.TextWindow.PeekChar(1) != '"') 777_lexer.TextWindow.AdvanceChar(2); // "" 783var beforeQuotePosition = _lexer.TextWindow.Position; 784var currentQuoteCount = _lexer.ConsumeQuoteSequence(); 790_lexer.TextWindow.Reset(beforeQuotePosition); 803var pos = _lexer.TextWindow.Position; 804_lexer.TextWindow.AdvanceChar(); // } 807if (_lexer.TextWindow.PeekChar() == '}') 809_lexer.TextWindow.AdvanceChar(); // } 813TrySetError(_lexer.MakeError(pos, 1, ErrorCode.ERR_UnescapedCurly, "}")); 825var closeBraceCount = _lexer.ConsumeCloseBraceSequence(); 828TrySetError(_lexer.MakeError( 829position: _lexer.TextWindow.Position - closeBraceCount, 851if (_lexer.TextWindow.PeekChar(1) == '{') 853_lexer.TextWindow.AdvanceChar(2); // {{ 857int openBracePosition = _lexer.TextWindow.Position; 858_lexer.TextWindow.AdvanceChar(); 860int closeBracePosition = _lexer.TextWindow.Position; 861if (_lexer.TextWindow.PeekChar() == '}') 863_lexer.TextWindow.AdvanceChar(); 867TrySetError(_lexer.MakeError(openBracePosition - 1, 2, ErrorCode.ERR_UnclosedExpressionHole)); 873new Range(closeBracePosition, _lexer.TextWindow.Position))); 886var beforeOpenBracesPosition = _lexer.TextWindow.Position; 887var openBraceCount = _lexer.ConsumeOpenBraceSequence(); 894var afterOpenBracePosition = _lexer.TextWindow.Position; 899TrySetError(_lexer.MakeError( 908var beforeCloseBracePosition = _lexer.TextWindow.Position; 909var closeBraceCount = _lexer.ConsumeCloseBraceSequence(); 914TrySetError(_lexer.MakeError( 922TrySetError(_lexer.MakeError( 931_lexer.TextWindow.Reset(beforeCloseBracePosition + startingDollarSignCount); 937beforeCloseBracePosition.._lexer.TextWindow.Position)); 953Debug.Assert(_lexer.TextWindow.PeekChar() == ':'); 954_lexer.TextWindow.AdvanceChar(); 957char ch = _lexer.TextWindow.PeekChar(); 961var pos = _lexer.TextWindow.Position; 962ch = _lexer.ScanEscapeSequence(surrogateCharacter: out _); 965TrySetError(_lexer.MakeError(pos, 1, ErrorCode.ERR_EscapedCurly, ch)); 970if (kind is InterpolatedStringKind.Verbatim && _lexer.TextWindow.PeekChar(1) == '"') 972_lexer.TextWindow.AdvanceChar(2); // "" 981TrySetError(_lexer.MakeError( 982_lexer.TextWindow.Position, 1, ErrorCode.ERR_UnexpectedCharacter, ch)); 983_lexer.TextWindow.AdvanceChar(); 995_lexer.TextWindow.AdvanceChar(); 1008char ch = _lexer.TextWindow.PeekChar(); 1022TrySetError(_lexer.MakeError(_lexer.TextWindow.Position, 1, ErrorCode.ERR_SyntaxError, endingChar.ToString())); 1023_lexer.TextWindow.AdvanceChar(); 1028if (_lexer.TryScanInterpolatedString(ref discarded)) 1040colonRange = new Range(_lexer.TextWindow.Position, _lexer.TextWindow.Position + 1); 1054TrySetError(_lexer.MakeError(_lexer.TextWindow.Position, 1, ErrorCode.ERR_SyntaxError, endingChar.ToString())); 1077if (_lexer.TryScanAtStringToken(ref discarded)) 1080if (_lexer.TextWindow.PeekChar(1) == '*') 1084_lexer.ScanMultiLineComment(isTerminated: out _, delimiter: '@'); 1092switch (_lexer.TextWindow.PeekChar(1)) 1095_lexer.ScanToEndOfLine(); 1098_lexer.ScanMultiLineComment(isTerminated: out _, '/'); 1101_lexer.TextWindow.AdvanceChar(); 1118_lexer.TextWindow.AdvanceChar(); 1134_lexer.ScanStringLiteral(ref info, inDirective: false); 1139Debug.Assert(start == _lexer.TextWindow.PeekChar()); 1140_lexer.TextWindow.AdvanceChar(); 1142if (_lexer.TextWindow.PeekChar() == end) 1144_lexer.TextWindow.AdvanceChar();