Skip to content

Commit

Permalink
fix(filtering): always increment next id when applying macros
Browse files Browse the repository at this point in the history
Next ID was never updated when a macro replaced a subexpression, leading
to duplicate IDs down the line.
  • Loading branch information
ericwenn committed Apr 20, 2021
1 parent 9f2063d commit f87ff80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion filtering/macro.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ func applyMacros(exp *expr.Expr, sourceInfo *expr.SourceInfo, macros ...Macro) {
}
for _, macro := range macros {
macro(cursor)
nextID = cursor.nextID
if cursor.replaced {
// Don't traverse children of replaced expr.
return false
}
}
nextID = cursor.nextID
return true
}, exp)
}
Expand Down

0 comments on commit f87ff80

Please sign in to comment.