Skip to content

Commit

Permalink
fix: following pr review
Browse files Browse the repository at this point in the history
  • Loading branch information
elsapet committed May 20, 2024
1 parent a7e5690 commit b1f0f3e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions internal/languages/python/analyzer/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,11 @@ func (analyzer *analyzer) analyzeAttribute(node *sitter.Node, visitChildren func
// globals()[y]
func (analyzer *analyzer) analyzeSubscript(node *sitter.Node, visitChildren func() error) error {
objectNode := node.ChildByFieldName("value")
if objectNode.Type() == "identifier" {
analyzer.builder.Dataflow(node, objectNode)
analyzer.lookupVariable(objectNode)
}
analyzer.builder.Dataflow(node, objectNode)
analyzer.lookupVariable(objectNode)

subscriptNode := node.ChildByFieldName("subscript")
if subscriptNode.Type() == "identifier" {
analyzer.builder.Dataflow(node, subscriptNode)
analyzer.lookupVariable(subscriptNode)
}

Expand Down

0 comments on commit b1f0f3e

Please sign in to comment.