@@ -14,19 +14,16 @@ internal class IterativeVariableRename
14
14
{
15
15
private readonly string OldName ;
16
16
private readonly string NewName ;
17
- internal Stack < Ast > ScopeStack = new ( ) ;
18
17
internal bool ShouldRename ;
19
18
public List < TextChange > Modifications = new ( ) ;
20
19
internal int StartLineNumber ;
21
20
internal int StartColumnNumber ;
22
21
internal VariableExpressionAst TargetVariableAst ;
23
- internal VariableExpressionAst DuplicateVariableAst ;
24
22
internal List < string > dotSourcedScripts = new ( ) ;
25
23
internal readonly Ast ScriptAst ;
26
24
internal bool isParam ;
27
25
internal bool AliasSet ;
28
26
internal FunctionDefinitionAst TargetFunction ;
29
- internal List < string > Log = new ( ) ;
30
27
31
28
public IterativeVariableRename ( string NewName , int StartLineNumber , int StartColumnNumber , Ast ScriptAst )
32
29
{
@@ -255,9 +252,6 @@ public void Visit(Ast root)
255
252
256
253
public void ProcessNode ( Ast node )
257
254
{
258
- Log . Add ( $ "Proc node: { node . GetType ( ) . Name } , " +
259
- $ "SL: { node . Extent . StartLineNumber } , " +
260
- $ "SC: { node . Extent . StartColumnNumber } ") ;
261
255
262
256
switch ( node )
263
257
{
@@ -343,7 +337,6 @@ public void ProcessNode(Ast node)
343
337
{
344
338
if ( ! WithinTargetsScope ( TargetVariableAst , variableExpressionAst ) )
345
339
{
346
- DuplicateVariableAst = variableExpressionAst ;
347
340
ShouldRename = false ;
348
341
}
349
342
@@ -377,15 +370,14 @@ public void ProcessNode(Ast node)
377
370
}
378
371
break ;
379
372
}
380
- Log . Add ( $ "ShouldRename after proc: { ShouldRename } ") ;
381
373
}
382
374
383
375
internal void NewSplattedModification ( Ast Splatted )
384
376
{
385
- // This Function should be passed a Splatted VariableExpressionAst which
377
+ // This Function should be passed a splatted VariableExpressionAst which
386
378
// is used by a CommandAst that is the TargetFunction.
387
379
388
- // Find the Splats Top Assignment / Definition
380
+ // Find the splats top assignment / definition
389
381
Ast SplatAssignment = GetVariableTopAssignment (
390
382
Splatted . Extent . StartLineNumber ,
391
383
Splatted . Extent . StartColumnNumber ,
@@ -421,8 +413,8 @@ internal TextChange NewParameterAliasChange(VariableExpressionAst variableExpres
421
413
{
422
414
// Check if an Alias AttributeAst already exists and append the new Alias to the existing list
423
415
// 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
426
418
TextChange aliasChange = new ( ) ;
427
419
foreach ( Ast Attr in paramAst . Attributes )
428
420
{
0 commit comments