EnTerr
Roku Guru

Request: allow {"": x, "hyphen-ated": y, ".sub": z} literals

My request is simple, it fits the 60-char limit of the subject line. But in more words: please extend the implementation of hash-dictionary literals, so that string literals can be used as key names, besides identifiers. ... and it wouldn't even require documentation change, since it is mum on what is allowed as key in AA literal. 8-)

If we get BNF-y and say interpreter allows for
HashLiteral = '{' KeyValPair  (PairSeparator KeyValPair)* PairSeparator? '}'
PairSeparator = (',' | '\n') '\n'*
KeyValPair = IDENT ':' Expression

(* then change previous to *)
KeyValPair = (IDENT | STRLIT) ':' Expression

That was awfully formal. I think better will be to show requested feature in illustrative example, so here:

myForm = {
"": "form"
action: "/search/ccc"
method: "get"
"accept-charset": "utf-8"
id: "searchform"
".nodes": [
{ "": "input",
id: "query",
name: "query",
"data-suggest": "search",
autocorrect: "off",
placeholder: "search"
}
]
}
Tags (1)
0 Kudos
Community is Temporarily in Read-Only Mode!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

Thanks for your patience — we’re excited to share what’s next!