mirror of
https://github.com/github/codeql.git
synced 2026-08-06 02:13:10 +02:00
47 lines
1.4 KiB
Plaintext
47 lines
1.4 KiB
Plaintext
class AstNode extends @ruby_ast_node {
|
|
string toString() { none() }
|
|
}
|
|
|
|
private predicate body_statement(AstNode body) {
|
|
exists(AstNode node |
|
|
ruby_class_def(node, _) and
|
|
ruby_ast_node_info(body, node, _, _) and
|
|
ruby_tokeninfo(body, _, "end") and
|
|
ruby_class_child(node, _, _)
|
|
or
|
|
ruby_do_block_def(node) and
|
|
ruby_ast_node_info(body, node, _, _) and
|
|
ruby_tokeninfo(body, _, "end") and
|
|
ruby_do_block_child(node, _, _)
|
|
or
|
|
ruby_method_def(node, _) and
|
|
ruby_ast_node_info(body, node, _, _) and
|
|
ruby_tokeninfo(body, _, "end") and
|
|
ruby_method_child(node, _, _)
|
|
or
|
|
ruby_module_def(node, _) and
|
|
ruby_ast_node_info(body, node, _, _) and
|
|
ruby_tokeninfo(body, _, "end") and
|
|
ruby_module_child(node, _, _)
|
|
or
|
|
ruby_singleton_class_def(node, _) and
|
|
ruby_ast_node_info(body, node, _, _) and
|
|
ruby_tokeninfo(body, _, "end") and
|
|
ruby_singleton_class_child(node, _, _)
|
|
or
|
|
ruby_singleton_method_def(node, _, _) and
|
|
ruby_ast_node_info(body, node, _, _) and
|
|
ruby_tokeninfo(body, _, "end") and
|
|
ruby_singleton_method_child(node, _, _)
|
|
or
|
|
ruby_block_def(node) and
|
|
ruby_ast_node_info(body, node, _, _) and
|
|
ruby_tokeninfo(body, _, "}") and
|
|
ruby_block_child(node, _, _)
|
|
)
|
|
}
|
|
|
|
from AstNode token, int kind, string value
|
|
where ruby_tokeninfo(token, kind, value) and not body_statement(token)
|
|
select token, kind, value
|