forked from rinja-rs/rinja
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parser: reject closing delims that look like an op
- Loading branch information
Showing
5 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[[syntax]] | ||
name = "mwe" | ||
expr_start = "<<<" | ||
expr_end = ">>>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[[syntax]] | ||
name = "mwe" | ||
expr_start = "<<" | ||
expr_end = ">>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use rinja::Template; | ||
|
||
#[derive(Template)] | ||
#[template(source = "<<a>> and <<b>>", config = "issue-128.toml", syntax = "mwe", ext="")] | ||
struct HelloTemplate { | ||
a: u32, | ||
b: u32, | ||
} | ||
|
||
#[derive(Template)] | ||
#[template(source = "<<a>> and <<b>>", config = "issue-128-2.toml", syntax = "mwe", ext="")] | ||
struct HelloTemplate2 { | ||
a: u32, | ||
b: u32, | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error: a closing delimiter must not start with an operator: ">>" | ||
--> testing/issue-128.toml | ||
--> tests/ui/terminator-operator.rs:4:49 | ||
| | ||
4 | #[template(source = "<<a>> and <<b>>", config = "issue-128.toml", syntax = "mwe", ext="")] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: a closing delimiter must not start an with operator: ">>>" vs ">>" | ||
--> testing/issue-128-2.toml | ||
--> tests/ui/terminator-operator.rs:11:49 | ||
| | ||
11 | #[template(source = "<<a>> and <<b>>", config = "issue-128-2.toml", syntax = "mwe", ext="")] | ||
| ^^^^^^^^^^^^^^^^^^ |