Reconsider using text
for private-use
and reserved
#446
Labels
syntax
Issues related with syntax or ABNF
Is your feature request related to a problem? Please describe.
I think we should reconsider using
text
instead ofreserved-body
so that we can ensure the opacity ofprivate-use
andreserved
. This would also require modifying quoted literals to escape{
and}
. This comes from a discussion in #444 about the data-model, but also previous discussion.Here are my comments from 444:
I think this describes a bug in the syntax, where we were "clever" to smuggle in the quoted production and the whitespace production. I think the argument was something like: "if we unreserved a sigil, then it would just parse correctly". But I think we're better off if reserved and private are opaque to the ABNF. An unreserved sigil is subject to whatever ABNF is applied to it (either the existing annotation syntax or new syntax). Pre-unreserved implementations still won't parse into the sigil's space, so won't be affected.
In other words, I think we should modify the ABNF thusly:
The only escapes in text are around
{
and}
(and\
in case one needs\}
as a character sequence). Brackets retain syntactic meaning everywhere. The currentreserved-body
approach means that implementations parsereserved
andprivate-use
into word tokens and literals, even though the implementation is not allowed to interpret them. I think true opacity is the right approach. (In that case (1), (2), (3), and (4) are different character sequences).(and, yeah, we've had this discussion before in #374)
Your argument there was:
The problem then is:
quoted
allows{
and}
unescaped (because they are "quoted"). Adding these characters to the escaped list forquoted
simplifies the ABNF a tiny amount (quoted-escape and reserve-escape are the same and we lose some productions) and lets implementations parse out expressions by matching (unescaped){
/}
pairs. The cost is that{
/}
must be escaped in a literal.While fewer escapes is better than more escapes in quoted literals, I don't think that is very onerous compared to having
private-use
(reserved
scares me less, as we might never use it) be "semi-parsed". I was convinced before that the ABNF would be okay using what we have now because the character sequences could be squeezed in (that I wouldn't actually have to parse the contents). But the data model shows why I was shy in the first place:private-use
andreserved
turn out to have parsed structure where we want opacity.The text was updated successfully, but these errors were encountered: