Record annotation names in the AST

This commit is contained in:
Taus
2021-05-26 13:14:52 +00:00
committed by GitHub
parent e469ce171d
commit f2edd7724c
5 changed files with 16 additions and 6 deletions

2
Cargo.lock generated
View File

@@ -589,7 +589,7 @@ dependencies = [
[[package]]
name = "tree-sitter-ql"
version = "0.19.0"
source = "git+https://github.com/tausbn/tree-sitter-ql.git?rev=064e438e92a89d99a2b061eca39e0ea225e32341#064e438e92a89d99a2b061eca39e0ea225e32341"
source = "git+https://github.com/tausbn/tree-sitter-ql.git?rev=dee83b7a1c159f2c71d8d3d3bce3ee1203ed653a#dee83b7a1c159f2c71d8d3d3bce3ee1203ed653a"
dependencies = [
"cc",
"tree-sitter",

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 = "064e438e92a89d99a2b061eca39e0ea225e32341" }
tree-sitter-ql = { git = "https://github.com/tausbn/tree-sitter-ql.git", rev = "dee83b7a1c159f2c71d8d3d3bce3ee1203ed653a" }
clap = "2.33"
tracing = "0.1"
tracing-subscriber = { version = "0.2", features = ["env-filter"] }

View File

@@ -10,4 +10,4 @@ edition = "2018"
node-types = { path = "../node-types" }
tracing = "0.1"
tracing-subscriber = { version = "0.2", features = ["env-filter"] }
tree-sitter-ql = { git = "https://github.com/tausbn/tree-sitter-ql.git", rev = "064e438e92a89d99a2b061eca39e0ea225e32341" }
tree-sitter-ql = { git = "https://github.com/tausbn/tree-sitter-ql.git", rev = "dee83b7a1c159f2c71d8d3d3bce3ee1203ed653a" }

View File

@@ -350,11 +350,19 @@ module Generated {
class ExprAnnotation extends @expr_annotation, AstNode {
override string getAPrimaryQlClass() { result = "ExprAnnotation" }
override Location getLocation() { expr_annotation_def(this, _, result) }
override Location getLocation() { expr_annotation_def(this, _, _, _, result) }
AstNode getChild() { expr_annotation_def(this, result, _) }
AnnotName getAnnotArg() { expr_annotation_def(this, result, _, _, _) }
override AstNode getAFieldOrChild() { expr_annotation_def(this, result, _) }
AnnotName getName() { expr_annotation_def(this, _, result, _, _) }
AstNode getChild() { expr_annotation_def(this, _, _, result, _) }
override AstNode getAFieldOrChild() {
expr_annotation_def(this, result, _, _, _) or
expr_annotation_def(this, _, result, _, _) or
expr_annotation_def(this, _, _, result, _)
}
}
class False extends @token_false, Token {

View File

@@ -323,6 +323,8 @@ expr_aggregate_body_def(
expr_annotation_def(
unique int id: @expr_annotation,
int annot_arg: @token_annot_name ref,
int name: @token_annot_name ref,
int child: @expr_annotation_child_type ref,
int loc: @location ref
);