Skip to content

Commit

Permalink
derive: without rendered message for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Kijewski committed Jul 29, 2024
1 parent 821a147 commit 2e41056
Show file tree
Hide file tree
Showing 35 changed files with 250 additions and 123 deletions.
1 change: 0 additions & 1 deletion rinja_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ with-warp = []

[dependencies]
parser = { package = "rinja_parser", version = "0.2.0", path = "../rinja_parser" }
annotate-snippets = "0.11.4"
basic-toml = { version = "0.1.1", optional = true }
memchr = "2"
mime = "0.3"
Expand Down
41 changes: 1 addition & 40 deletions rinja_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use std::collections::HashMap;
use std::fmt;
use std::path::Path;

use annotate_snippets::{Level, Renderer, Snippet};
use config::{read_config_file, Config};
use generator::{Generator, MapChain};
use heritage::{Context, Heritage};
Expand Down Expand Up @@ -97,14 +96,8 @@ pub fn derive_template(input: TokenStream12) -> TokenStream12 {
Err(CompileError {
msg,
span,
rendered,
rendered: _rendered,
}) => {
let msg = if rendered {
eprintln!("{msg}");
"the previous template error derives from"
} else {
&msg
};
let mut ts: TokenStream = parse_quote_spanned! {
span.unwrap_or(ast.ident.span()) =>
::core::compile_error!(#msg);
Expand Down Expand Up @@ -234,38 +227,6 @@ impl CompileError {
file_info: Option<FileInfo<'_>>,
span: Option<Span>,
) -> Self {
if let Some(FileInfo {
path,
source: Some(source),
node_source: Some(node_source),
}) = file_info
{
if source
.as_bytes()
.as_ptr_range()
.contains(&node_source.as_ptr())
{
let label = msg.to_string();
let path = match std::env::current_dir() {
Ok(cwd) => strip_common(&cwd, path),
Err(_) => path.display().to_string(),
};

let start = node_source.as_ptr() as usize - source.as_ptr() as usize;
let annotation = Level::Error.span(start..start).label("close to this token");
let snippet = Snippet::source(source)
.origin(&path)
.fold(true)
.annotation(annotation);
let message = Level::Error.title(&label).snippet(snippet);
return Self {
msg: Renderer::styled().render(message).to_string(),
span,
rendered: true,
};
}
}

let msg = match file_info {
Some(file_info) => format!("{msg}{file_info}"),
None => msg.to_string(),
Expand Down
1 change: 0 additions & 1 deletion rinja_derive_standalone/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ with-warp = []

[dependencies]
parser = { package = "rinja_parser", version = "0.2.0", path = "../rinja_parser" }
annotate-snippets = "0.11.4"
basic-toml = { version = "0.1.1", optional = true }
memchr = "2"
mime = "0.3"
Expand Down
24 changes: 18 additions & 6 deletions testing/tests/ui/as-primitive-type.stderr
Original file line number Diff line number Diff line change
@@ -1,34 +1,46 @@
error: the previous template error derives from
error: `as` operator expects the name of a primitive type on its right-hand side
--> <source attribute>:0:8
"as 4567 }}"
--> tests/ui/as-primitive-type.rs:4:12
|
4 | #[template(source = r#"{{ 1234 as 4567 }}"#, ext = "html")]
| ^^^^^^

error: the previous template error derives from
error: `as` operator expects the name of a primitive type on its right-hand side
--> <source attribute>:0:8
"as ? }}"
--> tests/ui/as-primitive-type.rs:8:12
|
8 | #[template(source = r#"{{ 1234 as ? }}"#, ext = "html")]
| ^^^^^^

error: the previous template error derives from
error: `as` operator expects the name of a primitive type on its right-hand side, found `u1234`
--> <source attribute>:0:8
"as u1234 }}"
--> tests/ui/as-primitive-type.rs:12:12
|
12 | #[template(source = r#"{{ 1234 as u1234 }}"#, ext = "html")]
| ^^^^^^

error: the previous template error derives from
error: `as` operator expects the name of a primitive type on its right-hand side, found `core`
--> <source attribute>:0:8
"as core::primitive::u32 }}"
--> tests/ui/as-primitive-type.rs:16:12
|
16 | #[template(source = r#"{{ 1234 as core::primitive::u32 }}"#, ext = "html")]
| ^^^^^^

error: the previous template error derives from
error: `as` operator expects the name of a primitive type on its right-hand side, found `int32_t`
--> <source attribute>:0:8
"as int32_t }}"
--> tests/ui/as-primitive-type.rs:20:12
|
20 | #[template(source = r#"{{ 1234 as int32_t }}"#, ext = "html")]
| ^^^^^^

error: the previous template error derives from
error: `as` operator expects the name of a primitive type on its right-hand side, found `int32_t`
--> <source attribute>:0:35
"as int32_t }}"
--> tests/ui/as-primitive-type.rs:24:12
|
24 | #[template(source = r#"{{ (1234 + 4 * 12 / 45675445 - 13) as int32_t }}"#, ext = "html")]
Expand Down
4 changes: 3 additions & 1 deletion testing/tests/ui/block_in_filter_block.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
error: the previous template error derives from
error: cannot have a block inside a filter block
--> BlockInFilter.html:6:10
" block title %}New title{% endblock %}\n a b\n {% endfilter %}\n{%- endblock body %}\n"
--> tests/ui/block_in_filter_block.rs:5:5
|
5 | source = r#"{% extends "html-base.html" %}
Expand Down
12 changes: 9 additions & 3 deletions testing/tests/ui/blocks_below_top_level.stderr
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
error: the previous template error derives from
error: `extends` blocks are not allowed below top level
--> MyTemplate1.txt:2:2
" extends \"bla.txt\" %}\n{% endblock %}\n"
--> tests/ui/blocks_below_top_level.rs:4:12
|
4 | #[template(source = r#"
| ^^^^^^

error: the previous template error derives from
error: `macro` blocks are not allowed below top level
--> MyTemplate2.txt:2:2
" macro bla() %}\n{% endmacro %}\n{% endblock %}\n"
--> tests/ui/blocks_below_top_level.rs:12:12
|
12 | #[template(source = r#"
| ^^^^^^

error: the previous template error derives from
error: `import` blocks are not allowed below top level
--> MyTemplate3.txt:2:2
" import \"bla.txt\" as blue %}\n{% endblock %}\n"
--> tests/ui/blocks_below_top_level.rs:21:12
|
21 | #[template(source = r#"
Expand Down
4 changes: 3 additions & 1 deletion testing/tests/ui/break_outside_of_loop.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
error: the previous template error derives from
error: you can only `break` inside a `for` loop
--> <source attribute>:0:9
"break%}, have a parsing error!"
--> tests/ui/break_outside_of_loop.rs:5:5
|
5 | source = "Have a {%break%}, have a parsing error!",
Expand Down
32 changes: 24 additions & 8 deletions testing/tests/ui/char_literal.stderr
Original file line number Diff line number Diff line change
@@ -1,46 +1,62 @@
error: the previous template error derives from
error: invalid character
--> testing/templates/char-literals/char-literal-1.txt:0:11
"'\\a' %}"
--> tests/ui/char_literal.rs:4:12
|
4 | #[template(path = "char-literals/char-literal-1.txt")]
| ^^^^

error: the previous template error derives from
error: invalid character
--> testing/templates/char-literals/char-literal-2.txt:0:11
"'\\x' %}"
--> tests/ui/char_literal.rs:8:12
|
8 | #[template(path = "char-literals/char-literal-2.txt")]
| ^^^^

error: the previous template error derives from
error: invalid character
--> testing/templates/char-literals/char-literal-3.txt:0:11
"'\\x1' %}"
--> tests/ui/char_literal.rs:12:12
|
12 | #[template(path = "char-literals/char-literal-3.txt")]
| ^^^^

error: the previous template error derives from
error: must be a character in the range [\x00-\x7f]
--> testing/templates/char-literals/char-literal-4.txt:0:11
"'\\x80' %}"
--> tests/ui/char_literal.rs:16:12
|
16 | #[template(path = "char-literals/char-literal-4.txt")]
| ^^^^

error: the previous template error derives from
error: invalid character
--> testing/templates/char-literals/char-literal-5.txt:0:11
"'\\u' %}"
--> tests/ui/char_literal.rs:20:12
|
20 | #[template(path = "char-literals/char-literal-5.txt")]
| ^^^^

error: the previous template error derives from
error: invalid character
--> testing/templates/char-literals/char-literal-6.txt:0:11
"'\\u{}' %}"
--> tests/ui/char_literal.rs:24:12
|
24 | #[template(path = "char-literals/char-literal-6.txt")]
| ^^^^

error: the previous template error derives from
error: unicode escape must be at most 10FFFF
--> testing/templates/char-literals/char-literal-7.txt:0:11
"'\\u{110000}' %}"
--> tests/ui/char_literal.rs:28:12
|
28 | #[template(path = "char-literals/char-literal-7.txt")]
| ^^^^

error: the previous template error derives from
error: invalid character
--> <source attribute>:0:11
"'aaa' %}"
--> tests/ui/char_literal.rs:32:12
|
32 | #[template(source = "{% let s = 'aaa' %}", ext = "html")]
Expand Down
12 changes: 9 additions & 3 deletions testing/tests/ui/error_file_path.stderr
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
error: the previous template error derives from
error: failed to parse template source
--> testing/templates/invalid_syntax.html:0:14
"}"
--> tests/ui/error_file_path.rs:4:12
|
4 | #[template(path = "invalid_syntax.html")]
| ^^^^

error: the previous template error derives from
error: failed to parse template source
--> testing/templates/invalid_syntax.html:0:14
"}"
--> tests/ui/error_file_path.rs:8:12
|
8 | #[template(path = "include_invalid_syntax.html")]
| ^^^^

error: the previous template error derives from
error: failed to parse template source
--> testing/templates/invalid_syntax.html:0:14
"}"
--> tests/ui/error_file_path.rs:12:12
|
12 | #[template(source = r#"{% extends "include_invalid_syntax.html" %}"#, ext = "txt")]
Expand Down
4 changes: 3 additions & 1 deletion testing/tests/ui/excessive_nesting.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
error: the previous template error derives from
error: your template code is too deeply nested, or last expression is too complex
--> <source attribute>:13:42
"%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 200\n\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 300\n\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 400\n\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 500\n\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 600\n\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 700\n\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 800\n\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 900\n\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 1000\n "
--> tests/ui/excessive_nesting.rs:5:5
|
5 | source = "
Expand Down
8 changes: 6 additions & 2 deletions testing/tests/ui/extends.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
error: the previous template error derives from
error: whitespace control is not allowed on `extends`
--> <source attribute>:0:2
"- extends \"whatever.html\" %}"
--> tests/ui/extends.rs:5:5
|
5 | source = r#"{%- extends "whatever.html" %}"#,
| ^^^^^^

error: the previous template error derives from
error: whitespace control is not allowed on `extends`
--> <source attribute>:0:2
" extends \"whatever.html\" -%}"
--> tests/ui/extends.rs:12:5
|
12 | source = r#"{% extends "whatever.html" -%}"#,
Expand Down
4 changes: 3 additions & 1 deletion testing/tests/ui/filter-recursion.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
error: the previous template error derives from
error: your template code is too deeply nested, or last expression is too complex
--> testing/templates/filter-recursion.html:0:255
"|A|AA|A|A|A|A|AA|A|A|A|A|AA|A|A|A|A|AA|A|A|A|A|AA|A|A|A|A|AA|A|A|A||A|A|AA|A|A|A|A|AA|A|A|A|A|AA|A|A|A|A|AA|A|A|A|A|AA|A"
--> tests/ui/filter-recursion.rs:4:12
|
4 | #[template(path = "filter-recursion.html")]
Expand Down
4 changes: 3 additions & 1 deletion testing/tests/ui/filter_block_ws.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
error: the previous template error derives from
error: failed to parse template source
--> <source attribute>:0:27
" %}\nHELLO\n{{v}}\n{%- endfilter %}"
--> tests/ui/filter_block_ws.rs:4:12
|
4 | #[template(source = "{% filter lower|indent(2) - %}
Expand Down
4 changes: 3 additions & 1 deletion testing/tests/ui/include-a-folder.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
error: the previous template error derives from
error: unable to open template file '$WORKSPACE/target/tests/trybuild/rinja_testing/templates/a_file_that_is_actually_a_folder.html': Is a directory (os error 21)
--> YouCannotIncludeFolders.txt:0:2
" include \"a_file_that_is_actually_a_folder.html\" %}"
--> tests/ui/include-a-folder.rs:4:25
|
4 | #[template(ext = "txt", source = r#"{% include "a_file_that_is_actually_a_folder.html" %}"#)]
Expand Down
Loading

0 comments on commit 2e41056

Please sign in to comment.