Skip to content
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

Require at least one keyword for complex messages #841

Closed
wants to merge 1 commit into from

Conversation

eemeli
Copy link
Collaborator

@eemeli eemeli commented Jul 29, 2024

Fixes #787
Fixes #837

We currently allow complex messages to start with {{, so hello and {{hello}} mean the exact same thing. As identified in #787, when we add bidi isolation to the syntax (#811), this will mean that each of the following will be valid sequences starting a complex message:

  • .
  • {{
  • LRI{{ or {LRI{
  • RLI{{ or {RLI{
  • FSI{{ or {FSI{

where LRI, RLI, and FSI represent the U+2066..U+2068 characters.

This seems like a lot, esp. when the only reason why a complex message must be valid even if it has no keywords is to allow for messages like {{.zip}}, i.e. ones starting with a literal ..

If we were to instead allow for \. as an escape, we could require complex messages to start with a keyword, and then the set of valid sequences starting a complex message reduces to only:

  • .

@eemeli eemeli added the syntax Issues related with MF Syntax label Jul 29, 2024
@aphillips
Copy link
Member

@eemeli We have design documents discussing these problems and technical discussions scheduled (including today's [2024-07-29] call). Please don't file additional PRs while we're discussing the design.

@lucacasonato
Copy link
Contributor

For the record, I am relatively strongly against this. It makes refactoring from simple -> complex message more annoying, as you have to transition through an invalid / confusing state:


Hello, World!

Renders as Hello, World!


{{Hello, World!}}

Renders as {{Hello, World!}}


.local $foo = {1}
{{Hello, World!}}

Renders as Hello, World!

@eemeli
Copy link
Collaborator Author

eemeli commented Sep 7, 2024

Giving up on this one; not worth the fight.

@eemeli eemeli closed this Sep 7, 2024
@eemeli eemeli deleted the require-complex-keywords branch September 7, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
syntax Issues related with MF Syntax
Projects
None yet
3 participants