Skip to content

Commit

Permalink
fix(java): add try statement as unanchored pattern (#1049)
Browse files Browse the repository at this point in the history
  • Loading branch information
elsapet authored Jun 12, 2023
1 parent 8f8c5d7 commit ad0d811
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion new/language/implementation/java/java.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ func (implementation *javaImplementation) PatternIsAnchored(node *tree.Node) (bo
// Class body class_body
// function block
// lambda () -> {} block
unAnchored := []string{"class_body", "block"}
// try {} catch () {}
unAnchored := []string{"class_body", "block", "try_statement"}

isUnanchored := !slices.Contains(unAnchored, parent.Type())
return isUnanchored, isUnanchored
Expand Down

0 comments on commit ad0d811

Please sign in to comment.