Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template parsing issues when using double angle brackets as delimiters #1081

Closed
ronnodas opened this issue Aug 13, 2024 · 1 comment · Fixed by #1095
Closed

Template parsing issues when using double angle brackets as delimiters #1081

ronnodas opened this issue Aug 13, 2024 · 1 comment · Fixed by #1095

Comments

@ronnodas
Copy link

With expr delimiters << and >>, trying to use the template <<a>> and <<b>> complains about and not being a field. Here is a full example that produces the error "no field and on type &HelloTemplate":

[[syntax]]
name = "mwe"
expr_start = "<<"
expr_end = ">>"
#[derive(Template)]
#[template(source = "<<a>> and <<b>>", syntax = "mwe", ext="")]
struct HelloTemplate {
    a: u32,
    b: u32,
}

Maybe worse, using (<<a>> and) <<b>> as the template produces "failed to parse template source".

#[derive(Template)]
#[template(source = "(<<a>> and) <<b>>", syntax = "mwe", ext = "")]
struct HelloTemplate {
    a: u32,
    b: u32,
}

Everything works fine if the delimiters are changed to eg <! and !>. I have not experimented with other pairs.

@djc
Copy link
Collaborator

djc commented Sep 19, 2024

Thanks for the report, and sorry for the long delay -- fixing this in #1095.

@djc djc closed this as completed in #1095 Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants