QL: Add fields for signatureExpr

This commit is contained in:
Taus
2022-06-13 15:44:40 +00:00
committed by GitHub
parent 8c46846b82
commit 81e41106e7
5 changed files with 17 additions and 11 deletions

BIN
ql/Cargo.lock generated

Binary file not shown.

View File

@@ -10,7 +10,7 @@ edition = "2018"
flate2 = "1.0"
node-types = { path = "../node-types" }
tree-sitter = "0.19"
tree-sitter-ql = { git = "https://github.com/tausbn/tree-sitter-ql.git", rev = "a8e519e676ff6e7aa9c1d0a8a329edefcaac69ae" }
tree-sitter-ql = { git = "https://github.com/tausbn/tree-sitter-ql.git", rev = "91cdab850c2b6d97d1211da0423adb53c67fef3e" }
clap = "2.33"
tracing = "0.1"
tracing-subscriber = { version = "0.3.3", features = ["env-filter"] }

View File

@@ -11,4 +11,4 @@ clap = "2.33"
node-types = { path = "../node-types" }
tracing = "0.1"
tracing-subscriber = { version = "0.3.3", features = ["env-filter"] }
tree-sitter-ql = { git = "https://github.com/tausbn/tree-sitter-ql.git", rev = "a8e519e676ff6e7aa9c1d0a8a329edefcaac69ae" }
tree-sitter-ql = { git = "https://github.com/tausbn/tree-sitter-ql.git", rev = "91cdab850c2b6d97d1211da0423adb53c67fef3e" }

View File

@@ -1320,15 +1320,20 @@ module QL {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "SignatureExpr" }
/** Gets the node corresponding to the field `arity`. */
final Integer getArity() { ql_signature_expr_arity(this, result) }
/** Gets the node corresponding to the field `name`. */
final SimpleId getName() { ql_signature_expr_def(this, result) }
/** Gets the `i`th child of this node. */
final AstNode getChild(int i) { ql_signature_expr_child(this, i, result) }
/** Gets the node corresponding to the field `qualifier`. */
final ModuleExpr getQualifier() { ql_signature_expr_qualifier(this, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() {
ql_signature_expr_def(this, result) or ql_signature_expr_child(this, _, result)
ql_signature_expr_arity(this, result) or
ql_signature_expr_def(this, result) or
ql_signature_expr_qualifier(this, result)
}
}

View File

@@ -890,13 +890,14 @@ ql_set_literal_def(
unique int id: @ql_set_literal
);
@ql_signatureExpr_child_type = @ql_module_expr | @ql_token_integer
ql_signature_expr_arity(
unique int ql_signature_expr: @ql_signature_expr ref,
unique int arity: @ql_token_integer ref
);
#keyset[ql_signature_expr, index]
ql_signature_expr_child(
int ql_signature_expr: @ql_signature_expr ref,
int index: int ref,
unique int child: @ql_signatureExpr_child_type ref
ql_signature_expr_qualifier(
unique int ql_signature_expr: @ql_signature_expr ref,
unique int qualifier: @ql_module_expr ref
);
ql_signature_expr_def(