Skip to content

Commit

Permalink
chore: bump minijinja from 0.31.0 to 2.0.1 (#4429)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Roos <[email protected]>
  • Loading branch information
dependabot[bot] and max-sixty authored Apr 29, 2024
1 parent 28e4206 commit d623066
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion prqlc/prqlc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 11 additions & 2 deletions prqlc/prqlc/src/cli/jinja.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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_";
Expand All @@ -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 {
Expand Down Expand Up @@ -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
}
]
),
Expand Down

0 comments on commit d623066

Please sign in to comment.