Skip to content

Commit

Permalink
refactor: use correct name for IsAnchored result
Browse files Browse the repository at this point in the history
  • Loading branch information
didroe committed Oct 17, 2023
1 parent a2386ec commit 9e241d2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions internal/languages/golang/pattern/pattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ func (*Pattern) IsAnchored(node *tree.Node) (bool, bool) {
"var_declaration",
}

isUnanchored := !slices.Contains(unAnchored, parent.Type())
return isUnanchored, isUnanchored
isAnchored := !slices.Contains(unAnchored, parent.Type())
return isAnchored, isAnchored
}

func (*Pattern) IsRoot(node *tree.Node) bool {
Expand Down
4 changes: 2 additions & 2 deletions internal/languages/java/pattern/pattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ func (*Pattern) IsAnchored(node *tree.Node) (bool, bool) {
// try {} catch () {}
unAnchored := []string{"class_body", "block", "try_statement", "catch_type", "resource_specification"}

isUnanchored := !slices.Contains(unAnchored, parent.Type())
return isUnanchored, isUnanchored
isAnchored := !slices.Contains(unAnchored, parent.Type())
return isAnchored, isAnchored
}

func (*Pattern) IsRoot(node *tree.Node) bool {
Expand Down
4 changes: 2 additions & 2 deletions internal/languages/javascript/pattern/pattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ func (*Pattern) IsAnchored(node *tree.Node) (bool, bool) {
// method statement_block
unAnchored := []string{"statement_block", "class_body", "object_pattern", "named_imports"}

isUnanchored := !slices.Contains(unAnchored, parent.Type())
return isUnanchored, isUnanchored
isAnchored := !slices.Contains(unAnchored, parent.Type())
return isAnchored, isAnchored
}

func (*Pattern) IsRoot(node *tree.Node) bool {
Expand Down
4 changes: 2 additions & 2 deletions internal/languages/php/pattern/pattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ func (*Pattern) IsAnchored(node *tree.Node) (bool, bool) {
"compound_statement",
}

isUnanchored := !slices.Contains(unAnchored, parent.Type())
return isUnanchored, isUnanchored
isAnchored := !slices.Contains(unAnchored, parent.Type())
return isAnchored, isAnchored
}

func (*Pattern) IsRoot(node *tree.Node) bool {
Expand Down
4 changes: 2 additions & 2 deletions internal/languages/python/pattern/pattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ func (*Pattern) IsAnchored(node *tree.Node) (bool, bool) {
// function/block compound_statement
unAnchored := []string{}

isUnanchored := !slices.Contains(unAnchored, parent.Type())
return isUnanchored, isUnanchored
isAnchored := !slices.Contains(unAnchored, parent.Type())
return isAnchored, isAnchored
}

func (*Pattern) IsRoot(node *tree.Node) bool {
Expand Down

0 comments on commit 9e241d2

Please sign in to comment.