Skip to content

Change open/close from function to expression #466

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions spec/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -412,32 +412,32 @@ what _options_ and _option_ values are valid,
and what outputs might result.
See [function registry](./) for more information.

_Functions_ can be _standalone_, or can be an _opening element_ or _closing element_.
_Expressions_ can be _standalone_, or can be an _opening element_ or _closing element_.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I were to make this change, I would make "element" into expression too:

Suggested change
_Expressions_ can be _standalone_, or can be an _opening element_ or _closing element_.
An _Expression_ can be _standalone_, or can be an _opening expression_ or _closing expression_.


A **_<dfn>standalone</dfn>_** _function_ is not expected to be paired with another _function_.
An **_<dfn>opening element</dfn>_** is a _function_ that SHOULD be paired with a _closing element_.
A **_<dfn>closing element</dfn>_** is a _function_ that SHOULD be paired with an _opening element_.
A **_<dfn>standalone</dfn>_** _expression_ is not expected to be paired with another _expression_.
An **_<dfn>opening element</dfn>_** is a _expression_ that SHOULD be paired with a _closing element_.
A **_<dfn>closing element</dfn>_** is a _expression_ that SHOULD be paired with an _opening element_.
Comment on lines +418 to +419
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and I would do that globally...


An _opening element_ MAY be present in a message without a corresponding _closing element_,
and vice versa.

> A _message_ with a _standalone_ _function_ operating on the _variable_ `$now`:
> A _message_ with a _standalone_ _expression_ operating on the _variable_ `$now`:
>
> ```
> {{$now :datetime}}
> ```
>
> A _message_ with two markup-like _functions_, `button` and `link`,
> A _message_ with two markup-like _expressions_, `button` and `link`,
> which the runtime can use to construct a document tree structure for a UI framework:
>
> ```
> {{+button}Submit{-button} or {+link}cancel{-link}.}
> {{button +html}Submit{button -html} or {link +html}cancel{link -html}.}
Comment on lines +430 to +434
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a metacomment rather than one on this particular change.

I tend to want the examples in our spec to be valid functions in the function registry or to be clearly from the "foo" family of example markup. If we don't provide HTML functions in the default registry or an optional extended registry, I'd prefer to use examples that are suggestive but not real. The original example did that better than providing the +html markup.

I do see that you want to show functions with operands, so perhaps consider examples.

> ```

A _function_ consists of a prefix sigil followed by a _name_.
The following sigils are used for _functions_:

- `:` for a _standalone_ function
- `:` for a _standalone_ expression
- `+` for an _opening element_
- `-` for a _closing element_
Comment on lines +440 to 442
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expressions here too


Expand Down