Skip to content

Commit 6bd803e

Browse files
author
James Brundage
committed
Updating Dot Syntax (Fixes #298)
1 parent 1d93d9b commit 6bd803e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Transpilers/Syntax/Dot.psx.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ process {
8484
$lastCommandAst = $targetCommandAst
8585
$commandSequence += $targetCommandAst
8686
$targetCommandAst.CommandElements
87+
# If the grandparent didn't have a list of statements, this is the only dot sequence in the chain.
88+
if (-not $CommandAst.Parent.Parent.Statements) { break }
8789
$nextStatementIndex = $commandAst.Parent.Parent.Statements.IndexOf($targetCommandAst.Parent) + 1
8890
$nextStatement = $CommandAst.Parent.Parent.Statements[$nextStatementIndex]
8991
if ($nextStatement -isnot [Management.Automation.Language.PipelineAst]) {

0 commit comments

Comments
 (0)