mustache / spec

The Mustache spec.
MIT License
364 stars 71 forks source link

Try to clarify legal names #83

Closed jabley closed 10 months ago

jabley commented 9 years ago

The current definition:

The tag's content MUST be a non-whitespace character sequence NOT containing the current closing delimiter.

That would imply that {{content}} is legal, but {{ content }} is not legal.

However, later tests state “Superfluous in-tag whitespace should be ignored.” and include tests for {{ string }}.

This change attempts to make that clearer and consistent everywhere.

Possibly a BNF or similar grammar would be helpful?

groue commented 9 years ago

Is it possible to write any formal grammar, when the language has a "change delimiters tag" which has the following templates render the same: {{name}} and {{=<% %>=}}<%name%>?

Since you're in the process of implementing, I recommend you read https://github.com/mustache/spec/issues/67. When the spec falls short, at least you have a few sensible implementations to take inspiration from.

groue commented 9 years ago

(BTW, I'm not a spec maintainer, just a mustache implementor)