Skip to content

Commit

Permalink
fix: lookup variables in require/include
Browse files Browse the repository at this point in the history
  • Loading branch information
didroe committed Sep 28, 2023
1 parent c3557d6 commit a838f39
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion internal/languages/php/analyzer/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,17 @@ func (analyzer *analyzer) Analyze(node *sitter.Node, visitChildren func() error)
return analyzer.analyzeGenericConstruct(node, visitChildren)
case "switch_label":
return visitChildren()
case "binary_expression", "unary_op_expression", "argument", "encapsed_string", "sequence_expression", "array_element_initializer", "formal_parameters":
case "binary_expression",
"unary_op_expression",
"argument",
"encapsed_string",
"sequence_expression",
"array_element_initializer",
"formal_parameters",
"include_expression",
"include_once_expression",
"require_expression",
"require_once_expression":
return analyzer.analyzeGenericOperation(node, visitChildren)
case "while_statement", "do_statement", "if_statement", "expression_statement", "compound_statement": // statements don't have results
return visitChildren()
Expand Down

0 comments on commit a838f39

Please sign in to comment.