-
-
Notifications
You must be signed in to change notification settings - Fork 38
Some red flags with the current grammar for reserved-statement #635
Copy link
Copy link
Closed
Labels
Preview-FeedbackFeedback gathered during the technical previewFeedback gathered during the technical previewresolve-candidateThis issue appears to have been answered or resolved, and may be closed soon.This issue appears to have been answered or resolved, and may be closed soon.syntaxIssues related with syntax or ABNFIssues related with syntax or ABNF
Description
Reserved statements:
reserved-statement = reserved-keyword [s reserved-body] 1*([s] expression)
reserved-keyword = "." name
reserved-body = *([s] 1*(reserved-char / reserved-escape / quoted))
reserved-char = content-char / "."
If I read this correctly, then these strings are valid:
// reserved-keyword reserved-body expression
.foo
.foo . {$baz}
.foo .... {$baz}
.foo .bar {$baz}
Do we really want to allow '.' in the reserved body?
Escaped text:
text-escape = backslash ( backslash / "{" / "}" )
quoted-escape = backslash ( backslash / "|" )
reserved-escape = backslash ( backslash / "{" / "|" / "}" )
To me this looks like a red flag.
Not only for the implementers of a parser, but also for the users of the final syntax.
In most cases escaped strings can be handled pretty low level (tokenizer).
But in this case knowing that we can now accept reserved-escape we need a lot of context.
And that allows us to support strings like this:
.foo .\{\|\} {$baz}
So I find the reserved-statement to be too lax.
Or I am reading the grammar wrong?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Preview-FeedbackFeedback gathered during the technical previewFeedback gathered during the technical previewresolve-candidateThis issue appears to have been answered or resolved, and may be closed soon.This issue appears to have been answered or resolved, and may be closed soon.syntaxIssues related with syntax or ABNFIssues related with syntax or ABNF