Skip to content

Commit 65595d6

Browse files
committed
Only set location end when it is larger
1 parent 122c80a commit 65595d6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/prism.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2075,7 +2075,10 @@ pm_arguments_node_arguments_append(pm_arguments_node_t *node, pm_node_t *argumen
20752075
node->base.location.start = argument->location.start;
20762076
}
20772077

2078-
node->base.location.end = argument->location.end;
2078+
if (node->base.location.end < argument->location.end) {
2079+
node->base.location.end = argument->location.end;
2080+
}
2081+
20792082
pm_node_list_append(&node->arguments, argument);
20802083

20812084
if (PM_NODE_TYPE_P(argument, PM_SPLAT_NODE)) {

0 commit comments

Comments
 (0)