Closed spagy closed 7 years ago
You're right about the general rule. For now we decided to leave it up to consumers of the parse tree to enforce this condition. Do you have a suggestion how to encode this in the EBNF?
I'll make a PR and see what you think. I'll make it on the basis that a member list:
Actually, would it be better if a member list required one default?
I don't think so. We need member lists without defaults for traits which are HTML attributes:
foo = The textContent of Foo
[html/title] The title of Foo
With the old LOL Object-List (l10n?) I used to enforce this maximum-1-default policy at the stage of turning the AST into the runtime objects. Was planning to do that this time as well, but if you have a better idea, I'm all ears :)
Closing this in favor of https://github.com/projectfluent/syntax/issues/1.
Currently any and every member of a list may be marked as default. Obviously only one will actually be used as the default, so it makes sense that only marked default. I can't see any opportunity when having more than one marked would be advantageous.