Skip to content

Implement hash and array literal syntax - #15

Merged
wycats merged 1 commit into
masterfrom
feature/array-and-hash-literals
Oct 25, 2024
Merged

wycats merged 1 commit into
masterfrom
feature/array-and-hash-literals

Conversation

@wycats

@wycats wycats commented Oct 24, 2024

Copy link
Copy Markdown
Contributor

This is an initial implementation of array and hash literals.

Of note:

  • The hash literal syntaxes ((key1=value1 key2=value2) and {{key1=value1 key2=value2}}) are currently syntax errors, so they can be added without breaking changes or any form of opt-in.
  • The array literal syntax ([a b c]) is ambiguous with the this-less escaped property path ([a b] currently means this.[a b], which translates to this["a b"] in JavaScript).

The latter form is disallowed in Ember, which does not support the implicit this form.

To avoid breaking existing consumers, this PR makes the array-literal syntax opt-in via a parser option.

@wycats
wycats merged commit a095229 into master Oct 25, 2024
@wycats
wycats deleted the feature/array-and-hash-literals branch October 25, 2024 05:29
@github-actions github-actions Bot mentioned this pull request Mar 19, 2025
@NullVoxPopuli NullVoxPopuli added the enhancement New feature or request label Mar 19, 2025
theodorejb added a commit to devtheorem/php-handlebars-parser that referenced this pull request Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants