@@ -93,111 +93,111 @@ private void AddSourceMapping(SourceSpan original, SourceSpan generated)
93
93
94
94
public override void VisitRazorCommentBlock ( RazorCommentBlockSyntax node )
95
95
{
96
- using ( IsNotHtml ( ) )
96
+ using ( NonHtmlScope ( ) )
97
97
{
98
98
base . VisitRazorCommentBlock ( node ) ;
99
99
}
100
100
}
101
101
102
102
public override void VisitRazorMetaCode ( RazorMetaCodeSyntax node )
103
103
{
104
- using ( IsNotHtml ( ) )
104
+ using ( NonHtmlScope ( ) )
105
105
{
106
106
base . VisitRazorMetaCode ( node ) ;
107
107
}
108
108
}
109
109
110
110
public override void VisitMarkupTransition ( MarkupTransitionSyntax node )
111
111
{
112
- using ( IsNotHtml ( ) )
112
+ using ( NonHtmlScope ( ) )
113
113
{
114
114
base . VisitMarkupTransition ( node ) ;
115
115
}
116
116
}
117
117
118
118
public override void VisitCSharpTransition ( CSharpTransitionSyntax node )
119
119
{
120
- using ( IsNotHtml ( ) )
120
+ using ( NonHtmlScope ( ) )
121
121
{
122
122
base . VisitCSharpTransition ( node ) ;
123
123
}
124
124
}
125
125
126
126
public override void VisitCSharpEphemeralTextLiteral ( CSharpEphemeralTextLiteralSyntax node )
127
127
{
128
- using ( IsNotHtml ( ) )
128
+ using ( NonHtmlScope ( ) )
129
129
{
130
130
base . VisitCSharpEphemeralTextLiteral ( node ) ;
131
131
}
132
132
}
133
133
134
134
public override void VisitCSharpExpressionLiteral ( CSharpExpressionLiteralSyntax node )
135
135
{
136
- using ( IsNotHtml ( ) )
136
+ using ( NonHtmlScope ( ) )
137
137
{
138
138
base . VisitCSharpExpressionLiteral ( node ) ;
139
139
}
140
140
}
141
141
142
142
public override void VisitCSharpStatementLiteral ( CSharpStatementLiteralSyntax node )
143
143
{
144
- using ( IsNotHtml ( ) )
144
+ using ( NonHtmlScope ( ) )
145
145
{
146
146
base . VisitCSharpStatementLiteral ( node ) ;
147
147
}
148
148
}
149
149
150
150
public override void VisitMarkupStartTag ( MarkupStartTagSyntax node )
151
151
{
152
- using ( IsHtml ( ) )
152
+ using ( HtmlScope ( ) )
153
153
{
154
154
base . VisitMarkupStartTag ( node ) ;
155
155
}
156
156
}
157
157
158
158
public override void VisitMarkupEndTag ( MarkupEndTagSyntax node )
159
159
{
160
- using ( IsHtml ( ) )
160
+ using ( HtmlScope ( ) )
161
161
{
162
162
base . VisitMarkupEndTag ( node ) ;
163
163
}
164
164
}
165
165
166
166
public override void VisitMarkupTagHelperStartTag ( MarkupTagHelperStartTagSyntax node )
167
167
{
168
- using ( IsHtml ( ) )
168
+ using ( HtmlScope ( ) )
169
169
{
170
170
base . VisitMarkupTagHelperStartTag ( node ) ;
171
171
}
172
172
}
173
173
174
174
public override void VisitMarkupTagHelperEndTag ( MarkupTagHelperEndTagSyntax node )
175
175
{
176
- using ( IsHtml ( ) )
176
+ using ( HtmlScope ( ) )
177
177
{
178
178
base . VisitMarkupTagHelperEndTag ( node ) ;
179
179
}
180
180
}
181
181
182
182
public override void VisitMarkupEphemeralTextLiteral ( MarkupEphemeralTextLiteralSyntax node )
183
183
{
184
- using ( IsHtml ( ) )
184
+ using ( HtmlScope ( ) )
185
185
{
186
186
base . VisitMarkupEphemeralTextLiteral ( node ) ;
187
187
}
188
188
}
189
189
190
190
public override void VisitMarkupTextLiteral ( MarkupTextLiteralSyntax node )
191
191
{
192
- using ( IsHtml ( ) )
192
+ using ( HtmlScope ( ) )
193
193
{
194
194
base . VisitMarkupTextLiteral ( node ) ;
195
195
}
196
196
}
197
197
198
198
public override void VisitUnclassifiedTextLiteral ( UnclassifiedTextLiteralSyntax node )
199
199
{
200
- using ( IsHtml ( ) )
200
+ using ( HtmlScope ( ) )
201
201
{
202
202
base . VisitUnclassifiedTextLiteral ( node ) ;
203
203
}
@@ -215,12 +215,12 @@ public override void VisitToken(SyntaxToken token)
215
215
}
216
216
}
217
217
218
- private readonly ref struct WriterStateSaver
218
+ private readonly ref struct WriterScope
219
219
{
220
220
private readonly RazorHtmlWriter _writer ;
221
221
private readonly bool _oldIsWritingHtml ;
222
222
223
- public WriterStateSaver ( RazorHtmlWriter writer , bool isWritingHtml )
223
+ public WriterScope ( RazorHtmlWriter writer , bool isWritingHtml )
224
224
{
225
225
_writer = writer ;
226
226
_oldIsWritingHtml = writer . _isWritingHtml ;
@@ -233,11 +233,11 @@ public void Dispose()
233
233
}
234
234
}
235
235
236
- private WriterStateSaver IsHtml ( )
237
- => new ( this , isWritingHtml : true ) ;
238
-
239
- private WriterStateSaver IsNotHtml ( )
236
+ private WriterScope NonHtmlScope ( )
240
237
=> new ( this , isWritingHtml : false ) ;
238
+
239
+ private WriterScope HtmlScope ( )
240
+ => new ( this , isWritingHtml : true ) ;
241
241
private void WriteHtmlToken ( SyntaxToken token )
242
242
{
243
243
var content = token . Content ;
0 commit comments