SIGN IN SIGN UP
sveltejs / svelte UNCLAIMED

web development for the rest of us

0 0 25 JavaScript

chore: simplify parser (#18077)

small tidy-up spurred by #17954 — rather than try-catching every
`parse_expression_at` call and passing the error to
`parser.acorn_error`, we can handle the error locally and get rid of
that method

### Before submitting the PR, please make sure you do the following

- [ ] It's really useful if your PR references an issue where it is
discussed ahead of time. In many cases, features are absent for a
reason. For large changes, please create an RFC:
https://github.com/sveltejs/rfcs
- [x] Prefix your PR title with `feat:`, `fix:`, `chore:`, or `docs:`.
- [x] This message body should clearly illustrate what problems it
solves.
- [ ] Ideally, include a test that fails without this PR but passes with
it.
- [ ] If this PR changes code within `packages/svelte/src`, add a
changeset (`npx changeset`).

### Tests and linting

- [x] Run the tests with `pnpm test` and lint the project with `pnpm
lint`

---------

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
R
Rich Harris committed
6b653b8d17c80b16659c5238875977f0941490c2
Parent: 8966601
Committed by GitHub <noreply@github.com> on 4/7/2026, 7:06:21 PM