From d173ffdf9987c287798186b503af606b872e0fcc Mon Sep 17 00:00:00 2001 From: Eemeli Aro Date: Sat, 2 Sep 2023 12:40:43 +0300 Subject: [PATCH] Explain why we use | and not " and/or ' --- spec/syntax.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/syntax.md b/spec/syntax.md index 099d5a4696..716c9690c6 100644 --- a/spec/syntax.md +++ b/spec/syntax.md @@ -596,6 +596,15 @@ A **_quoted_** literal begins and ends with U+005E VERTICAL BAR `|`. The characters `\` and `|` within a _quoted_ literal MUST be escaped as `\\` and `\|`. +The `|` is used as a quote delimiter +because it is not commonly used as a quote delimiter. +Using something more ordinary like `'` or `"` +would mean that they would need to be escaped +if MessageFormat 2 syntax needed to be included in a resource format +that used the same quote delimiter. +Supporting both `'` and `"` as quote delimiters would potentially require +the delimiters to be manually escaped when copying them between resource formats. + An **_unquoted_** literal is a _literal_ that does not require the `|` quotes around it to be distinct from the rest of the _message_ syntax. An _unquoted_ MAY be used when the content of the _literal_