Skip to content

Commit 8c46846

Browse files
authored
Add fields to ModuleParam children
1 parent 0b8656e commit 8c46846

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

ql/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ql/extractor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ edition = "2018"
1010
flate2 = "1.0"
1111
node-types = { path = "../node-types" }
1212
tree-sitter = "0.19"
13-
tree-sitter-ql = { git = "https://github.com/tausbn/tree-sitter-ql.git", rev = "7928a971a9a408f7ad59876c2ecda4a5329a6795" }
13+
tree-sitter-ql = { git = "https://github.com/tausbn/tree-sitter-ql.git", rev = "a8e519e676ff6e7aa9c1d0a8a329edefcaac69ae" }
1414
clap = "2.33"
1515
tracing = "0.1"
1616
tracing-subscriber = { version = "0.3.3", features = ["env-filter"] }

ql/generator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ clap = "2.33"
1111
node-types = { path = "../node-types" }
1212
tracing = "0.1"
1313
tracing-subscriber = { version = "0.3.3", features = ["env-filter"] }
14-
tree-sitter-ql = { git = "https://github.com/tausbn/tree-sitter-ql.git", rev = "7928a971a9a408f7ad59876c2ecda4a5329a6795" }
14+
tree-sitter-ql = { git = "https://github.com/tausbn/tree-sitter-ql.git", rev = "a8e519e676ff6e7aa9c1d0a8a329edefcaac69ae" }

ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,11 +1035,16 @@ module QL {
10351035
/** Gets the name of the primary QL class for this element. */
10361036
final override string getAPrimaryQlClass() { result = "ModuleParam" }
10371037

1038-
/** Gets the `i`th child of this node. */
1039-
final AstNode getChild(int i) { ql_module_param_child(this, i, result) }
1038+
/** Gets the node corresponding to the field `parameter`. */
1039+
final SimpleId getParameter() { ql_module_param_def(this, result, _) }
1040+
1041+
/** Gets the node corresponding to the field `signature`. */
1042+
final SignatureExpr getSignature() { ql_module_param_def(this, _, result) }
10401043

10411044
/** Gets a field or child node of this node. */
1042-
final override AstNode getAFieldOrChild() { ql_module_param_child(this, _, result) }
1045+
final override AstNode getAFieldOrChild() {
1046+
ql_module_param_def(this, result, _) or ql_module_param_def(this, _, result)
1047+
}
10431048
}
10441049

10451050
/** A class representing `mul_expr` nodes. */

ql/ql/src/ql.dbscheme

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -679,17 +679,10 @@ ql_module_name_def(
679679
int child: @ql_token_simple_id ref
680680
);
681681

682-
@ql_moduleParam_child_type = @ql_signature_expr | @ql_token_simple_id
683-
684-
#keyset[ql_module_param, index]
685-
ql_module_param_child(
686-
int ql_module_param: @ql_module_param ref,
687-
int index: int ref,
688-
unique int child: @ql_moduleParam_child_type ref
689-
);
690-
691682
ql_module_param_def(
692-
unique int id: @ql_module_param
683+
unique int id: @ql_module_param,
684+
int parameter: @ql_token_simple_id ref,
685+
int signature: @ql_signature_expr ref
693686
);
694687

695688
@ql_mul_expr_left_type = @ql_add_expr | @ql_aggregate | @ql_call_or_unqual_agg_expr | @ql_comp_term | @ql_conjunction | @ql_disjunction | @ql_expr_annotation | @ql_if_term | @ql_implication | @ql_in_expr | @ql_instance_of | @ql_literal | @ql_mul_expr | @ql_negation | @ql_par_expr | @ql_prefix_cast | @ql_qualified_expr | @ql_quantified | @ql_range | @ql_set_literal | @ql_special_call | @ql_super_ref | @ql_unary_expr | @ql_variable

0 commit comments

Comments
 (0)