diff --git a/capa/features/extractors/ts/query.py b/capa/features/extractors/ts/query.py index 25de4c22bd..796817e9a9 100644 --- a/capa/features/extractors/ts/query.py +++ b/capa/features/extractors/ts/query.py @@ -35,6 +35,8 @@ def __init__(self, language: str): self.namespace = self.language.query( "(using_directive [(identifier) @namespace (qualified_name) @namespace])" ) - self.global_statement = self.language.query("(global_statement) @global-statement") + self.global_statement = self.language.query( + "(global_statement [(expression_statement) @global-statement (local_declaration_statement) @global-statement])" + ) else: raise NotImplementedError(f"Tree-sitter queries for {language} are not implemented.")