Open jasikpark opened 3 days ago
Another example I think:
input: `while (class e extends async function({ [(/a/d)] : d }) {} {}) {
}
`
output1: `while (class e extends async function ({ [/a/d]: d }) {} {}) {}
`
This parse should not error because it was just parsed above.
error: `ParseError { reason: "Expected identifier at variable reference, found Divide", position: 42..43 }`
sounds like the actual JS is a bit angry at runtime, since the async fn doesn't count as a constructor, but I think it's syntactically correct. The printed version (output1) is also close to what biome and prettier output.
this seems relevant
Sounds like
needs to allow regex as a name for variables, or there's a bug somewhere where it initially thinks it can permit regex as names for variables
https://github.com/kaleidawave/ezno/blob/245d530049518955b3396a5216ab14957a2d4522/parser/fuzz/fuzz_targets/module_roundtrip_structured.rs#L31-L35 strikes again.
It looks like the parse and print removes the parentheses from the do statement, which causes Ezno to interpret the first
/
as a "divide" statement.Biome Playground of
input
: https://biomejs.dev/playground/?code=ZABvACAAKAAvAGEALwBkACkAOwAgAHcAaABpAGwAZQAgACgAdABoAGkAcwApADsACgA%3DBiome Playground of
output1
: https://biomejs.dev/playground/?code=ZABvACAALwBhAC8AZAA7ACAAdwBoAGkAbABlACAAKAB0AGgAaQBzACkAOwAKAA%3D%3D