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