mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
QL: Fix bad string grammar
What was there before made it so that you couldn't actually extract the contents of a string.
This commit is contained in:
BIN
ql/Cargo.lock
generated
BIN
ql/Cargo.lock
generated
Binary file not shown.
@@ -14,7 +14,7 @@ tree-sitter-ql = { git = "https://github.com/tree-sitter/tree-sitter-ql.git", re
|
|||||||
tree-sitter-ql-dbscheme = { git = "https://github.com/erik-krogh/tree-sitter-ql-dbscheme.git", rev = "63e1344353f63931e88bfbc2faa2e78e1421b213"}
|
tree-sitter-ql-dbscheme = { git = "https://github.com/erik-krogh/tree-sitter-ql-dbscheme.git", rev = "63e1344353f63931e88bfbc2faa2e78e1421b213"}
|
||||||
tree-sitter-ql-yaml = {git = "https://github.com/erik-krogh/tree-sitter-ql.git", rev = "cf704bf3671e1ae148e173464fb65a4d2bbf5f99"}
|
tree-sitter-ql-yaml = {git = "https://github.com/erik-krogh/tree-sitter-ql.git", rev = "cf704bf3671e1ae148e173464fb65a4d2bbf5f99"}
|
||||||
tree-sitter-blame = {path = "../buramu/tree-sitter-blame"}
|
tree-sitter-blame = {path = "../buramu/tree-sitter-blame"}
|
||||||
tree-sitter-json = {git = "https://github.com/tausbn/tree-sitter-json.git", rev = "471ceac44d127e609afa349cf0a59370791fe8b3"}
|
tree-sitter-json = {git = "https://github.com/tausbn/tree-sitter-json.git", rev = "ea1f655604c32c2f76aad2abed2498a56d81f3a9"}
|
||||||
clap = "2.33"
|
clap = "2.33"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-subscriber = { version = "0.3.16", features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3.16", features = ["env-filter"] }
|
||||||
|
|||||||
@@ -15,4 +15,4 @@ tree-sitter-ql = { git = "https://github.com/tree-sitter/tree-sitter-ql.git", re
|
|||||||
tree-sitter-ql-dbscheme = { git = "https://github.com/erik-krogh/tree-sitter-ql-dbscheme.git", rev = "63e1344353f63931e88bfbc2faa2e78e1421b213"}
|
tree-sitter-ql-dbscheme = { git = "https://github.com/erik-krogh/tree-sitter-ql-dbscheme.git", rev = "63e1344353f63931e88bfbc2faa2e78e1421b213"}
|
||||||
tree-sitter-ql-yaml = {git = "https://github.com/erik-krogh/tree-sitter-ql.git", rev = "cf704bf3671e1ae148e173464fb65a4d2bbf5f99"}
|
tree-sitter-ql-yaml = {git = "https://github.com/erik-krogh/tree-sitter-ql.git", rev = "cf704bf3671e1ae148e173464fb65a4d2bbf5f99"}
|
||||||
tree-sitter-blame = {path = "../buramu/tree-sitter-blame"}
|
tree-sitter-blame = {path = "../buramu/tree-sitter-blame"}
|
||||||
tree-sitter-json = { git = "https://github.com/tausbn/tree-sitter-json.git", rev = "471ceac44d127e609afa349cf0a59370791fe8b3"}
|
tree-sitter-json = { git = "https://github.com/tausbn/tree-sitter-json.git", rev = "ea1f655604c32c2f76aad2abed2498a56d81f3a9"}
|
||||||
|
|||||||
@@ -1930,12 +1930,6 @@ module JSON {
|
|||||||
final override AstNode getAFieldOrChild() { json_document_child(this, _, result) }
|
final override AstNode getAFieldOrChild() { json_document_child(this, _, result) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A class representing `escape_sequence` tokens. */
|
|
||||||
class EscapeSequence extends @json_token_escape_sequence, Token {
|
|
||||||
/** Gets the name of the primary QL class for this element. */
|
|
||||||
final override string getAPrimaryQlClass() { result = "EscapeSequence" }
|
|
||||||
}
|
|
||||||
|
|
||||||
/** A class representing `false` tokens. */
|
/** A class representing `false` tokens. */
|
||||||
class False extends @json_token_false, Token {
|
class False extends @json_token_false, Token {
|
||||||
/** Gets the name of the primary QL class for this element. */
|
/** Gets the name of the primary QL class for this element. */
|
||||||
@@ -1995,16 +1989,10 @@ module JSON {
|
|||||||
final override AstNode getAFieldOrChild() { json_string_child(this, result) }
|
final override AstNode getAFieldOrChild() { json_string_child(this, result) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A class representing `string_content` nodes. */
|
/** A class representing `string_content` tokens. */
|
||||||
class StringContent extends @json_string_content, AstNode {
|
class StringContent extends @json_token_string_content, Token {
|
||||||
/** Gets the name of the primary QL class for this element. */
|
/** Gets the name of the primary QL class for this element. */
|
||||||
final override string getAPrimaryQlClass() { result = "StringContent" }
|
final override string getAPrimaryQlClass() { result = "StringContent" }
|
||||||
|
|
||||||
/** Gets the `i`th child of this node. */
|
|
||||||
final EscapeSequence getChild(int i) { json_string_content_child(this, i, result) }
|
|
||||||
|
|
||||||
/** Gets a field or child node of this node. */
|
|
||||||
final override AstNode getAFieldOrChild() { json_string_content_child(this, _, result) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A class representing `true` tokens. */
|
/** A class representing `true` tokens. */
|
||||||
|
|||||||
@@ -1292,24 +1292,13 @@ json_pair_def(
|
|||||||
|
|
||||||
json_string_child(
|
json_string_child(
|
||||||
unique int json_string__: @json_string__ ref,
|
unique int json_string__: @json_string__ ref,
|
||||||
unique int child: @json_string_content ref
|
unique int child: @json_token_string_content ref
|
||||||
);
|
);
|
||||||
|
|
||||||
json_string_def(
|
json_string_def(
|
||||||
unique int id: @json_string__
|
unique int id: @json_string__
|
||||||
);
|
);
|
||||||
|
|
||||||
#keyset[json_string_content, index]
|
|
||||||
json_string_content_child(
|
|
||||||
int json_string_content: @json_string_content ref,
|
|
||||||
int index: int ref,
|
|
||||||
unique int child: @json_token_escape_sequence ref
|
|
||||||
);
|
|
||||||
|
|
||||||
json_string_content_def(
|
|
||||||
unique int id: @json_string_content
|
|
||||||
);
|
|
||||||
|
|
||||||
@json_value = @json_array | @json_object | @json_string__ | @json_token_false | @json_token_null | @json_token_number | @json_token_true
|
@json_value = @json_array | @json_object | @json_string__ | @json_token_false | @json_token_null | @json_token_number | @json_token_true
|
||||||
|
|
||||||
json_tokeninfo(
|
json_tokeninfo(
|
||||||
@@ -1321,15 +1310,15 @@ json_tokeninfo(
|
|||||||
case @json_token.kind of
|
case @json_token.kind of
|
||||||
0 = @json_reserved_word
|
0 = @json_reserved_word
|
||||||
| 1 = @json_token_comment
|
| 1 = @json_token_comment
|
||||||
| 2 = @json_token_escape_sequence
|
| 2 = @json_token_false
|
||||||
| 3 = @json_token_false
|
| 3 = @json_token_null
|
||||||
| 4 = @json_token_null
|
| 4 = @json_token_number
|
||||||
| 5 = @json_token_number
|
| 5 = @json_token_string_content
|
||||||
| 6 = @json_token_true
|
| 6 = @json_token_true
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@json_ast_node = @json_array | @json_document | @json_object | @json_pair | @json_string__ | @json_string_content | @json_token
|
@json_ast_node = @json_array | @json_document | @json_object | @json_pair | @json_string__ | @json_token
|
||||||
|
|
||||||
@json_ast_node_parent = @file | @json_ast_node
|
@json_ast_node_parent = @file | @json_ast_node
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user