109 references to Context
Microsoft.CodeAnalysis.Razor.Compiler (109)
Language\Legacy\CSharpCodeParser.cs (69)
270if (Context == null) 304_tokenizer.Reset(Context.Source.Position - split.right.Content.Length); 358Context.ErrorSink.OnError(diagnostic); 412Context.ErrorSink.OnError( 418Context.ErrorSink.OnError( 424Context.ErrorSink.OnError( 468Context.ErrorSink.OnError( 488rightParen = OutputAsMetaCode(missingToken, Context.CurrentAcceptedCharacters); 610else if (At(SyntaxKind.Not) && Context.Options.AllowNullableForgivenessOperator) 725Context.ErrorSink.OnError( 751Context.CurrentAcceptedCharacters); 760Context.NullGenerateWhitespaceAndNewLine = true; 852Context.ErrorSink.OnError( 885Context.ErrorSink.OnError( 947Context.ErrorSink.OnError( 1001if ((!Context.Options.AllowRazorInAllCodeBlocks && At(SyntaxKind.LeftBrace)) || 1011else if (Context.Options.AllowRazorInAllCodeBlocks && At(SyntaxKind.LeftBrace)) 1072Context.ErrorSink.OnError( 1117if (!TryBalanceBlock(builder, parseNestedBlocksAsMarkup: Context.Options.AllowRazorInAllCodeBlocks)) 1162if (Context.InTemplateContext) 1164Context.ErrorSink.OnError( 1180Context.InTemplateContext = true; 1187Context.InTemplateContext = false; 1208if (Context.Options.LanguageVersion < RazorLanguageVersion.Version_12_0 && 1212Context.ErrorSink.OnError( 1229var @char = Context.SourceDocument.Text[index]; 1234Context.ErrorSink.OnError( 1246if (Context.SeenDirectives.Contains(SyntaxConstants.CSharp.TagHelperPrefixKeyword)) 1343using (Context.PushNewErrorScope(directiveErrorSink)) 1370Context.ErrorSink.OnError( 1392Context.ErrorSink.OnError( 1560using (Context.PushNewErrorScope(directiveErrorSink)) 1597Context.ErrorSink.OnError( 1650Context.ErrorSink.OnError( 1664Context.ErrorSink.OnError( 1676Context.ErrorSink.OnError( 1693Context.ErrorSink.OnError( 1708Context.ErrorSink.OnError( 1723Context.ErrorSink.OnError( 1741Context.ErrorSink.OnError( 1762Context.ErrorSink.OnError( 1792Context.ErrorSink.OnError( 1815Context.ErrorSink.OnError( 1855Context.ErrorSink.OnError( 1917if (Context.Options.AllowRazorInAllCodeBlocks) 1944builder.Add(OutputAsMetaCode(Output(), Context.CurrentAcceptedCharacters)); 1974if (Context.SeenDirectives.Contains(descriptor.Directive)) 1978Context.ErrorSink.OnError( 2049var source = Context.SourceDocument.Text; 2059Context.ErrorSink.OnError( 2062new SourceLocation(Context.SourceDocument.GetFilePathForDisplay(), absoluteIndex, position.Line, position.Character), 2072Context.ErrorSink.OnError( 2075new SourceLocation(Context.SourceDocument.GetFilePathForDisplay(), absoluteIndex, position.Line, position.Character), 2091var sourceDocument = Context.SourceDocument; 2093var end = HtmlMarkupParser.ParseXmlBody(sourceDocument, start, Context.Options, CancellationToken); 2187Context.ErrorSink.OnError( 2193Context.ErrorSink.OnError( 2223Context.ErrorSink.OnError( 2240builder.Add(OutputAsMetaCode(Output(), Context.CurrentAcceptedCharacters)); 2385Context.ErrorSink.OnError( 2393Context.ErrorSink.OnError( 2401Context.ErrorSink.OnError( 2661if (!Context.Options.AllowUsingVariableDeclarations) 2663Context.ErrorSink.OnError( 2815builder.Add(OutputAsMetaCode(Output(), Context.CurrentAcceptedCharacters)); 2908Context.ErrorSink.OnError( 2937if (!Context.WhiteSpaceIsSignificantToAncestorBlock && 3090Context.ErrorSink.OnError( 3195Context.ErrorSink.OnError(
Language\Legacy\HtmlMarkupParser.cs (26)
86if (Context == null) 144if (Context == null) 177Context.ErrorSink.OnError( 209if (Context == null) 354Context.ErrorSink.OnError( 456var old = Context.WhiteSpaceIsSignificantToAncestorBlock; 457Context.WhiteSpaceIsSignificantToAncestorBlock = true; 477Context.NullGenerateWhitespaceAndNewLine = false; 485Context.WhiteSpaceIsSignificantToAncestorBlock = old; 569Context.ErrorSink.OnError( 585Context.ErrorSink.OnError( 686Context.ErrorSink.OnError( 717Context.ErrorSink.OnError( 766Context.Source.Position = bookmark; 843Context.ErrorSink.OnError( 995Context.ErrorSink.OnError( 1229if (Context.Options.AllowCSharpInMarkupAttributeArea) 1261(token.Kind != SyntaxKind.Transition || !self.Context.Options.AllowCSharpInMarkupAttributeArea) && 1573Context.ErrorSink.OnError( 1656if (!Context.StartOfLine) 1728var startOfLine = Context.StartOfLine; 1779if (Context.NullGenerateWhitespaceAndNewLine) 1791Context.NullGenerateWhitespaceAndNewLine = false; 2145if (Context.Options.AllowConditionalDataDashAttributes) 2254Context.Source.Position = bookmark.AbsoluteIndex + preSequence.Content.Length; 2262Context.Source.Position = postSequenceBookmark;
Language\Legacy\ParserBase.cs (1)
12protected CancellationToken CancellationToken => Context.CancellationToken;
Language\Legacy\TokenizerBackedParser.cs (13)
53var languageTokenizer = Language.CreateTokenizer(Context.Source); 387Context.ErrorSink.OnError(diagnostic); 396Context.ErrorSink.OnError(diagnostic); 408Context.MakeMarkerNode = true; 528Context.StartOfLine = true; 532Context.StartOfLine = false; 537Context.ErrorSink.OnError(error); 610if (TokenBuilder.Count == 0 && Context.MakeMarkerNode) 657Context.CurrentAcceptedCharacters = accepted ?? AcceptedCharactersInternal.None; 664Context.MakeMarkerNode = Context.CurrentAcceptedCharacters != AcceptedCharactersInternal.Any; 671var editHandler = this.editHandlerBuilder.Build(Context.CurrentAcceptedCharacters); 722Context.CurrentAcceptedCharacters = acceptedCharacters ?? AcceptedCharactersInternal.None;