TyrealHu / acorn-typescript

Alternative, TypeScript parser
https://www.npmjs.com/package/acorn-typescript?activeTab=readme
MIT License
145 stars 18 forks source link

Can't parse `foo! += 1` #64

Open paoloricciuti opened 1 month ago

paoloricciuti commented 1 month ago

If i try to parse the expression in the title i get an error despite it being a valid typescript syntax.

Syntax:

let foo: number | null  = 1;
foo! += 1;

Error:

Error: Assigning to rvalue (3:0)

Repo: link

Related issue:

https://github.com/sveltejs/svelte/issues/13409

We are using acorn-typescript in svelte to parse typescript scripts and this bug was reported.