From d62306681d99a16c86d724b9a1af7d50b346ad58 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 19:36:55 +0000 Subject: [PATCH] chore: bump minijinja from 0.31.0 to 2.0.1 (#4429) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Maximilian Roos --- Cargo.lock | 4 ++-- prqlc/prqlc/Cargo.toml | 2 +- prqlc/prqlc/src/cli/jinja.rs | 13 +++++++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cfff34a0db27..c71f38c34beb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2215,9 +2215,9 @@ dependencies = [ [[package]] name = "minijinja" -version = "0.31.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673d1ece89f7e166f43270800d78f9b1a9d21fda92dbcfa3b98b21213cdccbbc" +checksum = "7165d0e94806d52ad5295e4b54a95176d831814840bc067298ca647e1c956338" dependencies = [ "serde", ] diff --git a/prqlc/prqlc/Cargo.toml b/prqlc/prqlc/Cargo.toml index a513b5d916e2..100e282b7796 100644 --- a/prqlc/prqlc/Cargo.toml +++ b/prqlc/prqlc/Cargo.toml @@ -76,7 +76,7 @@ clap_complete = {version = "4.4.9", optional = true} # We use minijinja just for the Jinja lexer, which is not part of the # public interface which is covered by semver guarantees. -minijinja = {version = "=0.31.0", features = ["unstable_machinery"], optional = true} +minijinja = {version = "=2.0.1", features = ["unstable_machinery"], optional = true} # For integration tests. These are gated by the `test-dbs` and `test-dbs-external` features, # rather than dev-dependencies, because dev-dependencies can't be optional. diff --git a/prqlc/prqlc/src/cli/jinja.rs b/prqlc/prqlc/src/cli/jinja.rs index a69f10b54d21..b47c8ff5d0d1 100644 --- a/prqlc/prqlc/src/cli/jinja.rs +++ b/prqlc/prqlc/src/cli/jinja.rs @@ -18,7 +18,10 @@ use std::collections::HashMap; use anyhow::Result; -use minijinja::machinery::{Span, Token}; +use minijinja::{ + machinery::{Span, Token, WhitespaceConfig}, + syntax::SyntaxConfig, +}; use regex::Regex; const ANCHOR_PREFIX: &str = "_jinja_"; @@ -41,7 +44,9 @@ pub fn pre_process(source: &str) -> Result<(String, JinjaContext)> { let mut blocks = Vec::new(); let mut current_block = Vec::new(); - for res in minijinja::machinery::tokenize(source, false) { + for res in + minijinja::machinery::tokenize(source, false, SyntaxConfig, WhitespaceConfig::default()) + { let (token, span) = res?; if let Token::TemplateData(data) = token { @@ -159,14 +164,18 @@ mod test { Span { start_line: 2, start_col: 9, + start_offset: 0, end_line: 12_123_123, end_col: 2_930_293, + end_offset: 0 }, Span { start_line: 7_893_648, start_col: 79678, + start_offset: 0, end_line: 3, end_col: 31, + end_offset: 0 } ] ),