@@ -14,19 +14,16 @@ internal class IterativeVariableRename
1414 {
1515 private readonly string OldName ;
1616 private readonly string NewName ;
17- internal Stack < Ast > ScopeStack = new ( ) ;
1817 internal bool ShouldRename ;
1918 public List < TextChange > Modifications = new ( ) ;
2019 internal int StartLineNumber ;
2120 internal int StartColumnNumber ;
2221 internal VariableExpressionAst TargetVariableAst ;
23- internal VariableExpressionAst DuplicateVariableAst ;
2422 internal List < string > dotSourcedScripts = new ( ) ;
2523 internal readonly Ast ScriptAst ;
2624 internal bool isParam ;
2725 internal bool AliasSet ;
2826 internal FunctionDefinitionAst TargetFunction ;
29- internal List < string > Log = new ( ) ;
3027
3128 public IterativeVariableRename ( string NewName , int StartLineNumber , int StartColumnNumber , Ast ScriptAst )
3229 {
@@ -255,9 +252,6 @@ public void Visit(Ast root)
255252
256253 public void ProcessNode ( Ast node )
257254 {
258- Log . Add ( $ "Proc node: { node . GetType ( ) . Name } , " +
259- $ "SL: { node . Extent . StartLineNumber } , " +
260- $ "SC: { node . Extent . StartColumnNumber } ") ;
261255
262256 switch ( node )
263257 {
@@ -343,7 +337,6 @@ public void ProcessNode(Ast node)
343337 {
344338 if ( ! WithinTargetsScope ( TargetVariableAst , variableExpressionAst ) )
345339 {
346- DuplicateVariableAst = variableExpressionAst ;
347340 ShouldRename = false ;
348341 }
349342
@@ -377,15 +370,14 @@ public void ProcessNode(Ast node)
377370 }
378371 break ;
379372 }
380- Log . Add ( $ "ShouldRename after proc: { ShouldRename } ") ;
381373 }
382374
383375 internal void NewSplattedModification ( Ast Splatted )
384376 {
385- // This Function should be passed a Splatted VariableExpressionAst which
377+ // This Function should be passed a splatted VariableExpressionAst which
386378 // is used by a CommandAst that is the TargetFunction.
387379
388- // Find the Splats Top Assignment / Definition
380+ // Find the splats top assignment / definition
389381 Ast SplatAssignment = GetVariableTopAssignment (
390382 Splatted . Extent . StartLineNumber ,
391383 Splatted . Extent . StartColumnNumber ,
@@ -421,8 +413,8 @@ internal TextChange NewParameterAliasChange(VariableExpressionAst variableExpres
421413 {
422414 // Check if an Alias AttributeAst already exists and append the new Alias to the existing list
423415 // Otherwise Create a new Alias Attribute
424- // Add the modidifcations to the changes
425- // the Attribute will be appended before the variable or in the existing location of the Original Alias
416+ // Add the modifications to the changes
417+ // The Attribute will be appended before the variable or in the existing location of the original alias
426418 TextChange aliasChange = new ( ) ;
427419 foreach ( Ast Attr in paramAst . Attributes )
428420 {
0 commit comments