22using Markdig . Syntax ;
33using Markdig . Syntax . Inlines ;
44using NativeCodeGen . Core . Models ;
5+ using NativeCodeGen . Core . Utilities ;
56
67namespace NativeCodeGen . Core . Parsing ;
78
@@ -70,12 +71,12 @@ public ParseResult<NativeDefinition> Parse(string content, string filePath)
7071 else if ( AllowedSections . Contains ( headingText ) )
7172 {
7273 currentSection = headingText ;
73- if ( headingText . Equals ( "Parameters" , StringComparison . OrdinalIgnoreCase ) )
74+ if ( headingText . EqualsIgnoreCase ( "Parameters" ) )
7475 foundParameters = true ;
75- else if ( headingText . Equals ( "Return value" , StringComparison . OrdinalIgnoreCase ) )
76+ else if ( headingText . EqualsIgnoreCase ( "Return value" ) )
7677 foundReturnValue = true ;
7778 }
78- else if ( ! headingText . Equals ( native . Name , StringComparison . OrdinalIgnoreCase ) )
79+ else if ( ! headingText . EqualsIgnoreCase ( native . Name ) )
7980 {
8081 // Unknown section
8182 result . Errors . Add ( new ParseError
@@ -97,7 +98,7 @@ public ParseResult<NativeDefinition> Parse(string content, string filePath)
9798 if ( hashLine . StartsWith ( "//" ) )
9899 {
99100 var hashPart = hashLine [ 2 ..] . Trim ( ) ;
100- if ( hashPart . StartsWith ( "0x" , StringComparison . OrdinalIgnoreCase ) )
101+ if ( hashPart . StartsWithIgnoreCase ( "0x" ) )
101102 {
102103 native . Hash = hashPart ;
103104 }
@@ -136,7 +137,7 @@ public ParseResult<NativeDefinition> Parse(string content, string filePath)
136137 native . Parameters = parameters ;
137138
138139 // Verify name matches heading
139- if ( ! name . Equals ( native . Name , StringComparison . OrdinalIgnoreCase ) )
140+ if ( ! name . EqualsIgnoreCase ( native . Name ) )
140141 {
141142 result . Warnings . Add ( new ParseWarning
142143 {
@@ -193,18 +194,18 @@ public ParseResult<NativeDefinition> Parse(string content, string filePath)
193194 }
194195 break ;
195196
196- case ListBlock listBlock when currentSection ? . Equals ( "Parameters" , StringComparison . OrdinalIgnoreCase ) == true :
197+ case ListBlock listBlock when currentSection ? . EqualsIgnoreCase ( "Parameters" ) == true :
197198 ParseParameterList ( listBlock , native , parameterDescriptions , out var documentedParamOrder , filePath , frontmatterEndLine ) ;
198199
199200 // Validate parameter count, names, and order
200201 ValidateParameters ( native . Parameters , documentedParamOrder , result , filePath , frontmatterEndLine + listBlock . Line ) ;
201202 break ;
202203
203- case ParagraphBlock returnParagraph when currentSection ? . Equals ( "Return value" , StringComparison . OrdinalIgnoreCase ) == true :
204+ case ParagraphBlock returnParagraph when currentSection ? . EqualsIgnoreCase ( "Return value" ) == true :
204205 native . ReturnDescription = GetParagraphText ( returnParagraph ) ;
205206 break ;
206207
207- case FencedCodeBlock exampleBlock when currentSection ? . Equals ( "Examples" , StringComparison . OrdinalIgnoreCase ) == true :
208+ case FencedCodeBlock exampleBlock when currentSection ? . EqualsIgnoreCase ( "Examples" ) == true :
208209 var exampleCode = exampleBlock . Lines . ToString ( ) . Trim ( ) ;
209210 if ( ! string . IsNullOrWhiteSpace ( exampleCode ) )
210211 {
0 commit comments