mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
867 lines
13 KiB
Plaintext
867 lines
13 KiB
Plaintext
// generated by codegen
|
|
|
|
// from ../shared/tree-sitter-extractor/src/generator/prefix.dbscheme
|
|
/*- Files and folders -*/
|
|
|
|
/**
|
|
* The location of an element.
|
|
* The location spans column `startcolumn` of line `startline` to
|
|
* column `endcolumn` of line `endline` in file `file`.
|
|
* For more information, see
|
|
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
|
|
*/
|
|
locations_default(
|
|
unique int id: @location_default,
|
|
int file: @file ref,
|
|
int beginLine: int ref,
|
|
int beginColumn: int ref,
|
|
int endLine: int ref,
|
|
int endColumn: int ref
|
|
);
|
|
|
|
files(
|
|
unique int id: @file,
|
|
string name: string ref
|
|
);
|
|
|
|
folders(
|
|
unique int id: @folder,
|
|
string name: string ref
|
|
);
|
|
|
|
@container = @file | @folder
|
|
|
|
containerparent(
|
|
int parent: @container ref,
|
|
unique int child: @container ref
|
|
);
|
|
|
|
/*- Empty location -*/
|
|
|
|
empty_location(
|
|
int location: @location_default ref
|
|
);
|
|
|
|
/*- Source location prefix -*/
|
|
|
|
/**
|
|
* The source location of the snapshot.
|
|
*/
|
|
sourceLocationPrefix(string prefix : string ref);
|
|
|
|
/*- Diagnostic messages -*/
|
|
|
|
diagnostics(
|
|
unique int id: @diagnostic,
|
|
int severity: int ref,
|
|
string error_tag: string ref,
|
|
string error_message: string ref,
|
|
string full_error_message: string ref,
|
|
int location: @location_default ref
|
|
);
|
|
|
|
/*- Diagnostic messages: severity -*/
|
|
|
|
case @diagnostic.severity of
|
|
10 = @diagnostic_debug
|
|
| 20 = @diagnostic_info
|
|
| 30 = @diagnostic_warning
|
|
| 40 = @diagnostic_error
|
|
;
|
|
|
|
/*- YAML -*/
|
|
|
|
#keyset[parent, idx]
|
|
yaml (unique int id: @yaml_node,
|
|
int kind: int ref,
|
|
int parent: @yaml_node_parent ref,
|
|
int idx: int ref,
|
|
string tag: string ref,
|
|
string tostring: string ref);
|
|
|
|
case @yaml_node.kind of
|
|
0 = @yaml_scalar_node
|
|
| 1 = @yaml_mapping_node
|
|
| 2 = @yaml_sequence_node
|
|
| 3 = @yaml_alias_node
|
|
;
|
|
|
|
@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node;
|
|
|
|
@yaml_node_parent = @yaml_collection_node | @file;
|
|
|
|
yaml_anchors (unique int node: @yaml_node ref,
|
|
string anchor: string ref);
|
|
|
|
yaml_aliases (unique int alias: @yaml_alias_node ref,
|
|
string target: string ref);
|
|
|
|
yaml_scalars (unique int scalar: @yaml_scalar_node ref,
|
|
int style: int ref,
|
|
string value: string ref);
|
|
|
|
yaml_errors (unique int id: @yaml_error,
|
|
string message: string ref);
|
|
|
|
yaml_locations(unique int locatable: @yaml_locatable ref,
|
|
int location: @location_default ref);
|
|
|
|
@yaml_locatable = @yaml_node | @yaml_error;
|
|
|
|
|
|
// from prefix.dbscheme
|
|
#keyset[id]
|
|
locatable_locations(
|
|
int id: @locatable ref,
|
|
int location: @location_default ref
|
|
);
|
|
|
|
|
|
// from schema.py
|
|
|
|
@element =
|
|
@locatable
|
|
;
|
|
|
|
@locatable =
|
|
@ast_node
|
|
;
|
|
|
|
@ast_node =
|
|
@declaration
|
|
| @expr
|
|
| @label
|
|
| @match_arm
|
|
| @pat
|
|
| @record_field_pat
|
|
| @record_lit_field
|
|
| @stmt
|
|
| @type_ref
|
|
| @unimplemented
|
|
;
|
|
|
|
@declaration =
|
|
@function
|
|
| @module
|
|
;
|
|
|
|
@expr =
|
|
@array_expr
|
|
| @await_expr
|
|
| @become_expr
|
|
| @binary_op_expr
|
|
| @block_expr_base
|
|
| @box_expr
|
|
| @break_expr
|
|
| @call_expr
|
|
| @cast_expr
|
|
| @closure_expr
|
|
| @const_expr
|
|
| @continue_expr
|
|
| @field_expr
|
|
| @if_expr
|
|
| @index_expr
|
|
| @inline_asm_expr
|
|
| @let_expr
|
|
| @literal_expr
|
|
| @loop_expr
|
|
| @match_expr
|
|
| @method_call_expr
|
|
| @missing_expr
|
|
| @offset_of_expr
|
|
| @path_expr
|
|
| @range_expr
|
|
| @record_lit_expr
|
|
| @ref_expr
|
|
| @return_expr
|
|
| @tuple_expr
|
|
| @unary_op_expr
|
|
| @underscore_expr
|
|
| @yeet_expr
|
|
| @yield_expr
|
|
;
|
|
|
|
labels(
|
|
unique int id: @label,
|
|
string name: string ref
|
|
);
|
|
|
|
match_arms(
|
|
unique int id: @match_arm,
|
|
int pat: @pat ref,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
match_arm_guards(
|
|
int id: @match_arm ref,
|
|
int guard: @expr ref
|
|
);
|
|
|
|
@pat =
|
|
@bind_pat
|
|
| @box_pat
|
|
| @const_block_pat
|
|
| @lit_pat
|
|
| @missing_pat
|
|
| @or_pat
|
|
| @path_pat
|
|
| @range_pat
|
|
| @record_pat
|
|
| @ref_pat
|
|
| @slice_pat
|
|
| @tuple_pat
|
|
| @tuple_struct_pat
|
|
| @wild_pat
|
|
;
|
|
|
|
record_field_pats(
|
|
unique int id: @record_field_pat,
|
|
string name: string ref,
|
|
int pat: @pat ref
|
|
);
|
|
|
|
record_lit_fields(
|
|
unique int id: @record_lit_field,
|
|
string name: string ref,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
@stmt =
|
|
@expr_stmt
|
|
| @item_stmt
|
|
| @let_stmt
|
|
;
|
|
|
|
type_refs(
|
|
unique int id: @type_ref
|
|
);
|
|
|
|
unimplementeds(
|
|
unique int id: @unimplemented
|
|
);
|
|
|
|
@array_expr =
|
|
@element_list_expr
|
|
| @repeat_expr
|
|
;
|
|
|
|
await_exprs(
|
|
unique int id: @await_expr,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
become_exprs(
|
|
unique int id: @become_expr,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
binary_op_exprs(
|
|
unique int id: @binary_op_expr,
|
|
int lhs: @expr ref,
|
|
int rhs: @expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
binary_op_expr_ops(
|
|
int id: @binary_op_expr ref,
|
|
string op: string ref
|
|
);
|
|
|
|
bind_pats(
|
|
unique int id: @bind_pat,
|
|
string binding_id: string ref
|
|
);
|
|
|
|
#keyset[id]
|
|
bind_pat_subpats(
|
|
int id: @bind_pat ref,
|
|
int subpat: @pat ref
|
|
);
|
|
|
|
@block_expr_base =
|
|
@async_block_expr
|
|
| @block_expr
|
|
| @unsafe_block_expr
|
|
;
|
|
|
|
#keyset[id, index]
|
|
block_expr_base_statements(
|
|
int id: @block_expr_base ref,
|
|
int index: int ref,
|
|
int statement: @stmt ref
|
|
);
|
|
|
|
#keyset[id]
|
|
block_expr_base_tails(
|
|
int id: @block_expr_base ref,
|
|
int tail: @expr ref
|
|
);
|
|
|
|
box_exprs(
|
|
unique int id: @box_expr,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
box_pats(
|
|
unique int id: @box_pat,
|
|
int inner: @pat ref
|
|
);
|
|
|
|
break_exprs(
|
|
unique int id: @break_expr
|
|
);
|
|
|
|
#keyset[id]
|
|
break_expr_exprs(
|
|
int id: @break_expr ref,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
break_expr_labels(
|
|
int id: @break_expr ref,
|
|
int label: @label ref
|
|
);
|
|
|
|
call_exprs(
|
|
unique int id: @call_expr,
|
|
int callee: @expr ref
|
|
);
|
|
|
|
#keyset[id, index]
|
|
call_expr_args(
|
|
int id: @call_expr ref,
|
|
int index: int ref,
|
|
int arg: @expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
call_expr_is_assignee_expr(
|
|
int id: @call_expr ref
|
|
);
|
|
|
|
cast_exprs(
|
|
unique int id: @cast_expr,
|
|
int expr: @expr ref,
|
|
int type_ref: @type_ref ref
|
|
);
|
|
|
|
closure_exprs(
|
|
unique int id: @closure_expr,
|
|
int body: @expr ref,
|
|
string closure_kind: string ref
|
|
);
|
|
|
|
#keyset[id, index]
|
|
closure_expr_args(
|
|
int id: @closure_expr ref,
|
|
int index: int ref,
|
|
int arg: @pat ref
|
|
);
|
|
|
|
#keyset[id, index]
|
|
closure_expr_arg_types(
|
|
int id: @closure_expr ref,
|
|
int index: int ref,
|
|
int arg_type: @type_ref ref
|
|
);
|
|
|
|
#keyset[id]
|
|
closure_expr_ret_types(
|
|
int id: @closure_expr ref,
|
|
int ret_type: @type_ref ref
|
|
);
|
|
|
|
#keyset[id]
|
|
closure_expr_is_move(
|
|
int id: @closure_expr ref
|
|
);
|
|
|
|
const_block_pats(
|
|
unique int id: @const_block_pat,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
const_exprs(
|
|
unique int id: @const_expr,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
continue_exprs(
|
|
unique int id: @continue_expr
|
|
);
|
|
|
|
#keyset[id]
|
|
continue_expr_labels(
|
|
int id: @continue_expr ref,
|
|
int label: @label ref
|
|
);
|
|
|
|
expr_stmts(
|
|
unique int id: @expr_stmt,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
expr_stmt_has_semicolon(
|
|
int id: @expr_stmt ref
|
|
);
|
|
|
|
field_exprs(
|
|
unique int id: @field_expr,
|
|
int expr: @expr ref,
|
|
string name: string ref
|
|
);
|
|
|
|
functions(
|
|
unique int id: @function,
|
|
string name: string ref,
|
|
int body: @expr ref
|
|
);
|
|
|
|
if_exprs(
|
|
unique int id: @if_expr,
|
|
int condition: @expr ref,
|
|
int then: @expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
if_expr_elses(
|
|
int id: @if_expr ref,
|
|
int else: @expr ref
|
|
);
|
|
|
|
index_exprs(
|
|
unique int id: @index_expr,
|
|
int base: @expr ref,
|
|
int index: @expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
index_expr_is_assignee_expr(
|
|
int id: @index_expr ref
|
|
);
|
|
|
|
inline_asm_exprs(
|
|
unique int id: @inline_asm_expr,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
item_stmts(
|
|
unique int id: @item_stmt
|
|
);
|
|
|
|
let_exprs(
|
|
unique int id: @let_expr,
|
|
int pat: @pat ref,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
let_stmts(
|
|
unique int id: @let_stmt,
|
|
int pat: @pat ref
|
|
);
|
|
|
|
#keyset[id]
|
|
let_stmt_type_refs(
|
|
int id: @let_stmt ref,
|
|
int type_ref: @type_ref ref
|
|
);
|
|
|
|
#keyset[id]
|
|
let_stmt_initializers(
|
|
int id: @let_stmt ref,
|
|
int initializer: @expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
let_stmt_elses(
|
|
int id: @let_stmt ref,
|
|
int else: @expr ref
|
|
);
|
|
|
|
lit_pats(
|
|
unique int id: @lit_pat,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
literal_exprs(
|
|
unique int id: @literal_expr
|
|
);
|
|
|
|
loop_exprs(
|
|
unique int id: @loop_expr,
|
|
int body: @expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
loop_expr_labels(
|
|
int id: @loop_expr ref,
|
|
int label: @label ref
|
|
);
|
|
|
|
match_exprs(
|
|
unique int id: @match_expr,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
#keyset[id, index]
|
|
match_expr_branches(
|
|
int id: @match_expr ref,
|
|
int index: int ref,
|
|
int branch: @match_arm ref
|
|
);
|
|
|
|
method_call_exprs(
|
|
unique int id: @method_call_expr,
|
|
int receiver: @expr ref,
|
|
string method_name: string ref
|
|
);
|
|
|
|
#keyset[id, index]
|
|
method_call_expr_args(
|
|
int id: @method_call_expr ref,
|
|
int index: int ref,
|
|
int arg: @expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
method_call_expr_generic_args(
|
|
int id: @method_call_expr ref,
|
|
int generic_args: @unimplemented ref
|
|
);
|
|
|
|
missing_exprs(
|
|
unique int id: @missing_expr
|
|
);
|
|
|
|
missing_pats(
|
|
unique int id: @missing_pat
|
|
);
|
|
|
|
modules(
|
|
unique int id: @module
|
|
);
|
|
|
|
#keyset[id, index]
|
|
module_declarations(
|
|
int id: @module ref,
|
|
int index: int ref,
|
|
int declaration: @declaration ref
|
|
);
|
|
|
|
offset_of_exprs(
|
|
unique int id: @offset_of_expr,
|
|
int container: @type_ref ref
|
|
);
|
|
|
|
#keyset[id, index]
|
|
offset_of_expr_fields(
|
|
int id: @offset_of_expr ref,
|
|
int index: int ref,
|
|
string field: string ref
|
|
);
|
|
|
|
or_pats(
|
|
unique int id: @or_pat
|
|
);
|
|
|
|
#keyset[id, index]
|
|
or_pat_args(
|
|
int id: @or_pat ref,
|
|
int index: int ref,
|
|
int arg: @pat ref
|
|
);
|
|
|
|
path_exprs(
|
|
unique int id: @path_expr,
|
|
int path: @unimplemented ref
|
|
);
|
|
|
|
path_pats(
|
|
unique int id: @path_pat,
|
|
int path: @unimplemented ref
|
|
);
|
|
|
|
range_exprs(
|
|
unique int id: @range_expr
|
|
);
|
|
|
|
#keyset[id]
|
|
range_expr_lhs(
|
|
int id: @range_expr ref,
|
|
int lhs: @expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
range_expr_rhs(
|
|
int id: @range_expr ref,
|
|
int rhs: @expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
range_expr_is_inclusive(
|
|
int id: @range_expr ref
|
|
);
|
|
|
|
range_pats(
|
|
unique int id: @range_pat
|
|
);
|
|
|
|
#keyset[id]
|
|
range_pat_starts(
|
|
int id: @range_pat ref,
|
|
int start: @pat ref
|
|
);
|
|
|
|
#keyset[id]
|
|
range_pat_ends(
|
|
int id: @range_pat ref,
|
|
int end: @pat ref
|
|
);
|
|
|
|
record_lit_exprs(
|
|
unique int id: @record_lit_expr
|
|
);
|
|
|
|
#keyset[id]
|
|
record_lit_expr_paths(
|
|
int id: @record_lit_expr ref,
|
|
int path: @unimplemented ref
|
|
);
|
|
|
|
#keyset[id, index]
|
|
record_lit_expr_fields(
|
|
int id: @record_lit_expr ref,
|
|
int index: int ref,
|
|
int field: @record_lit_field ref
|
|
);
|
|
|
|
#keyset[id]
|
|
record_lit_expr_spreads(
|
|
int id: @record_lit_expr ref,
|
|
int spread: @expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
record_lit_expr_has_ellipsis(
|
|
int id: @record_lit_expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
record_lit_expr_is_assignee_expr(
|
|
int id: @record_lit_expr ref
|
|
);
|
|
|
|
record_pats(
|
|
unique int id: @record_pat
|
|
);
|
|
|
|
#keyset[id]
|
|
record_pat_paths(
|
|
int id: @record_pat ref,
|
|
int path: @unimplemented ref
|
|
);
|
|
|
|
#keyset[id, index]
|
|
record_pat_args(
|
|
int id: @record_pat ref,
|
|
int index: int ref,
|
|
int arg: @record_field_pat ref
|
|
);
|
|
|
|
#keyset[id]
|
|
record_pat_has_ellipsis(
|
|
int id: @record_pat ref
|
|
);
|
|
|
|
ref_exprs(
|
|
unique int id: @ref_expr,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
ref_expr_is_raw(
|
|
int id: @ref_expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
ref_expr_is_mut(
|
|
int id: @ref_expr ref
|
|
);
|
|
|
|
ref_pats(
|
|
unique int id: @ref_pat,
|
|
int pat: @pat ref
|
|
);
|
|
|
|
#keyset[id]
|
|
ref_pat_is_mut(
|
|
int id: @ref_pat ref
|
|
);
|
|
|
|
return_exprs(
|
|
unique int id: @return_expr
|
|
);
|
|
|
|
#keyset[id]
|
|
return_expr_exprs(
|
|
int id: @return_expr ref,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
slice_pats(
|
|
unique int id: @slice_pat
|
|
);
|
|
|
|
#keyset[id, index]
|
|
slice_pat_prefixes(
|
|
int id: @slice_pat ref,
|
|
int index: int ref,
|
|
int prefix: @pat ref
|
|
);
|
|
|
|
#keyset[id]
|
|
slice_pat_slice(
|
|
int id: @slice_pat ref,
|
|
int slice: @pat ref
|
|
);
|
|
|
|
#keyset[id, index]
|
|
slice_pat_suffixes(
|
|
int id: @slice_pat ref,
|
|
int index: int ref,
|
|
int suffix: @pat ref
|
|
);
|
|
|
|
tuple_exprs(
|
|
unique int id: @tuple_expr
|
|
);
|
|
|
|
#keyset[id, index]
|
|
tuple_expr_exprs(
|
|
int id: @tuple_expr ref,
|
|
int index: int ref,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
tuple_expr_is_assignee_expr(
|
|
int id: @tuple_expr ref
|
|
);
|
|
|
|
tuple_pats(
|
|
unique int id: @tuple_pat
|
|
);
|
|
|
|
#keyset[id, index]
|
|
tuple_pat_args(
|
|
int id: @tuple_pat ref,
|
|
int index: int ref,
|
|
int arg: @pat ref
|
|
);
|
|
|
|
#keyset[id]
|
|
tuple_pat_ellipsis_indices(
|
|
int id: @tuple_pat ref,
|
|
int ellipsis_index: int ref
|
|
);
|
|
|
|
tuple_struct_pats(
|
|
unique int id: @tuple_struct_pat
|
|
);
|
|
|
|
#keyset[id]
|
|
tuple_struct_pat_paths(
|
|
int id: @tuple_struct_pat ref,
|
|
int path: @unimplemented ref
|
|
);
|
|
|
|
#keyset[id, index]
|
|
tuple_struct_pat_args(
|
|
int id: @tuple_struct_pat ref,
|
|
int index: int ref,
|
|
int arg: @pat ref
|
|
);
|
|
|
|
#keyset[id]
|
|
tuple_struct_pat_ellipsis_indices(
|
|
int id: @tuple_struct_pat ref,
|
|
int ellipsis_index: int ref
|
|
);
|
|
|
|
unary_op_exprs(
|
|
unique int id: @unary_op_expr,
|
|
int expr: @expr ref,
|
|
string op: string ref
|
|
);
|
|
|
|
underscore_exprs(
|
|
unique int id: @underscore_expr
|
|
);
|
|
|
|
wild_pats(
|
|
unique int id: @wild_pat
|
|
);
|
|
|
|
yeet_exprs(
|
|
unique int id: @yeet_expr
|
|
);
|
|
|
|
#keyset[id]
|
|
yeet_expr_exprs(
|
|
int id: @yeet_expr ref,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
yield_exprs(
|
|
unique int id: @yield_expr
|
|
);
|
|
|
|
#keyset[id]
|
|
yield_expr_exprs(
|
|
int id: @yield_expr ref,
|
|
int expr: @expr ref
|
|
);
|
|
|
|
async_block_exprs(
|
|
unique int id: @async_block_expr
|
|
);
|
|
|
|
block_exprs(
|
|
unique int id: @block_expr
|
|
);
|
|
|
|
#keyset[id]
|
|
block_expr_labels(
|
|
int id: @block_expr ref,
|
|
int label: @label ref
|
|
);
|
|
|
|
element_list_exprs(
|
|
unique int id: @element_list_expr
|
|
);
|
|
|
|
#keyset[id, index]
|
|
element_list_expr_elements(
|
|
int id: @element_list_expr ref,
|
|
int index: int ref,
|
|
int element: @expr ref
|
|
);
|
|
|
|
#keyset[id]
|
|
element_list_expr_is_assignee_expr(
|
|
int id: @element_list_expr ref
|
|
);
|
|
|
|
repeat_exprs(
|
|
unique int id: @repeat_expr,
|
|
int initializer: @expr ref,
|
|
int repeat: @expr ref
|
|
);
|
|
|
|
unsafe_block_exprs(
|
|
unique int id: @unsafe_block_expr
|
|
);
|