Skip to content

Commit 26a75da

Browse files
committed
PS: Don't generate a 'Pipeline' element when the pipeline wraps a single element.
1 parent 8fd8982 commit 26a75da

File tree

66 files changed

+97
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+97
-68
lines changed

powershell/extractor/Semmle.Extraction.PowerShell/Entities/ArrayExpressionEntity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public override void Populate(TextWriter trapFile)
1919
var subExpression = EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.SubExpression);
2020
trapFile.array_expression(this, subExpression);
2121
trapFile.array_expression_location(this, TrapSuitableLocation);
22-
trapFile.parent(this, EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.Parent));
22+
trapFile.parent(PowerShellContext, this, Fragment.Parent);
2323
}
2424

2525
public override bool NeedsPopulation => true;

powershell/extractor/Semmle.Extraction.PowerShell/Entities/ArrayLiteralEntity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public override void Populate(TextWriter trapFile)
2323
var entity = EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.Elements[index]);
2424
trapFile.array_literal_element(this, index, entity);
2525
}
26-
trapFile.parent(this, EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.Parent));
26+
trapFile.parent(PowerShellContext, this, Fragment.Parent);
2727
}
2828

2929
public override bool NeedsPopulation => true;

powershell/extractor/Semmle.Extraction.PowerShell/Entities/AssignmentStatementEntity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public override void Populate(TextWriter trapFile)
1919
var right = EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.Right);
2020
trapFile.assignment_statement(this, Fragment.Operator, left, right);
2121
trapFile.assignment_statement_location(this, TrapSuitableLocation);
22-
trapFile.parent(this, EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.Parent));
22+
trapFile.parent(PowerShellContext, this, Fragment.Parent);
2323
}
2424

2525
public override bool NeedsPopulation => true;

powershell/extractor/Semmle.Extraction.PowerShell/Entities/AttributeEntity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public override void Populate(TextWriter trapFile)
2828
trapFile.attribute_positional_argument(this, i,
2929
EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.PositionalArguments[i]));
3030
}
31-
trapFile.parent(this, EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.Parent));
31+
trapFile.parent(PowerShellContext, this, Fragment.Parent);
3232
}
3333

3434
public override bool NeedsPopulation => true;

powershell/extractor/Semmle.Extraction.PowerShell/Entities/AttributedExpression.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public override void Populate(TextWriter trapFile)
1717
trapFile.attributed_expression(this, EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.Attribute),
1818
EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.Child));
1919
trapFile.attributed_expression_location(this, TrapSuitableLocation);
20-
trapFile.parent(this, EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.Parent));
20+
trapFile.parent(PowerShellContext, this, Fragment.Parent);
2121
}
2222

2323
public override bool NeedsPopulation => true;

powershell/extractor/Semmle.Extraction.PowerShell/Entities/BinaryExpressionEntity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public override void Populate(TextWriter trapFile)
1818
var right = EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.Right);
1919
trapFile.binary_expression(this, Fragment.Operator, left, right);
2020
trapFile.binary_expression_location(this, TrapSuitableLocation);
21-
trapFile.parent(this, EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.Parent));
21+
trapFile.parent(PowerShellContext, this, Fragment.Parent);
2222
}
2323

2424
public override bool NeedsPopulation => true;

powershell/extractor/Semmle.Extraction.PowerShell/Entities/BlockStatementEntity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public override void Populate(TextWriter trapFile)
1616
{
1717
trapFile.block_statement(this, EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.Body), TokenEntity.Create(PowerShellContext, Fragment.Kind));
1818
trapFile.block_statement_location(this, TrapSuitableLocation);
19-
trapFile.parent(this, EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.Parent));
19+
trapFile.parent(PowerShellContext, this, Fragment.Parent);
2020
}
2121

2222
public override bool NeedsPopulation => true;

powershell/extractor/Semmle.Extraction.PowerShell/Entities/BreakStatementEntity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public override void Populate(TextWriter trapFile)
2222
}
2323

2424
trapFile.break_statement_location(this, TrapSuitableLocation);
25-
trapFile.parent(this, EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.Parent));
25+
trapFile.parent(PowerShellContext, this, Fragment.Parent);
2626
}
2727

2828
public override bool NeedsPopulation => true;

powershell/extractor/Semmle.Extraction.PowerShell/Entities/CatchClauseEntity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public override void Populate(TextWriter trapFile)
2121
trapFile.catch_clause_catch_type(this, index, EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.CatchTypes[index]));
2222
}
2323
trapFile.catch_clause_location(this, TrapSuitableLocation);
24-
trapFile.parent(this, EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.Parent));
24+
trapFile.parent(PowerShellContext, this, Fragment.Parent);
2525
}
2626

2727
public override bool NeedsPopulation => true;

powershell/extractor/Semmle.Extraction.PowerShell/Entities/CommandEntity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public override void Populate(TextWriter trapFile)
3131
var entity = EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.Redirections[index]);
3232
trapFile.command_redirection(this, index, entity);
3333
}
34-
trapFile.parent(this, EntityConstructor.ConstructAppropriateEntity(PowerShellContext, Fragment.Parent));
34+
trapFile.parent(PowerShellContext, this, Fragment.Parent);
3535
}
3636

3737
public override bool NeedsPopulation => true;

0 commit comments

Comments
 (0)