Skip to content

Commit

Permalink
fix: append null if ValueHeadComments is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Dec 4, 2024
1 parent 6eac5f1 commit e6ff4c9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,10 @@ func (n *SequenceNode) Merge(target *SequenceNode) {
column := n.Start.Position.Column - target.Start.Position.Column
target.AddColumn(column)
n.Values = append(n.Values, target.Values...)
if len(target.ValueHeadComments) == 0 {
n.ValueHeadComments = append(n.ValueHeadComments, make([]*CommentGroupNode, len(target.Values))...)
return
}
n.ValueHeadComments = append(n.ValueHeadComments, target.ValueHeadComments...)
}

Expand Down

0 comments on commit e6ff4c9

Please sign in to comment.