diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:37 +0000 |
commit | 246f239d9f40f633160f0c18f87a20922d4e77bb (patch) | |
tree | 5a88572663584b3d4d28e5a20e10abab1be40884 /vendor/handlebars/src/grammar.rs | |
parent | Releasing progress-linux version 1.64.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-246f239d9f40f633160f0c18f87a20922d4e77bb.tar.xz rustc-246f239d9f40f633160f0c18f87a20922d4e77bb.zip |
Merging debian version 1.65.0+dfsg1-2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | vendor/handlebars/src/grammar.rs | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/vendor/handlebars/src/grammar.rs b/vendor/handlebars/src/grammar.rs index 1fd292ce1..6e61cd4e4 100644 --- a/vendor/handlebars/src/grammar.rs +++ b/vendor/handlebars/src/grammar.rs @@ -4,26 +4,6 @@ #[grammar = "grammar.pest"] pub struct HandlebarsParser; -#[inline] -pub(crate) fn whitespace_matcher(c: char) -> bool { - c == ' ' || c == '\t' -} - -#[inline] -pub(crate) fn newline_matcher(c: char) -> bool { - c == '\n' || c == '\r' -} - -pub(crate) fn ends_with_empty_line(text: &str) -> bool { - text.trim_end_matches(whitespace_matcher) - .ends_with(newline_matcher) -} - -pub(crate) fn starts_with_empty_line(text: &str) -> bool { - text.trim_start_matches(whitespace_matcher) - .starts_with(newline_matcher) -} - #[cfg(test)] mod test { use super::{HandlebarsParser, Rule}; @@ -191,6 +171,7 @@ mod test { "{{exp 1}}", "{{exp \"literal\"}}", "{{exp \"literal with space\"}}", + "{{exp 'literal with space'}}", r#"{{exp "literal with escape \\\\"}}"#, "{{exp ref}}", "{{exp (sub)}}", @@ -199,6 +180,8 @@ mod test { "{{exp {}}}", "{{exp key=1}}", "{{exp key=ref}}", + "{{exp key='literal with space'}}", + "{{exp key=\"literal with space\"}}", "{{exp key=(sub)}}", "{{exp key=(sub 0)}}", "{{exp key=(sub 0 key=1)}}", @@ -225,6 +208,12 @@ mod test { "{{&html}}", "{{{html 1}}}", "{{{html p=true}}}", + "{{{~ html}}}", + "{{{html ~}}}", + "{{{~ html ~}}}", + "{{~{ html }~}}", + "{{~{ html }}}", + "{{{ html }~}}", ]; for i in s.iter() { assert_rule!(Rule::html_expression, i); |