Skip to content

Commit

Permalink
Modifying extraction of global statements to omit local function decl…
Browse files Browse the repository at this point in the history
…arations.
  • Loading branch information
adamstorek committed Jul 5, 2022
1 parent 726d68e commit 0a61d86
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion capa/features/extractors/ts/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

0 comments on commit 0a61d86

Please sign in to comment.