@@ -126,14 +126,14 @@ public async Task ExecuteAsync(IModContext ctx, CancellationToken ct = default)
126126
127127 // Trim and prettify the trimmable names
128128
129- // Define trimmers
130- var trimmers = new INameTrimmer [ ]
129+ // Define name processors
130+ var nameProcessors = new INameProcessor [ ]
131131 {
132- new NameAffixerEarlyTrimmer ( nameAffixer ) ,
132+ new NameAffixerEarlyNameProcessor ( nameAffixer ) ,
133133 new NameTrimmer ( ) ,
134- new PrettifyNamesTrimmer ( namePrettifier ) ,
135- new NameAffixerLateTrimmer ( nameAffixer ) ,
136- new PrefixIfStartsWithNumberTrimmer ( ) ,
134+ new PrettifyNameProcessor ( namePrettifier ) ,
135+ new NameAffixerLateNameProcessor ( nameAffixer ) ,
136+ new PrefixIfStartsWithNumberNameProcessor ( ) ,
137137 } ;
138138
139139 // Create a type name dictionary to trim the type names.
@@ -146,16 +146,16 @@ public async Task ExecuteAsync(IModContext ctx, CancellationToken ct = default)
146146 // trim.
147147 if ( typeNames . Count > 1 || cfg . GlobalPrefixHints is not null )
148148 {
149- Trim (
150- new NameTrimmerContext
149+ ProcessNames (
150+ new NameProcessorContext
151151 {
152152 Container = null ,
153153 Names = typeNames ,
154154 Configuration = cfg ,
155155 JobKey = ctx . JobKey ,
156156 NonDeterminant = visitor . NonDeterminant ,
157157 } ,
158- trimmers
158+ nameProcessors
159159 ) ;
160160 }
161161
@@ -169,16 +169,16 @@ public async Task ExecuteAsync(IModContext ctx, CancellationToken ct = default)
169169 var constNames = consts . ToDictionary ( x => x , x => new CandidateNames ( x , [ ] ) ) ;
170170
171171 // Trim the constants.
172- Trim (
173- new NameTrimmerContext
172+ ProcessNames (
173+ new NameProcessorContext
174174 {
175175 Container = typeName ,
176176 Names = constNames ,
177177 Configuration = cfg ,
178178 JobKey = ctx . JobKey ,
179179 NonDeterminant = visitor . NonDeterminant ,
180180 } ,
181- trimmers
181+ nameProcessors
182182 ) ;
183183
184184 // Rename the functions. More often that not functions have different nomenclature to constants, so we
@@ -194,16 +194,16 @@ public async Task ExecuteAsync(IModContext ctx, CancellationToken ct = default)
194194 ) ;
195195
196196 // Trim the functions.
197- Trim (
198- new NameTrimmerContext
197+ ProcessNames (
198+ new NameProcessorContext
199199 {
200200 Container = typeName ,
201201 Names = functionNames ,
202202 Configuration = cfg ,
203203 JobKey = ctx . JobKey ,
204204 NonDeterminant = visitor . NonDeterminant ,
205205 } ,
206- trimmers ,
206+ nameProcessors ,
207207 functionSyntax
208208 ) ;
209209
@@ -461,15 +461,15 @@ NamePrettifier namePrettifier
461461 return result ;
462462 }
463463
464- private void Trim (
465- NameTrimmerContext context ,
466- IEnumerable < INameTrimmer > trimmers ,
464+ private void ProcessNames (
465+ NameProcessorContext context ,
466+ IEnumerable < INameProcessor > nameProcessors ,
467467 Dictionary < string , IEnumerable < MethodDeclarationSyntax > > ? functionSyntax = null
468468 )
469469 {
470470 // Ensure the trimmers don't see names that have been manually overridden, as we don't want them to influence
471471 // automatic prefix determination for example
472- var namesToTrim = context . Names ;
472+ var namesToProcess = context . Names ;
473473 foreach ( var ( nativeName , overriddenName ) in context . Configuration . NameOverrides )
474474 {
475475 var nameToAdd = nativeName ;
@@ -497,21 +497,21 @@ private void Trim(
497497 }
498498 }
499499
500- if ( ! namesToTrim . TryGetValue ( nameToAdd , out var v ) )
500+ if ( ! namesToProcess . TryGetValue ( nameToAdd , out var v ) )
501501 {
502502 continue ;
503503 }
504504
505505 // If we haven't created the differentiated dictionary yet, then do so now. We do want to keep the original
506506 // dictionary so we can actually apply the renames; if we have created two different branching dictionaries
507- // they are recombined following trimming .
508- if ( namesToTrim == context . Names )
507+ // they are recombined following name processing .
508+ if ( namesToProcess == context . Names )
509509 {
510- namesToTrim = namesToTrim . ToDictionary ( ) ;
510+ namesToProcess = namesToProcess . ToDictionary ( ) ;
511511 }
512512
513- // Don't let the trimmers see the overridden native name.
514- namesToTrim . Remove ( nameToAdd ) ;
513+ // Don't let the name processors see the overridden native name.
514+ namesToProcess . Remove ( nameToAdd ) ;
515515
516516 // Apply the name override to the dictionary we actually use.
517517 context . Names [ nameToAdd ] = new CandidateNames (
@@ -520,16 +520,16 @@ private void Trim(
520520 ) ;
521521 }
522522
523- // Run each trimmer
524- foreach ( var trimmer in trimmers )
523+ // Run each name processor
524+ foreach ( var nameProcessor in nameProcessors )
525525 {
526- trimmer . Trim ( context with { Names = namesToTrim } ) ;
526+ nameProcessor . ProcessNames ( context with { Names = namesToProcess } ) ;
527527 }
528528
529529 // Apply changes
530- if ( namesToTrim != context . Names )
530+ if ( namesToProcess != context . Names )
531531 {
532- foreach ( var ( evalName , result ) in namesToTrim )
532+ foreach ( var ( evalName , result ) in namesToProcess )
533533 {
534534 context . Names [ evalName ] = result ;
535535 }
@@ -1201,7 +1201,7 @@ Dictionary<string, NameAffixConfiguration> config
12011201 /// Removes affixes from the specified primary name and adds the original specified primary to the secondary list if provided.
12021202 /// </summary>
12031203 /// <remarks>
1204- /// Designed to be used by either <see cref="ApplyPrettifyOnlyPipeline"/> or <see cref="NameAffixerEarlyTrimmer "/>.
1204+ /// Designed to be used by either <see cref="ApplyPrettifyOnlyPipeline"/> or <see cref="NameAffixerEarlyNameProcessor "/>.
12051205 /// </remarks>
12061206 /// <param name="primary">The current primary name.</param>
12071207 /// <param name="container">The container name. Either null or the containing type.</param>
@@ -1234,7 +1234,7 @@ public string RemoveAffixes(
12341234 /// Applies affixes to the specified primary name and adds fallbacks to the secondary list if provided.
12351235 /// </summary>
12361236 /// <remarks>
1237- /// Designed to be used by either <see cref="ApplyPrettifyOnlyPipeline"/> or <see cref="NameAffixerLateTrimmer "/>.
1237+ /// Designed to be used by either <see cref="ApplyPrettifyOnlyPipeline"/> or <see cref="NameAffixerLateNameProcessor "/>.
12381238 /// </remarks>
12391239 /// <param name="primary">The current primary name.</param>
12401240 /// <param name="container">The container name. Either null or the containing type.</param>
@@ -1397,12 +1397,12 @@ private NameAffixConfiguration GetConfiguration(string category) =>
13971397 }
13981398
13991399 /// <summary>
1400- /// Removes identified affixes so that other trimmers can process the base name separately.
1401- /// These affixes should be reapplied by <see cref="NameAffixerLateTrimmer "/>.
1400+ /// Removes identified affixes so that other name processors can process the base name separately.
1401+ /// These affixes should be reapplied by <see cref="NameAffixerLateNameProcessor "/>.
14021402 /// </summary>
1403- private class NameAffixerEarlyTrimmer ( PrettifyNamesAffixer affixer ) : INameTrimmer
1403+ private class NameAffixerEarlyNameProcessor ( PrettifyNamesAffixer affixer ) : INameProcessor
14041404 {
1405- public void Trim ( NameTrimmerContext context )
1405+ public void ProcessNames ( NameProcessorContext context )
14061406 {
14071407 if ( context . Container == null )
14081408 {
@@ -1430,9 +1430,9 @@ public void Trim(NameTrimmerContext context)
14301430 }
14311431 }
14321432
1433- private class PrettifyNamesTrimmer ( NamePrettifier namePrettifier ) : INameTrimmer
1433+ private class PrettifyNameProcessor ( NamePrettifier namePrettifier ) : INameProcessor
14341434 {
1435- public void Trim ( NameTrimmerContext context )
1435+ public void ProcessNames ( NameProcessorContext context )
14361436 {
14371437 foreach ( var ( original , ( primary , secondary ) ) in context . Names )
14381438 {
@@ -1455,9 +1455,9 @@ public void Trim(NameTrimmerContext context)
14551455 /// <summary>
14561456 /// Reapplies and transforms identified affixes based on <see cref="NameAffixConfiguration"/>.
14571457 /// </summary>
1458- private class NameAffixerLateTrimmer ( PrettifyNamesAffixer affixer ) : INameTrimmer
1458+ private class NameAffixerLateNameProcessor ( PrettifyNamesAffixer affixer ) : INameProcessor
14591459 {
1460- public void Trim ( NameTrimmerContext context )
1460+ public void ProcessNames ( NameProcessorContext context )
14611461 {
14621462 if ( context . Container == null )
14631463 {
@@ -1485,9 +1485,9 @@ public void Trim(NameTrimmerContext context)
14851485 }
14861486 }
14871487
1488- private class PrefixIfStartsWithNumberTrimmer : INameTrimmer
1488+ private class PrefixIfStartsWithNumberNameProcessor : INameProcessor
14891489 {
1490- public void Trim ( NameTrimmerContext context )
1490+ public void ProcessNames ( NameProcessorContext context )
14911491 {
14921492 foreach ( var ( original , ( primary , secondary ) ) in context . Names )
14931493 {
0 commit comments