From 2cdec47585458f5a72366adf1140b6659d4350d0 Mon Sep 17 00:00:00 2001 From: Taus Date: Wed, 22 Feb 2023 13:45:47 +0000 Subject: [PATCH] QL: Make the JSON parser a bit more robust Updates the grammar to allow trailing commas in objects and arrays. Also bumps the file size limit to 10MB. --- ql/Cargo.lock | 2 +- ql/autobuilder/src/main.rs | 2 +- ql/extractor/Cargo.toml | 2 +- ql/generator/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ql/Cargo.lock b/ql/Cargo.lock index a8d3fc681f4..ff29ea1c323 100644 --- a/ql/Cargo.lock +++ b/ql/Cargo.lock @@ -737,7 +737,7 @@ dependencies = [ [[package]] name = "tree-sitter-json" version = "0.20.0" -source = "git+https://github.com/tausbn/tree-sitter-json.git?rev=ea1f655604c32c2f76aad2abed2498a56d81f3a9#ea1f655604c32c2f76aad2abed2498a56d81f3a9" +source = "git+https://github.com/tausbn/tree-sitter-json.git?rev=745663ee997f1576fe1e7187e6347e0db36ec7a9#745663ee997f1576fe1e7187e6347e0db36ec7a9" dependencies = [ "cc", "tree-sitter", diff --git a/ql/autobuilder/src/main.rs b/ql/autobuilder/src/main.rs index a2c9df2d9b0..0d9605c4c1d 100644 --- a/ql/autobuilder/src/main.rs +++ b/ql/autobuilder/src/main.rs @@ -23,7 +23,7 @@ fn main() -> std::io::Result<()> { .arg("--include-extension=.jsonl") .arg("--include=**/qlpack.yml") .arg("--include=deprecated.blame") - .arg("--size-limit=5m") + .arg("--size-limit=10m") .arg("--language=ql") .arg("--working-dir=.") .arg(db); diff --git a/ql/extractor/Cargo.toml b/ql/extractor/Cargo.toml index 45bcc5e5d30..1a187625d22 100644 --- a/ql/extractor/Cargo.toml +++ b/ql/extractor/Cargo.toml @@ -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-yaml = {git = "https://github.com/erik-krogh/tree-sitter-ql.git", rev = "cf704bf3671e1ae148e173464fb65a4d2bbf5f99"} tree-sitter-blame = {path = "../buramu/tree-sitter-blame"} -tree-sitter-json = {git = "https://github.com/tausbn/tree-sitter-json.git", rev = "ea1f655604c32c2f76aad2abed2498a56d81f3a9"} +tree-sitter-json = {git = "https://github.com/tausbn/tree-sitter-json.git", rev = "745663ee997f1576fe1e7187e6347e0db36ec7a9"} clap = "2.33" tracing = "0.1" tracing-subscriber = { version = "0.3.16", features = ["env-filter"] } diff --git a/ql/generator/Cargo.toml b/ql/generator/Cargo.toml index 92cee7e1257..4fcc98be310 100644 --- a/ql/generator/Cargo.toml +++ b/ql/generator/Cargo.toml @@ -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-yaml = {git = "https://github.com/erik-krogh/tree-sitter-ql.git", rev = "cf704bf3671e1ae148e173464fb65a4d2bbf5f99"} tree-sitter-blame = {path = "../buramu/tree-sitter-blame"} -tree-sitter-json = { git = "https://github.com/tausbn/tree-sitter-json.git", rev = "ea1f655604c32c2f76aad2abed2498a56d81f3a9"} +tree-sitter-json = { git = "https://github.com/tausbn/tree-sitter-json.git", rev = "745663ee997f1576fe1e7187e6347e0db36ec7a9"}