You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.
HackAstQuery - this is basically just a refactoring; for example, $hhast_node->getDescendantsOfType(HHAST\Foo::class) is largely the same as $hackast_node->query()->selectByType(HackAstFoo::class)
HackCST* - this is a structured query language (but not actually SQL) for hh_server using hh_client --cst-search or hh_client --cst-search-files; this is depended on by HackASTQuery, and can also be used to reduce the number of files that a codemod needs to inspect
HackAstMatcher - this is another query approach, allowing sscanf()-style patterns. For example, $matcher = await HackAstMatcher::genFromStmt('list(%s) = await genva(%s);'); $nodes = $ast->query()->selectByMatcher($matcher)->nodes() This ultimately allows reimplementing something similar to spatch on top of the AST.
HackCST* and HackAstMatcher have standalone benefits for HHAST in usability in performance; HackAstQuery would make it easier to port FB-internal codemods.
The text was updated successfully, but these errors were encountered:
Key components:
$hhast_node->getDescendantsOfType(HHAST\Foo::class)
is largely the same as$hackast_node->query()->selectByType(HackAstFoo::class)
hh_client --cst-search
orhh_client --cst-search-files
; this is depended on by HackASTQuery, and can also be used to reduce the number of files that a codemod needs to inspect$matcher = await HackAstMatcher::genFromStmt('list(%s) = await genva(%s);'); $nodes = $ast->query()->selectByMatcher($matcher)->nodes()
This ultimately allows reimplementing something similar to spatch on top of the AST.HackCST* and HackAstMatcher have standalone benefits for HHAST in usability in performance; HackAstQuery would make it easier to port FB-internal codemods.
The text was updated successfully, but these errors were encountered: