-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complex message start syntax is too strict #610
Comments
If we do something to fix this, we'll need to confront the problem of pattern initial whitespace. The simplest fix would be to change the ABNF to allow non-significant whitespace at the start of the message. Here's the current ABNF: message = simple-message / complex-message
simple-start-char = content-char / s / "@" / "|" And here's the modifications: message = [s] (simple-message / complex-message)
simple-start-char = content-char / "@" / "|" The primary side-effect of this change is that, if you want spaces at the start of a simple messages, you must quote the pattern. A different way to address this would be to allow optional whitespace at the start of complex-message = [s] *(declaration [s]) complex-body I think @eemeli's experience is not invalid, since we play loosely with whitespace elsewhere. I might have a slight preference for the second (lookahead) solution. Let's discuss in the 2024-01-22 call. |
I remember raising this concern multiple times, including a flavor of it in the summary it at #512 (comment) — relevant excerpt from linked comment:
And as far as I can tell, the concern was ultimately rejected, albeit without the requested explicit acknowledgment. Is it to be reconsidered? |
I also think the current .foo is a problem. Looking at the spec:
How can I say ".input is in important keyword in MF2", and render the The current solution is to wrap the whole string in At this point we can all say "I told you so!" :-) But trying to look at this with fresh eyes, I think the way we enter "complex mode" is too ... complex :-) I had a hard time to figure out from the ebnf if a message is complex or not. Compare for example with some initial marker for complex messages:
I can almost instantly see if a message is complex or not. Note: I'm not saying that's the way to go (initial marker). What I'm saying is that there are more options than trim leading spaces and quote. |
I agree it's a problem, I don't like jumping to this solution as the only one. |
In the 2024-01-22 call we agreed to place this out of scope for LDML45 and to track this issue during tech preview. I'm using the label |
Dropping the |
We resolved to accept this feedback. #854 will close. |
While working on a presentation about the JS implementation, I encountered the following error when testing some of the code I'd written for the slides:
After spending quite a while debugging the implementation code to determine the error here, I came to the conclusion that my parser was correct, the above is indeed a syntax error.
The problem with this message is that the leading whitespace before the first
.
means that it isn't special, and all of the declaration syntax parses as a valid simple pattern, up until the{{
pattern start.I mentioned this problem on our Slack channel, where @stasm was also unable to initially see the problem. I think if we can't see it, other developers won't either, and that this will become a significant stumbling block.
We should consider amending the ABNF to allow whitespace before the
.
at the beginning of a complex message.The text was updated successfully, but these errors were encountered: