Skip to content

Commit

Permalink
Narrowed parsing of structure refinements to avoid conflicting with s…
Browse files Browse the repository at this point in the history
…preads in lists.
  • Loading branch information
amyjko committed Mar 2, 2024
1 parent c6ff7d6 commit 44e575c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Dates are in `YYYY-MM-DD` format and versions are in [semantic versioning](http:
- Disabled automatic pretty printing.
- Fixed list spread doc example.
- Better unused bind conflict message.
- Narrowed parsing of structure refinements to avoid conflicting with spreads in lists.

## 0.9.34 2024-02-24

Expand Down
6 changes: 5 additions & 1 deletion src/parser/parseExpression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,11 @@ function parsePropertyReference(left: Expression, tokens: Tokens): Expression {
);

// If there's a bind symbol next, then parse a PropertyBind
if (left instanceof PropertyReference && tokens.nextIs(Sym.Bind)) {
if (
left instanceof PropertyReference &&
tokens.nextIs(Sym.Bind) &&
tokens.nextLacksPrecedingSpace()
) {
const bind = tokens.read(Sym.Bind);
const value = parseExpression(tokens);

Expand Down

0 comments on commit 44e575c

Please sign in to comment.