1 write to TextWindow
Microsoft.CodeAnalysis.CSharp (1)
Parser\AbstractLexer.cs (1)
21this.TextWindow = new SlidingTextWindow(text);
652 references to TextWindow
Microsoft.CodeAnalysis.CSharp (652)
Parser\AbstractLexer.cs (4)
26this.TextWindow.Dispose(); 31TextWindow.Start(); 134return position >= TextWindow.LexemeStartPosition ? position - TextWindow.LexemeStartPosition : position;
Parser\Blender.cs (1)
72_newPosition = lexer.TextWindow.Position;
Parser\Blender.Reader.cs (1)
168if (_lexer.TextWindow.Position != _newPosition)
Parser\DirectiveParser.cs (1)
34var hashPosition = lexer.TextWindow.Position;
Parser\LanguageParser.cs (2)
217return CreateForGlobalFailure(lexer.TextWindow.Position, createEmptyNodeFunc(this)); 227builder.Add(SyntaxFactory.BadToken(null, lexer.TextWindow.Text.ToString(), null));
Parser\Lexer.cs (466)
163this.TextWindow.Reset(position); 304this.LexSyntaxTrivia(afterFirstToken: TextWindow.Position > 0, isTrailing: false, triviaList: ref _leadingTriviaCache); 323this.LexSyntaxTrivia(afterFirstToken: TextWindow.Position > 0, isTrailing: false, triviaList: ref _leadingTriviaCache); 440int startingPosition = TextWindow.Position; 443character = TextWindow.PeekChar(); 452TextWindow.AdvanceChar(); 453if (TextWindow.PeekChar() == '=') 455TextWindow.AdvanceChar(); 468TextWindow.AdvanceChar(); 469if (TextWindow.PeekChar() == '.') 471TextWindow.AdvanceChar(); 472if (TextWindow.PeekChar() == '.') 491TextWindow.AdvanceChar(); 496TextWindow.AdvanceChar(); 497if (TextWindow.PeekChar() == ':') 499TextWindow.AdvanceChar(); 510TextWindow.AdvanceChar(); 515TextWindow.AdvanceChar(); 520TextWindow.AdvanceChar(); 521if (TextWindow.PeekChar() == '=') 523TextWindow.AdvanceChar(); 534TextWindow.AdvanceChar(); 535if ((character = TextWindow.PeekChar()) == '=') 537TextWindow.AdvanceChar(); 542TextWindow.AdvanceChar(); 553TextWindow.AdvanceChar(); 554if (TextWindow.PeekChar() == '=') 556TextWindow.AdvanceChar(); 567TextWindow.AdvanceChar(); 572TextWindow.AdvanceChar(); 577TextWindow.AdvanceChar(); 582TextWindow.AdvanceChar(); 587TextWindow.AdvanceChar(); 592TextWindow.AdvanceChar(); 597TextWindow.AdvanceChar(); 598if (TextWindow.PeekChar() == '?') 600TextWindow.AdvanceChar(); 602if (TextWindow.PeekChar() == '=') 604TextWindow.AdvanceChar(); 620TextWindow.AdvanceChar(); 621if ((character = TextWindow.PeekChar()) == '=') 623TextWindow.AdvanceChar(); 628TextWindow.AdvanceChar(); 639TextWindow.AdvanceChar(); 640if ((character = TextWindow.PeekChar()) == '=') 642TextWindow.AdvanceChar(); 647TextWindow.AdvanceChar(); 652TextWindow.AdvanceChar(); 663TextWindow.AdvanceChar(); 664if (TextWindow.PeekChar() == '=') 666TextWindow.AdvanceChar(); 677TextWindow.AdvanceChar(); 678if ((character = TextWindow.PeekChar()) == '=') 680TextWindow.AdvanceChar(); 683else if (TextWindow.PeekChar() == '&') 685TextWindow.AdvanceChar(); 696TextWindow.AdvanceChar(); 697if (TextWindow.PeekChar() == '=') 699TextWindow.AdvanceChar(); 710TextWindow.AdvanceChar(); 711if (TextWindow.PeekChar() == '=') 713TextWindow.AdvanceChar(); 716else if (TextWindow.PeekChar() == '|') 718TextWindow.AdvanceChar(); 729TextWindow.AdvanceChar(); 730if (TextWindow.PeekChar() == '=') 732TextWindow.AdvanceChar(); 735else if (TextWindow.PeekChar() == '<') 737TextWindow.AdvanceChar(); 738if (TextWindow.PeekChar() == '=') 740TextWindow.AdvanceChar(); 756TextWindow.AdvanceChar(); 757if (TextWindow.PeekChar() == '=') 759TextWindow.AdvanceChar(); 773Debug.Assert(TextWindow.PeekChar() == '@'); 775info.Text = TextWindow.GetText(intern: true); 868character = TextWindow.PeekCharOrUnicodeEscape(out surrogateCharacter); 880if (!TextWindow.IsReallyAtEnd()) 907TextWindow.NextCharOrUnicodeEscape(out surrogateCharacter, out error); 912TextWindow.AdvanceChar(); 918int end = TextWindow.Text.Length; 920info.Text = TextWindow.Text.ToString(new TextSpan(startingPosition, width)); 921TextWindow.Reset(end); 925info.Text = TextWindow.GetText(intern: true); 935Debug.Assert(TextWindow.PeekChar() == '@'); 938while (TextWindow.PeekChar(index) == '@') 943if (TextWindow.PeekChar(index) == '"') 949else if (TextWindow.PeekChar(index) == '$') 961Debug.Assert(TextWindow.PeekChar() == '$'); 963if (TextWindow.PeekChar(1) == '$') 969else if (TextWindow.PeekChar(1) == '@' && TextWindow.PeekChar(2) == '@') 975else if (TextWindow.PeekChar(1) == '"') 980else if (TextWindow.PeekChar(1) == '@') 1000int start = TextWindow.Position; 1002while ((ch = TextWindow.PeekChar()) >= '0' && ch <= '9') 1004TextWindow.AdvanceChar(); 1007return start < TextWindow.Position; 1013if (TextWindow.PeekChar() == '_') 1028char ch = TextWindow.PeekChar(); 1045TextWindow.AdvanceChar(); 1056int start = TextWindow.Position; 1071ch = TextWindow.PeekChar(); 1074ch = TextWindow.PeekChar(1); 1077TextWindow.AdvanceChar(2); 1083TextWindow.AdvanceChar(2); 1094if ((ch = TextWindow.PeekChar()) == 'L' || ch == 'l') 1096TextWindow.AdvanceChar(); 1098if ((ch = TextWindow.PeekChar()) == 'u' || ch == 'U') 1100TextWindow.AdvanceChar(); 1104else if ((ch = TextWindow.PeekChar()) == 'u' || ch == 'U') 1106TextWindow.AdvanceChar(); 1108if ((ch = TextWindow.PeekChar()) == 'L' || ch == 'l') 1110TextWindow.AdvanceChar(); 1119if (this.ModeIs(LexerMode.DebuggerSyntax) && TextWindow.PeekChar() == '#') 1122TextWindow.AdvanceChar(); 1123info.StringValue = info.Text = TextWindow.GetText(intern: true); 1129if ((ch = TextWindow.PeekChar()) == '.') 1131var ch2 = TextWindow.PeekChar(1); 1136TextWindow.AdvanceChar(); 1143TextWindow.Reset(start); 1148if ((ch = TextWindow.PeekChar()) == 'E' || ch == 'e') 1151TextWindow.AdvanceChar(); 1153if ((ch = TextWindow.PeekChar()) == '-' || ch == '+') 1156TextWindow.AdvanceChar(); 1159if (!(((ch = TextWindow.PeekChar()) >= '0' && ch <= '9') || ch == '_')) 1174if ((ch = TextWindow.PeekChar()) == 'f' || ch == 'F') 1176TextWindow.AdvanceChar(); 1181TextWindow.AdvanceChar(); 1186TextWindow.AdvanceChar(); 1194else if ((ch = TextWindow.PeekChar()) == 'f' || ch == 'F') 1196TextWindow.AdvanceChar(); 1201TextWindow.AdvanceChar(); 1206TextWindow.AdvanceChar(); 1211TextWindow.AdvanceChar(); 1213if ((ch = TextWindow.PeekChar()) == 'u' || ch == 'U') 1215TextWindow.AdvanceChar(); 1222TextWindow.AdvanceChar(); 1223if ((ch = TextWindow.PeekChar()) == 'L' || ch == 'l') 1225TextWindow.AdvanceChar(); 1233this.AddError(MakeError(start, TextWindow.Position - start, ErrorCode.ERR_InvalidNumber)); 1245info.Text = TextWindow.GetText(true); 1247var valueText = TextWindow.Intern(_builder); 1258info.DecimalValue = this.GetValueDecimal(valueText, start, TextWindow.Position); 1538var currentOffset = TextWindow.Offset; 1539var characterWindow = TextWindow.CharacterWindow; 1540var characterWindowCount = TextWindow.CharacterWindowCount; 1603TextWindow.AdvanceChar(length); 1604info.Text = info.StringValue = TextWindow.Intern(characterWindow, startOffset, length); 1696int start = TextWindow.Position; 1699while (TextWindow.PeekChar() == '@') 1701TextWindow.AdvanceChar(); 1704var atCount = TextWindow.Position - start; 1712char ch = TextWindow.PeekChar(); 1717if (!isEscaped && TextWindow.IsUnicodeEscape()) 1722ch = TextWindow.PeekUnicodeEscape(out surrogateCharacter); 1735if (!TextWindow.IsReallyAtEnd()) 1806(char.ToLower(TextWindow.PeekChar(1)) == 'x')) 1848if (_identLen == 0 && this.ModeIs(LexerMode.DebuggerSyntax) && TextWindow.PeekChar(1) == '>') 1851TextWindow.AdvanceChar(2); 1873TextWindow.NextCharOrUnicodeEscape(out surrogateCharacter, out error); 1878TextWindow.AdvanceChar(); 1897TextWindow.NextCharOrUnicodeEscape(out surrogateCharacter, out error); 1902TextWindow.AdvanceChar(); 1913var width = TextWindow.Width; // exact size of input characters 1916info.Text = TextWindow.GetInternedText(); 1925info.StringValue = TextWindow.Intern(_identBuffer, 0, _identLen); 1933var valueText = TextWindow.Intern(_identBuffer, objectAddressOffset, _identLen - objectAddressOffset); 1954TextWindow.Reset(start); 1980int start = TextWindow.Position; 1999int beforeConsumed = TextWindow.Position; 2003if (TextWindow.PeekChar() == '&') 2005if (!TextWindow.TryScanXmlEntity(out consumedChar, out consumedSurrogate)) 2008TextWindow.Reset(beforeConsumed); 2014consumedChar = TextWindow.NextChar(); 2034if (!isEscaped && (TextWindow.Position == beforeConsumed + 1) && 2035(TextWindow.PeekChar() == 'u' || TextWindow.PeekChar() == 'U')) 2041TextWindow.Reset(beforeConsumed); 2045consumedChar = TextWindow.NextUnicodeEscape(out consumedSurrogate, out error); 2123TextWindow.Reset(beforeConsumed); 2141TextWindow.Reset(beforeConsumed); 2144if (!TextWindow.IsReallyAtEnd()) 2149TextWindow.Reset(beforeConsumed); 2171TextWindow.Reset(beforeConsumed); 2192var width = TextWindow.Width; // exact size of input characters 2197info.StringValue = TextWindow.GetInternedText(); 2202info.StringValue = TextWindow.Intern(_identBuffer, 0, _identLen); 2203info.Text = TextWindow.GetText(intern: false); 2212TextWindow.Reset(start); 2281char ch = TextWindow.PeekChar(); 2309if ((ch = TextWindow.PeekChar(1)) == '/') 2311if (!this.SuppressDocumentationCommentParse && TextWindow.PeekChar(2) == '/' && TextWindow.PeekChar(3) != '/') 2326var text = TextWindow.GetText(false); 2333if (!this.SuppressDocumentationCommentParse && TextWindow.PeekChar(2) == '*' && 2334TextWindow.PeekChar(3) != '*' && TextWindow.PeekChar(3) != '/') 2355var text = TextWindow.GetText(false); 2418var position = TextWindow.Position; 2419var text = TextWindow.Text; 2452this.AddError(TextWindow.Position, s_conflictMarkerLength, 2455var startCh = this.TextWindow.PeekChar(); 2481var ch = this.TextWindow.PeekChar(); 2500this.TextWindow.AdvanceChar(); 2503if (this.TextWindow.Width > 0) 2505this.AddTrivia(SyntaxFactory.DisabledText(TextWindow.GetText(false)), ref triviaList); 2519while (SyntaxFacts.IsNewLine(this.TextWindow.PeekChar())) 2521this.TextWindow.AdvanceChar(); 2524if (this.TextWindow.Width > 0) 2526this.AddTrivia(SyntaxFactory.EndOfLine(TextWindow.GetText(false)), ref triviaList); 2534var ch = this.TextWindow.PeekChar(); 2540this.TextWindow.AdvanceChar(); 2543this.AddTrivia(SyntaxFactory.ConflictMarker(TextWindow.GetText(false)), ref triviaList); 2563if (TextWindow.PeekChar() == '/' && TextWindow.PeekChar(1) == '*') 2565TextWindow.AdvanceChar(2); 2570if ((ch = TextWindow.PeekChar()) == SlidingTextWindow.InvalidCharacter && TextWindow.IsReallyAtEnd()) 2575else if (ch == '*' && TextWindow.PeekChar(1) == '/') 2577TextWindow.AdvanceChar(2); 2583TextWindow.AdvanceChar(); 2599while (!SyntaxFacts.IsNewLine(ch = TextWindow.PeekChar()) && 2600(ch != SlidingTextWindow.InvalidCharacter || !TextWindow.IsReallyAtEnd())) 2602TextWindow.AdvanceChar(); 2613switch (ch = TextWindow.PeekChar()) 2616TextWindow.AdvanceChar(); 2617if (TextWindow.PeekChar() == '\n') 2619TextWindow.AdvanceChar(); 2625TextWindow.AdvanceChar(); 2630TextWindow.AdvanceChar(); 2653char ch = TextWindow.PeekChar(); 2665TextWindow.AdvanceChar(); 2682if (TextWindow.Width == 1 && onlySpaces) 2688var width = TextWindow.Width; 2693TextWindow.CharacterWindow, 2694TextWindow.LexemeRelativeStart, 2710return SyntaxFactory.Whitespace(TextWindow.GetText(intern: true)); 2764if (SyntaxFacts.IsWhitespace(TextWindow.PeekChar())) 2789int lastLineStart = TextWindow.Position; 2795char ch = TextWindow.PeekChar(); 2799if (!TextWindow.IsReallyAtEnd()) 2805return TextWindow.Width > 0 ? SyntaxFactory.DisabledText(TextWindow.GetText(false)) : null; 2809if (lastLineStart < TextWindow.Position && !allWhitespace) 2814TextWindow.Reset(lastLineStart); // reset so directive parser can consume the starting whitespace on this line 2815return TextWindow.Width > 0 ? SyntaxFactory.DisabledText(TextWindow.GetText(false)) : null; 2819lastLineStart = TextWindow.Position; 2830TextWindow.AdvanceChar(); 2853var ch = this.TextWindow.PeekChar(); 2859else if (ch is SlidingTextWindow.InvalidCharacter && this.TextWindow.IsReallyAtEnd()) 2867this.TextWindow.AdvanceChar(); 2887switch (character = TextWindow.PeekChar()) 2890if (!TextWindow.IsReallyAtEnd()) 2905TextWindow.AdvanceChar(); 2910TextWindow.AdvanceChar(); 2915TextWindow.AdvanceChar(); 2920TextWindow.AdvanceChar(); 2925TextWindow.AdvanceChar(); 2930TextWindow.AdvanceChar(); 2931if (TextWindow.PeekChar() == '=') 2933TextWindow.AdvanceChar(); 2944TextWindow.AdvanceChar(); 2945if (TextWindow.PeekChar() == '=') 2947TextWindow.AdvanceChar(); 2958if (TextWindow.PeekChar(1) == '&') 2960TextWindow.AdvanceChar(2); 2968if (TextWindow.PeekChar(1) == '|') 2970TextWindow.AdvanceChar(2); 2989info.Text = TextWindow.GetText(true); 3001character = TextWindow.PeekCharOrUnicodeEscape(out surrogateCharacter); 3028TextWindow.NextCharOrUnicodeEscape(out surrogateCharacter, out error); 3033TextWindow.AdvanceChar(); 3037info.Text = TextWindow.GetText(true); 3054var pos = TextWindow.Position; 3069TextWindow.Reset(pos); 3088char ch = TextWindow.PeekChar(); 3092if (TextWindow.PeekChar(1) == '/') 3096var text = TextWindow.GetText(false); 3150Debug.Assert(this.LocationIs(XmlDocCommentLocation.End) || TextWindow.PeekChar() == SlidingTextWindow.InvalidCharacter); 3159this.AddError(TextWindow.LexemeStartPosition, TextWindow.Width, ErrorCode.ERR_OpenEndedComment); 3195switch (ch = TextWindow.PeekChar()) 3212if (!TextWindow.IsReallyAtEnd()) 3238info.StringValue = info.Text = TextWindow.GetText(intern: false); 3245Debug.Assert(TextWindow.PeekChar() == '<'); 3247if (TextWindow.PeekChar(1) == '!') 3249if (TextWindow.PeekChar(2) == '-' 3250&& TextWindow.PeekChar(3) == '-') 3252TextWindow.AdvanceChar(4); 3255else if (TextWindow.PeekChar(2) == '[' 3256&& TextWindow.PeekChar(3) == 'C' 3257&& TextWindow.PeekChar(4) == 'D' 3258&& TextWindow.PeekChar(5) == 'A' 3259&& TextWindow.PeekChar(6) == 'T' 3260&& TextWindow.PeekChar(7) == 'A' 3261&& TextWindow.PeekChar(8) == '[') 3263TextWindow.AdvanceChar(9); 3269TextWindow.AdvanceChar(); 3273else if (TextWindow.PeekChar(1) == '/') 3275TextWindow.AdvanceChar(2); 3278else if (TextWindow.PeekChar(1) == '?') 3280TextWindow.AdvanceChar(2); 3285TextWindow.AdvanceChar(); 3294Debug.Assert(TextWindow.PeekChar() == '&'); 3295TextWindow.AdvanceChar(); 3301if (IsXmlNameStartChar(ch = TextWindow.PeekChar())) 3303while (IsXmlNameChar(ch = TextWindow.PeekChar())) 3311TextWindow.AdvanceChar(); 3340TextWindow.AdvanceChar(); 3341bool isHex = TextWindow.PeekChar() == 'x'; 3346TextWindow.AdvanceChar(); // x 3347while (SyntaxFacts.IsHexDigit(ch = TextWindow.PeekChar())) 3349TextWindow.AdvanceChar(); 3360while (SyntaxFacts.IsDecDigit(ch = TextWindow.PeekChar())) 3362TextWindow.AdvanceChar(); 3372if (TextWindow.PeekChar() != ';') 3417ch = TextWindow.PeekChar(); 3420TextWindow.AdvanceChar(); 3434info.Text = TextWindow.GetText(true); 3462if (TextWindow.PeekChar() == ']' && TextWindow.PeekChar(1) == ']' && TextWindow.PeekChar(2) == '>') 3464TextWindow.AdvanceChar(3); 3465info.StringValue = info.Text = TextWindow.GetText(false); 3472var ch = TextWindow.PeekChar(); 3476if (!TextWindow.IsReallyAtEnd()) 3481info.StringValue = info.Text = TextWindow.GetText(false); 3487info.StringValue = info.Text = TextWindow.GetText(false); 3491if (this.StyleIs(XmlDocCommentStyle.Delimited) && TextWindow.PeekChar(1) == '/') 3494info.StringValue = info.Text = TextWindow.GetText(false); 3501if (TextWindow.PeekChar(1) == ']' && TextWindow.PeekChar(2) == '>') 3503info.StringValue = info.Text = TextWindow.GetText(false); 3515TextWindow.AdvanceChar(); 3562switch (ch = TextWindow.PeekChar()) 3569TextWindow.AdvanceChar(); 3574if (TextWindow.PeekChar(1) == '>') 3576TextWindow.AdvanceChar(2); 3584TextWindow.AdvanceChar(); 3589TextWindow.AdvanceChar(); 3594TextWindow.AdvanceChar(); 3599TextWindow.AdvanceChar(); 3609if (!TextWindow.IsReallyAtEnd()) 3618if (this.StyleIs(XmlDocCommentStyle.Delimited) && TextWindow.PeekChar(1) == '/') 3641TextWindow.AdvanceChar(); 3643info.StringValue = info.Text = TextWindow.GetText(false); 3655int start = TextWindow.Position; 3659char ch = TextWindow.PeekChar(); 3671TextWindow.AdvanceChar(); 3679info.Text = TextWindow.GetText(start, TextWindow.Position - start, intern: true); 3736switch (ch = TextWindow.PeekChar()) 3741TextWindow.AdvanceChar(); 3751TextWindow.AdvanceChar(); 3764TextWindow.AdvanceChar(); 3774if (!TextWindow.IsReallyAtEnd()) 3801var ch = TextWindow.PeekChar(); 3807info.StringValue = info.Text = TextWindow.GetText(false); 3816info.StringValue = info.Text = TextWindow.GetText(false); 3826info.StringValue = info.Text = TextWindow.GetText(false); 3830if (!TextWindow.IsReallyAtEnd()) 3835info.StringValue = info.Text = TextWindow.GetText(false); 3839if (this.StyleIs(XmlDocCommentStyle.Delimited) && TextWindow.PeekChar(1) == '/') 3842info.StringValue = info.Text = TextWindow.GetText(false); 3854TextWindow.AdvanceChar(); 3893switch (TextWindow.PeekChar()) 3900if (!TextWindow.IsReallyAtEnd()) 3908info.Text = info.StringValue = TextWindow.NextChar().ToString(); 3953int beforeConsumed = TextWindow.Position; 3954char consumedChar = TextWindow.NextChar(); 3980info.Text = TextWindow.GetText(intern: false); 3985if (!TextWindow.IsReallyAtEnd()) 3995TextWindow.Reset(beforeConsumed); 4000TextWindow.Reset(beforeConsumed); 4001if (!TextWindow.TryScanXmlEntity(out consumedChar, out consumedSurrogate)) 4003TextWindow.Reset(beforeConsumed); 4029Debug.Assert(TextWindow.Position > beforeConsumed, "First character or entity has been consumed."); 4059if (TextWindow.PeekChar() == '.') 4144string actualText = TextWindow.GetText(intern: false); 4157TextWindow.Reset(beforeConsumed); 4190if (TextWindow.PeekChar() == '@') 4192TextWindow.NextChar(); 4193info.Text = TextWindow.GetText(intern: true); 4203else if (TextWindow.PeekChar() == '&') 4212char bad = TextWindow.NextChar(); 4213info.Text = TextWindow.GetText(intern: false); 4241char peekCh = TextWindow.PeekChar(); 4246TextWindow.AdvanceChar(); 4252int pos = TextWindow.Position; 4256if (TextWindow.TryScanXmlEntity(out nextChar, out nextSurrogate) 4262TextWindow.Reset(pos); 4359switch (ch = TextWindow.PeekChar()) 4362if (TextWindow.PeekChar(1) == ']' && TextWindow.PeekChar(2) == '>') 4364TextWindow.AdvanceChar(3); 4377if (!TextWindow.IsReallyAtEnd()) 4403var ch = TextWindow.PeekChar(); 4407if (TextWindow.PeekChar(1) == ']' && TextWindow.PeekChar(2) == '>') 4409info.StringValue = info.Text = TextWindow.GetText(false); 4417info.StringValue = info.Text = TextWindow.GetText(false); 4421if (!TextWindow.IsReallyAtEnd()) 4426info.StringValue = info.Text = TextWindow.GetText(false); 4430if (this.StyleIs(XmlDocCommentStyle.Delimited) && TextWindow.PeekChar(1) == '/') 4433info.StringValue = info.Text = TextWindow.GetText(false); 4445TextWindow.AdvanceChar(); 4481switch (ch = TextWindow.PeekChar()) 4484if (TextWindow.PeekChar(1) == '-') 4486if (TextWindow.PeekChar(2) == '>') 4488TextWindow.AdvanceChar(3); 4494TextWindow.AdvanceChar(2); 4508if (!TextWindow.IsReallyAtEnd()) 4533var ch = TextWindow.PeekChar(); 4537if (TextWindow.PeekChar(1) == '-') 4539info.StringValue = info.Text = TextWindow.GetText(false); 4547info.StringValue = info.Text = TextWindow.GetText(false); 4551if (!TextWindow.IsReallyAtEnd()) 4556info.StringValue = info.Text = TextWindow.GetText(false); 4560if (this.StyleIs(XmlDocCommentStyle.Delimited) && TextWindow.PeekChar(1) == '/') 4563info.StringValue = info.Text = TextWindow.GetText(false); 4575TextWindow.AdvanceChar(); 4612switch (ch = TextWindow.PeekChar()) 4615if (TextWindow.PeekChar(1) == '>') 4617TextWindow.AdvanceChar(2); 4630if (!TextWindow.IsReallyAtEnd()) 4657var ch = TextWindow.PeekChar(); 4661if (TextWindow.PeekChar(1) == '>') 4663info.StringValue = info.Text = TextWindow.GetText(false); 4671info.StringValue = info.Text = TextWindow.GetText(false); 4675if (!TextWindow.IsReallyAtEnd()) 4680info.StringValue = info.Text = TextWindow.GetText(false); 4684if (this.StyleIs(XmlDocCommentStyle.Delimited) && TextWindow.PeekChar(1) == '/') 4687info.StringValue = info.Text = TextWindow.GetText(false); 4699TextWindow.AdvanceChar(); 4711var start = TextWindow.Position; 4720if (TextWindow.PeekChar() == '/' 4721&& TextWindow.PeekChar(1) == '*' 4722&& TextWindow.PeekChar(2) == '*' 4723&& TextWindow.PeekChar(3) != '*') 4725TextWindow.AdvanceChar(3); 4726var text = TextWindow.GetText(true); 4741char ch = TextWindow.PeekChar(); 4748TextWindow.AdvanceChar(); 4752if (this.StyleIs(XmlDocCommentStyle.SingleLine) && TextWindow.PeekChar(1) == '/' && TextWindow.PeekChar(2) == '/' && TextWindow.PeekChar(3) != '/') 4754TextWindow.AdvanceChar(3); 4755var text = TextWindow.GetText(true); 4766while (TextWindow.PeekChar() == '*' && TextWindow.PeekChar(1) != '/') 4768TextWindow.AdvanceChar(); 4771var text = TextWindow.GetText(true); 4781if (TextWindow.PeekChar() == '*' && TextWindow.PeekChar(1) == '/') 4783TextWindow.AdvanceChar(2); 4810TextWindow.Reset(start); 4817var text = TextWindow.GetText(true); 4829if (TextWindow.PeekChar() == '*' && TextWindow.PeekChar(1) == '/') 4831TextWindow.AdvanceChar(2); 4832var text = TextWindow.GetText(true); 4845char ch = TextWindow.PeekChar(); 4867char ch = TextWindow.PeekChar(); 4886if (this.StyleIs(XmlDocCommentStyle.Delimited) && TextWindow.PeekChar(1) == '/')
Parser\Lexer_RawStringLiteral.cs (45)
19var start = TextWindow.Position; 20while (TextWindow.PeekChar() == ch) 21TextWindow.AdvanceChar(); 23return TextWindow.Position - start; 45var ch = TextWindow.PeekChar(); 50TextWindow.AdvanceChar(); 55=> currentChar == SlidingTextWindow.InvalidCharacter && TextWindow.IsReallyAtEnd(); 68if (SyntaxFacts.IsNewLine(TextWindow.PeekChar())) 90var afterStartDelimiter = TextWindow.LexemeStartPosition + startingQuoteCount; 91var valueLength = TextWindow.Position - afterStartDelimiter; 93info.StringValue = TextWindow.GetText( 123info.Text = TextWindow.GetText(intern: true); 132var currentChar = TextWindow.PeekChar(); 137this.AddError(TextWindow.Position, width: TextWindow.GetNewLineWidth(), ErrorCode.ERR_UnterminatedRawString); 142this.AddError(TextWindow.Position, width: 0, ErrorCode.ERR_UnterminatedRawString); 149TextWindow.AdvanceChar(); 153var beforeEndDelimiter = TextWindow.Position; 166position: TextWindow.Position - excessQuoteCount, 172var afterStartDelimiter = TextWindow.LexemeStartPosition + startingQuoteCount; 175info.StringValue = TextWindow.GetText( 196var afterStartDelimiter = TextWindow.Position; 197Debug.Assert(SyntaxFacts.IsNewLine(TextWindow.PeekChar())); 211position: TextWindow.Position - startingQuoteCount, 222var tokenEnd = TextWindow.Position; 223TextWindow.Reset(afterStartDelimiter); 224Debug.Assert(SyntaxFacts.IsNewLine(TextWindow.PeekChar())); 238info.StringValue = this.HasErrors ? "" : TextWindow.Intern(_builder); 242TextWindow.Reset(tokenEnd); 254TextWindow.AdvancePastNewLine(); 269position: TextWindow.Position - excessQuoteCount, 282var currentChar = TextWindow.PeekChar(); 285this.AddError(TextWindow.Position, width: 0, ErrorCode.ERR_UnterminatedRawString); 299position: TextWindow.Position - currentQuoteCount, 307TextWindow.AdvanceChar(); 317Debug.Assert(SyntaxFacts.IsNewLine(TextWindow.PeekChar())); 319var newLineWidth = TextWindow.GetNewLineWidth(); 324_builder.Append(TextWindow.PeekChar()); 326TextWindow.AdvanceChar(); 329var lineStartPosition = TextWindow.Position; 341var isBlankLine = SyntaxFacts.IsNewLine(TextWindow.PeekChar()); 352width: TextWindow.Position - lineStartPosition, 360width: TextWindow.Position - lineStartPosition, 380var currentChar = TextWindow.PeekChar(); 386TextWindow.AdvanceChar();
Parser\Lexer_StringLiteral.cs (118)
16var quoteCharacter = TextWindow.PeekChar(); 19if (TextWindow.PeekChar() == '"' && 20TextWindow.PeekChar(1) == '"' && 21TextWindow.PeekChar(2) == '"') 35TextWindow.AdvanceChar(); 40char ch = TextWindow.PeekChar(); 54TextWindow.AdvanceChar(); 58(ch == SlidingTextWindow.InvalidCharacter && TextWindow.IsReallyAtEnd())) 63Debug.Assert(TextWindow.Width > 0); 69TextWindow.AdvanceChar(); 76info.Text = TextWindow.GetText(intern: true); 85info.StringValue = TextWindow.Intern(_builder); 105info.Text = TextWindow.GetText(intern: true); 109info.StringValue = TextWindow.Intern(_builder); 120if (TextWindow.PeekChar() is ('u' or 'U') && TextWindow.PeekChar(1) == '8') 122TextWindow.AdvanceChar(2); 131var start = TextWindow.Position; 133char ch = TextWindow.NextChar(); 136ch = TextWindow.NextChar(); 172TextWindow.Reset(start); 174ch = TextWindow.NextUnicodeEscape(surrogateCharacter: out surrogateCharacter, info: out error); 178this.AddError(start, TextWindow.Position - start, ErrorCode.ERR_IllegalEscape); 187Debug.Assert(TextWindow.PeekChar() == '@'); 190var start = TextWindow.Position; 191while (TextWindow.PeekChar() == '@') 193TextWindow.AdvanceChar(); 196if (TextWindow.Position - start >= 2) 198this.AddError(start, width: TextWindow.Position - start, ErrorCode.ERR_IllegalAtSequence); 201Debug.Assert(TextWindow.PeekChar() == '"'); 202TextWindow.AdvanceChar(); 206var ch = TextWindow.PeekChar(); 209TextWindow.AdvanceChar(); 210if (TextWindow.PeekChar() == '"') 213TextWindow.AdvanceChar(); 222if (ch == SlidingTextWindow.InvalidCharacter && TextWindow.IsReallyAtEnd()) 230TextWindow.AdvanceChar(); 243info.Text = TextWindow.GetText(intern: false); 286info.Text = TextWindow.GetText(intern: false); 354char ch = _lexer.TextWindow.PeekChar(); 357(ch == SlidingTextWindow.InvalidCharacter && _lexer.TextWindow.IsReallyAtEnd()); 374var start = _lexer.TextWindow.Position; 376Debug.Assert(_lexer.TextWindow.Position != start); 378openQuoteRange = start.._lexer.TextWindow.Position; 384closeQuoteRange = _lexer.TextWindow.Position.._lexer.TextWindow.Position; 407var window = _lexer.TextWindow; 503var closeQuotePosition = _lexer.TextWindow.Position; 517closeQuoteRange = closeQuotePosition.._lexer.TextWindow.Position; 524if (_lexer.TextWindow.PeekChar() != '"') 531IsAtEnd(allowNewline: true) ? _lexer.TextWindow.Position - 1 : _lexer.TextWindow.Position, 537_lexer.TextWindow.AdvanceChar(); // " 547if (_lexer.TextWindow.PeekChar() != '"') 554IsAtEnd(allowNewline: true) ? _lexer.TextWindow.Position - 1 : _lexer.TextWindow.Position, 572position: _lexer.TextWindow.Position - excessQuoteCount, 589_lexer.TextWindow.Position - 1, width: 1, ErrorCode.ERR_UnterminatedRawString)); 591else if (_lexer.TextWindow.PeekChar() == '"') 600position: _lexer.TextWindow.Position - closeQuoteCount, 606_lexer.TextWindow.AdvancePastNewLine(); 619position: _lexer.TextWindow.Position - excessQuoteCount, 651switch (_lexer.TextWindow.PeekChar()) 671var escapeStart = _lexer.TextWindow.Position; 675TrySetError(_lexer.MakeError(escapeStart, _lexer.TextWindow.Position - escapeStart, ErrorCode.ERR_EscapedCurly, ch)); 680_lexer.TextWindow.AdvanceChar(); 687_lexer.TextWindow.AdvanceChar(); 698var beforeQuotesPosition = _lexer.TextWindow.Position; 706_lexer.TextWindow.Position - closeQuoteCount, closeQuoteCount, ErrorCode.ERR_RawStringMustContainContent)); 707_lexer.TextWindow.Reset(beforeQuotesPosition); 721var startPosition = _lexer.TextWindow.Position; 722if (SyntaxFacts.IsNewLine(_lexer.TextWindow.PeekChar())) 724_lexer.TextWindow.AdvancePastNewLine(); 728_lexer.TextWindow.Reset(startPosition); 764if (_lexer.TextWindow.PeekChar(1) != '"') 770_lexer.TextWindow.AdvanceChar(2); // "" 776var beforeQuotePosition = _lexer.TextWindow.Position; 783_lexer.TextWindow.Reset(beforeQuotePosition); 796var pos = _lexer.TextWindow.Position; 797_lexer.TextWindow.AdvanceChar(); // } 800if (_lexer.TextWindow.PeekChar() == '}') 802_lexer.TextWindow.AdvanceChar(); // } 822position: _lexer.TextWindow.Position - closeBraceCount, 844if (_lexer.TextWindow.PeekChar(1) == '{') 846_lexer.TextWindow.AdvanceChar(2); // {{ 850int openBracePosition = _lexer.TextWindow.Position; 851_lexer.TextWindow.AdvanceChar(); 853int closeBracePosition = _lexer.TextWindow.Position; 854if (_lexer.TextWindow.PeekChar() == '}') 856_lexer.TextWindow.AdvanceChar(); 866new Range(closeBracePosition, _lexer.TextWindow.Position))); 879var beforeOpenBracesPosition = _lexer.TextWindow.Position; 887var afterOpenBracePosition = _lexer.TextWindow.Position; 901var beforeCloseBracePosition = _lexer.TextWindow.Position; 924_lexer.TextWindow.Reset(beforeCloseBracePosition + startingDollarSignCount); 930beforeCloseBracePosition.._lexer.TextWindow.Position)); 946Debug.Assert(_lexer.TextWindow.PeekChar() == ':'); 947_lexer.TextWindow.AdvanceChar(); 950char ch = _lexer.TextWindow.PeekChar(); 954var pos = _lexer.TextWindow.Position; 963if (kind is InterpolatedStringKind.Verbatim && _lexer.TextWindow.PeekChar(1) == '"') 965_lexer.TextWindow.AdvanceChar(2); // "" 975_lexer.TextWindow.Position, 1, ErrorCode.ERR_UnexpectedCharacter, ch)); 976_lexer.TextWindow.AdvanceChar(); 988_lexer.TextWindow.AdvanceChar(); 1001char ch = _lexer.TextWindow.PeekChar(); 1015TrySetError(_lexer.MakeError(_lexer.TextWindow.Position, 1, ErrorCode.ERR_SyntaxError, endingChar.ToString())); 1016_lexer.TextWindow.AdvanceChar(); 1033colonRange = new Range(_lexer.TextWindow.Position, _lexer.TextWindow.Position + 1); 1047TrySetError(_lexer.MakeError(_lexer.TextWindow.Position, 1, ErrorCode.ERR_SyntaxError, endingChar.ToString())); 1077switch (_lexer.TextWindow.PeekChar(1)) 1086_lexer.TextWindow.AdvanceChar(); 1103_lexer.TextWindow.AdvanceChar(); 1124Debug.Assert(start == _lexer.TextWindow.PeekChar()); 1125_lexer.TextWindow.AdvanceChar(); 1127if (_lexer.TextWindow.PeekChar() == end) 1129_lexer.TextWindow.AdvanceChar();
Parser\QuickScanner.cs (13)
199int i = TextWindow.Offset; 200int n = TextWindow.CharacterWindowCount; 206var charWindow = TextWindow.CharacterWindow; 234TextWindow.AdvanceChar(i - TextWindow.Offset); 241TextWindow.CharacterWindow, 242TextWindow.LexemeRelativeStart, 243i - TextWindow.LexemeRelativeStart, 250TextWindow.Reset(TextWindow.LexemeStartPosition); 260var quickWidth = TextWindow.Width; 262TextWindow.Reset(TextWindow.LexemeStartPosition);
Parser\SyntaxParser.cs (1)
125var size = Math.Min(4096, Math.Max(32, this.lexer.TextWindow.Text.Length / 2));