kaleidawave / ezno

A JavaScript compiler and TypeScript checker written in Rust with a focus on static analysis and runtime performance
https://kaleidawave.github.io/posts/introducing-ezno/
MIT License
2.44k stars 45 forks source link

Parse error with comment in object literal #96

Closed coderaiser closed 3 months ago

coderaiser commented 9 months ago

Strange error for this code:

image

kaleidawave commented 9 months ago

Looks like a parser bug.

Comments are tokenised and then some should be stored in the AST for hover information etc but there are some edge cases ATM.

Will take a look when I have some free time. Or expose the option where the parser skips comments

kaleidawave commented 9 months ago

Given a few lines below there is a async function, which it currently doesn't work in Ezno. It might be a while before you can check that file.

kaleidawave commented 3 months ago

In some recent version, ObjectLiteralMember::Comment has been added. So this parses now with all comments on

image

Additionally when used in the checker, the parser doesn't parse comments that aren't doc comments etc

async still isn't properly supported so that file still won't type check correctly. But the parse error is fixed!