Skip to content

Commit 81e4110

Browse files
authored
QL: Add fields for signatureExpr
1 parent 8c46846 commit 81e4110

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
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 = "a8e519e676ff6e7aa9c1d0a8a329edefcaac69ae" }
13+
tree-sitter-ql = { git = "https://github.com/tausbn/tree-sitter-ql.git", rev = "91cdab850c2b6d97d1211da0423adb53c67fef3e" }
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 = "a8e519e676ff6e7aa9c1d0a8a329edefcaac69ae" }
14+
tree-sitter-ql = { git = "https://github.com/tausbn/tree-sitter-ql.git", rev = "91cdab850c2b6d97d1211da0423adb53c67fef3e" }

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,15 +1320,20 @@ module QL {
13201320
/** Gets the name of the primary QL class for this element. */
13211321
final override string getAPrimaryQlClass() { result = "SignatureExpr" }
13221322

1323+
/** Gets the node corresponding to the field `arity`. */
1324+
final Integer getArity() { ql_signature_expr_arity(this, result) }
1325+
13231326
/** Gets the node corresponding to the field `name`. */
13241327
final SimpleId getName() { ql_signature_expr_def(this, result) }
13251328

1326-
/** Gets the `i`th child of this node. */
1327-
final AstNode getChild(int i) { ql_signature_expr_child(this, i, result) }
1329+
/** Gets the node corresponding to the field `qualifier`. */
1330+
final ModuleExpr getQualifier() { ql_signature_expr_qualifier(this, result) }
13281331

13291332
/** Gets a field or child node of this node. */
13301333
final override AstNode getAFieldOrChild() {
1331-
ql_signature_expr_def(this, result) or ql_signature_expr_child(this, _, result)
1334+
ql_signature_expr_arity(this, result) or
1335+
ql_signature_expr_def(this, result) or
1336+
ql_signature_expr_qualifier(this, result)
13321337
}
13331338
}
13341339

ql/ql/src/ql.dbscheme

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -890,13 +890,14 @@ ql_set_literal_def(
890890
unique int id: @ql_set_literal
891891
);
892892

893-
@ql_signatureExpr_child_type = @ql_module_expr | @ql_token_integer
893+
ql_signature_expr_arity(
894+
unique int ql_signature_expr: @ql_signature_expr ref,
895+
unique int arity: @ql_token_integer ref
896+
);
894897

895-
#keyset[ql_signature_expr, index]
896-
ql_signature_expr_child(
897-
int ql_signature_expr: @ql_signature_expr ref,
898-
int index: int ref,
899-
unique int child: @ql_signatureExpr_child_type ref
898+
ql_signature_expr_qualifier(
899+
unique int ql_signature_expr: @ql_signature_expr ref,
900+
unique int qualifier: @ql_module_expr ref
900901
);
901902

902903
ql_signature_expr_def(

0 commit comments

Comments
 (0)