diff --git a/spec/syntax.md b/spec/syntax.md index a4f0b3bb2..3376f65e2 100644 --- a/spec/syntax.md +++ b/spec/syntax.md @@ -943,6 +943,16 @@ escaped-char = backslash ( backslash / "{" / "|" / "}" ) backslash = %x5C ; U+005C REVERSE SOLIDUS "\" ``` +> [!NOTE] +> The `escaped-char` rule allows escaping some characters in places where +> they do not need to be escaped, such as braces in a _quoted_ _literal_. +> For example, `|foo {bar}|` and `|foo \{bar\}|` are synonymous. + +When writing or generating a _message_, escape sequences SHOULD NOT be used +unless required by the syntax. +That is, inside _literals_ only escape `|` +and inside _patterns_ only escape `{` and `}`. + ### Whitespace **_Whitespace_** is defined as one or more of