You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for making an awesome crate. This is my favorite Rust template library by a mile.
When writing relatively large templates, I occasionally make mistakes in the template syntax and I get a lexer error like this one:
error: Failed to compile template.
caused by: Rust Syntax Error (lex error)
file: /home/lev/Projects/dashboard/templates/model.html
#[derive(TemplateOnce)]
note: this error originates in the derive macro `TemplateOnce` (in Nightly builds, run with -Z macro-backtrace for more info)
Unfortunately, it doesn't tell me which line number the error is on, so it's pretty difficult to debug. Is it possible to count line numbers when parsing and report the line number accordingly?
Thank you.
The text was updated successfully, but these errors were encountered:
use sailfish::TemplateOnce;
#[derive(TemplateOnce)]
#[template(path = "example.html")]
pub struct Example {
title: String,
}
templates/example.html
<html>
<head><%= title %></head>
</html>
<% if { non_ %>
$ cargo build
Compiling example v0.1.0 (/home/lev/code/example)
error: Failed to compile template.
caused by: Rust Syntax Error (lex error)
file: /home/lev/code/example/templates/example.html
--> src/main.rs:3:10
|
3 | #[derive(TemplateOnce)]
| ^^^^^^^^^^^^
|
= note: this error originates in the derive macro `TemplateOnce` (in Nightly builds, run with -Z macro-backtrace for more info)
error: could not compile `example` due to previous error
Hi,
Thank you for making an awesome crate. This is my favorite Rust template library by a mile.
When writing relatively large templates, I occasionally make mistakes in the template syntax and I get a lexer error like this one:
Unfortunately, it doesn't tell me which line number the error is on, so it's pretty difficult to debug. Is it possible to count line numbers when parsing and report the line number accordingly?
Thank you.
The text was updated successfully, but these errors were encountered: