Skip to content

Commit

Permalink
Add option 1a, fix mistakes in option 0
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli authored Oct 10, 2023
1 parent bf7bf00 commit c0baa8f
Showing 1 changed file with 38 additions and 4 deletions.
42 changes: 38 additions & 4 deletions exploration/beauty-contest.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ This page hosts various options for considering in the 2023-10-02 call.

## 0. Current

This is the current syntax.
This is the current syntax,
including the changes introduced in [#488](https://github.com/unicode-org/message-format-wg/pull/488).
The list of messages in this section also serves as the basis for all other examples.

```
{Hello world!}
{Hello {$user}}
input $var :function option=value
input {$var :function option=value}
{Hello {$var}}
input $var :function option=value
input {$var :function option=value}
local $foo = {$bar :function option=value}
{Hello {$var}, you have a {$foo}}
Expand All @@ -29,7 +30,7 @@ when a b { {$foo} is {$bar} }
when x y { {$foo} is {$bar} }
when * * { {$foo} is {$bar} }
input $var :function option=value local $foo = {$bar :function option=value}{Hello {$var}, you have a {$foo}}
input {$var :function option=value} local $foo = {$bar :function option=value}{Hello {$var}, you have a {$foo}}
match {$foo} {$bar} when foo bar {Hello {$foo} you have a {$var}} when * * {{$foo} hello you have a {$var}}
Expand Down Expand Up @@ -68,6 +69,39 @@ Hello {$var}, you have a {$foo}
{match {$foo :function option=value}{$bar :function option=value}}{when a b} {{ {$foo} is {$bar} }}{when x y} {{ {$foo} is {$bar} }}{when * *} {| |}{$foo} is {$bar}{| |}
```

## 1a. Invert for Text Mode, distinguish statements from placeholders

Same as 1, but non-placeholder statements use a `#` prefix.
This allows us to keep unquoted literal syntax.

```
Hello world!
Hello {$user}
{#input $var :function option=value}
Hello {$var}
{#input $var :function option=value}
{#local $foo = $bar :function option=value}
Hello {$var}, you have a {$foo}
{#match {$foo} {$bar}}
{#when foo bar} Hello {$foo} you have a {$var}
{#when * *} {$foo} hello you have a {$var}
{#match {$foo :function option=value} {$bar :function option=value}}
{#when a b} {{ {$foo} is {$bar} }}
{#when x y} {{ {$foo} is {$bar} }}
{#when * *} {| |}{$foo} is {$bar}{| |}
{#input $var :function option=value} {#local $foo = $bar :function option=value} Hello {$var}, you have a {$foo}
{#match {$foo} {$bar}} {#when foo bar} Hello {$foo} you have a {$var} {#when * *} {$foo} hello you have a {$var}
{#match {$foo :function option=value}{$bar :function option=value}} {#when a b} {{ {$foo} is {$bar} }} {#when x y} {{ {$foo} is {$bar} }} {#when * *} {| |}{$foo} is {$bar}{| |}
```

## 2. Text First, but Always Code After Code-Mode

This is @mihnita's proposal, mentioned in the 2023-10-02 call.
Expand Down

0 comments on commit c0baa8f

Please sign in to comment.