Skip to content

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 syntax or ABNF 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 syntax or ABNF

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEEDBACK] . can not be escaped [FEEDBACK] Isolating quoted patterns on the outside adds a lookahead to the syntax

4 participants