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.3k stars 42 forks source link

Add partial syntax, source maps, removed `Keyword` from AST and other CLI fixes #107

Closed kaleidawave closed 5 months ago

kaleidawave commented 5 months ago

Added partial syntax

Added the ability for type annotations and expression to be missing in the source. This allows the following to be valid AST (under a parse option)

const x = ;
const y = 
const z = 2

Which should allow type checking with invalid source which is vital to the LSP

Source map bindings

This adds source map generation using the positions in the output and source

image

While possible a while ago. It needed this fix https://github.com/kaleidawave/source-map/pull/1

Added printing arguments across new lines for function calling

image

WIP other structures could benefit from this. Implementation feels like it has a bit of overhead. Indent could be better handled

Still to do

kaleidawave commented 5 months ago

Hey @jasikpark you know about fuzzing! Looking at a recent naive run it is showing a mismatch

thread '<unnamed>' panicked at fuzz_targets/module_roundtrip_naive.rs:24:9:
input: `2
.A`
output1: `2.A;`

I was a little confused at first but I think input: ... is printing the input data. Is it possible to print output1 there instead? Thx in advance 🙏

kaleidawave commented 5 months ago

Really want to get ✅ on one of the fuzzing tests. While most of the time the errors are extreme edge cases, it would still be nice. Unfortunately they don't build on windows so having to do this trial and error remotely.

There also seems to be a regression in parsing performance introduced in this PR :(.

kaleidawave commented 5 months ago

Merging, will open an issue for the fuzzing tests