summaryrefslogtreecommitdiffstats
path: root/vendor/handlebars/src/grammar.pest
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:06:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:06:37 +0000
commit246f239d9f40f633160f0c18f87a20922d4e77bb (patch)
tree5a88572663584b3d4d28e5a20e10abab1be40884 /vendor/handlebars/src/grammar.pest
parentReleasing progress-linux version 1.64.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-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.pest27
1 files changed, 19 insertions, 8 deletions
diff --git a/vendor/handlebars/src/grammar.pest b/vendor/handlebars/src/grammar.pest
index 250d9d213..ac6776ee2 100644
--- a/vendor/handlebars/src/grammar.pest
+++ b/vendor/handlebars/src/grammar.pest
@@ -14,14 +14,20 @@ literal = { string_literal |
null_literal = @{ "null" ~ !symbol_char }
boolean_literal = @{ ("true"|"false") ~ !symbol_char }
-number_literal = @{ "-"? ~ ASCII_DIGIT+ ~ "."? ~ ASCII_DIGIT* ~ ("E" ~ "-"? ~ ASCII_DIGIT+)? }
-json_char = {
+number_literal = @{ "-"? ~ ASCII_DIGIT+ ~ "."? ~ ASCII_DIGIT* ~ ("E" ~ "-"? ~ ASCII_DIGIT+)? ~ !symbol_char }
+json_char_double_quote = {
!("\"" | "\\") ~ ANY
| "\\" ~ ("\"" | "\\" | "/" | "b" | "f" | "n" | "r" | "t")
| "\\" ~ ("u" ~ ASCII_HEX_DIGIT{4})
}
-string_inner = @{ json_char* }
-string_literal = ${ "\"" ~ string_inner ~ "\"" }
+json_char_single_quote = {
+ !("'" | "\\") ~ ANY
+ | "\\" ~ ("'" | "\\" | "/" | "b" | "f" | "n" | "r" | "t")
+ | "\\" ~ ("u" ~ ASCII_HEX_DIGIT{4})
+}
+string_inner_double_quote = @{ json_char_double_quote* }
+string_inner_single_quote = @{ json_char_single_quote* }
+string_literal = ${ ("\"" ~ string_inner_double_quote ~ "\"") | ("'" ~ string_inner_single_quote ~ "'") }
array_literal = { "[" ~ literal? ~ ("," ~ literal)* ~ "]" }
object_literal = { "{" ~ (string_literal ~ ":" ~ literal)?
~ ("," ~ string_literal ~ ":" ~ literal)* ~ "}" }
@@ -50,12 +56,17 @@ pro_whitespace_omitter = { "~" }
expression = { !invert_tag ~ "{{" ~ pre_whitespace_omitter? ~
((identifier ~ (hash|param)+) | name )
~ pro_whitespace_omitter? ~ "}}" }
-html_expression_triple_bracket = _{ "{{{" ~ pre_whitespace_omitter? ~
- ((identifier ~ (hash|param)+) | name ) ~
- pro_whitespace_omitter? ~ "}}}" }
+html_expression_triple_bracket_legacy = _{ "{{{" ~ pre_whitespace_omitter? ~
+ ((identifier ~ (hash|param)+) | name ) ~
+ pro_whitespace_omitter? ~ "}}}" }
+html_expression_triple_bracket = _{ "{{" ~ pre_whitespace_omitter? ~ "{" ~
+ ((identifier ~ (hash|param)+) | name ) ~
+ "}" ~ pro_whitespace_omitter? ~ "}}" }
+
amp_expression = _{ "{{" ~ pre_whitespace_omitter? ~ "&" ~ name ~
pro_whitespace_omitter? ~ "}}" }
-html_expression = { html_expression_triple_bracket | amp_expression }
+html_expression = { (html_expression_triple_bracket_legacy | html_expression_triple_bracket)
+ | amp_expression }
decorator_expression = { "{{" ~ pre_whitespace_omitter? ~ "*" ~ exp_line ~
pro_whitespace_omitter? ~ "}}" }