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.

Signed-off-by: Adam Storek <adam.storek@mandiant.com>
  • Loading branch information
adamstorek committed Jul 5, 2022
1 parent 726d68e commit 2fdcac2
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 2fdcac2

Please sign in to comment.