106 references to Context
Microsoft.AspNetCore.Razor.Language.UnitTests (2)
Legacy\HtmlMarkupParserTests.cs (1)
207Context.Dispose();
Legacy\TokenizerLookaheadTest.cs (1)
214Context.Dispose();
Microsoft.CodeAnalysis.Razor.Compiler (104)
Language\Legacy\CSharpCodeParser.cs (63)
268if (Context == null) 302_tokenizer.Reset(Context.Source.Position - split.right.Content.Length); 356Context.ErrorSink.OnError(diagnostic); 410Context.ErrorSink.OnError( 416Context.ErrorSink.OnError( 422Context.ErrorSink.OnError( 466Context.ErrorSink.OnError( 486rightParen = OutputAsMetaCode(missingToken, Context.CurrentAcceptedCharacters); 608else if (At(SyntaxKind.Not) && Context.Options.AllowNullableForgivenessOperator) 723Context.ErrorSink.OnError( 749Context.CurrentAcceptedCharacters); 758Context.NullGenerateWhitespaceAndNewLine = true; 818if (Context.DesignTimeMode || !isMarkup) 850Context.ErrorSink.OnError( 857if (Context.DesignTimeMode && CurrentToken != null && 888Context.ErrorSink.OnError( 950Context.ErrorSink.OnError( 1004if ((!Context.Options.AllowRazorInAllCodeBlocks && At(SyntaxKind.LeftBrace)) || 1014else if (Context.Options.AllowRazorInAllCodeBlocks && At(SyntaxKind.LeftBrace)) 1075Context.ErrorSink.OnError( 1149if (Context.InTemplateContext) 1151Context.ErrorSink.OnError( 1167Context.InTemplateContext = true; 1174Context.InTemplateContext = false; 1207var @char = Context.SourceDocument.Text[index]; 1212Context.ErrorSink.OnError( 1224if (Context.SeenDirectives.Contains(SyntaxConstants.CSharp.TagHelperPrefixKeyword)) 1321using (Context.PushNewErrorScope(directiveErrorSink)) 1348Context.ErrorSink.OnError( 1370Context.ErrorSink.OnError( 1538using (Context.PushNewErrorScope(directiveErrorSink)) 1575Context.ErrorSink.OnError( 1628Context.ErrorSink.OnError( 1642Context.ErrorSink.OnError( 1654Context.ErrorSink.OnError( 1671Context.ErrorSink.OnError( 1686Context.ErrorSink.OnError( 1701Context.ErrorSink.OnError( 1719Context.ErrorSink.OnError( 1740Context.ErrorSink.OnError( 1770Context.ErrorSink.OnError( 1793Context.ErrorSink.OnError( 1833Context.ErrorSink.OnError( 1889if (Context.Options.AllowRazorInAllCodeBlocks) 1916builder.Add(OutputAsMetaCode(Output(), Context.CurrentAcceptedCharacters)); 1944if (Context.SeenDirectives.Contains(descriptor.Directive)) 1948Context.ErrorSink.OnError( 2021Context.ErrorSink.OnError( 2027Context.ErrorSink.OnError( 2057Context.ErrorSink.OnError( 2074builder.Add(OutputAsMetaCode(Output(), Context.CurrentAcceptedCharacters)); 2219Context.ErrorSink.OnError( 2227Context.ErrorSink.OnError( 2235Context.ErrorSink.OnError( 2495if (!Context.Options.AllowUsingVariableDeclarations) 2497Context.ErrorSink.OnError( 2648if (!Context.DesignTimeMode) 2651builder.Add(OutputAsMetaCode(Output(), Context.CurrentAcceptedCharacters)); 2745Context.ErrorSink.OnError( 2774if (!Context.WhiteSpaceIsSignificantToAncestorBlock && 2775!Context.DesignTimeMode && 2928Context.ErrorSink.OnError( 3005Context.ErrorSink.OnError(
Language\Legacy\HtmlMarkupParser.cs (27)
67if (Context == null) 125if (Context == null) 158Context.ErrorSink.OnError( 190if (Context == null) 336Context.ErrorSink.OnError( 346if (!Context.DesignTimeMode) 444var old = Context.WhiteSpaceIsSignificantToAncestorBlock; 445Context.WhiteSpaceIsSignificantToAncestorBlock = true; 465Context.NullGenerateWhitespaceAndNewLine = false; 473Context.WhiteSpaceIsSignificantToAncestorBlock = old; 557Context.ErrorSink.OnError( 573Context.ErrorSink.OnError( 693Context.ErrorSink.OnError( 742Context.Source.Position = bookmark; 819Context.ErrorSink.OnError( 974Context.ErrorSink.OnError( 1202if (Context.Options.AllowCSharpInMarkupAttributeArea) 1239(token.Kind != SyntaxKind.Transition || !self.Context.Options.AllowCSharpInMarkupAttributeArea) && 1551Context.ErrorSink.OnError( 1634if (Context.DesignTimeMode || !Context.StartOfLine) 1706var startOfLine = Context.StartOfLine; 1757if (Context.NullGenerateWhitespaceAndNewLine) 1769Context.NullGenerateWhitespaceAndNewLine = false; 2103if (Context.Options.AllowConditionalDataDashAttributes) 2207Context.Source.Position = bookmark.AbsoluteIndex + preSequence.Content.Length; 2215Context.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;