jwacs icon indicating copy to clipboard operation
jwacs copied to clipboard

[WIP] fixes and npm testing

Open bendlas opened this issue 7 years ago • 2 comments

Hi, I've stumbled over your project, when looking for .. well, a CPS transformer for javascript, that does what it should. It's pretty impressive, congrats!

I tried to apply it to some JS, I've got laying around and quickly found some lexer and parser bugs:

  • 'integer' with exponent
  • an incomplete regex workaround, that I replaced with the approach found here: https://github.com/antlr/grammars-v4/blob/3b25fdc6dc6a2ea74c000406e2439fdc1d2f64e7/ecmascript/JavaScript/ECMAScript.g4#L108
  • semicolon insertion for break as last block element

Each of the above fixes is rather simple, but WIP in the sense, that the parser fixes should probably be fixed in the descriptor file, right? I hope you can help there.

After those fixes, that made my 2.4M minified JS file parse (correctly?), I ran into two missing CPS transformations: breaks in labelled statement-blocks and (obviously) finally.

I implemented labelled blocks, but before trying finally (ha), I'd like to have (possibly generative) side-by-side testing in nodejs. The initial thing looks promising (see last commit), but I'll probably have to leave it for some time and come back later ..

I'll comment some more on the specific commits, feel free to leave feedback and request changes ..

bendlas avatar Jun 11 '18 23:06 bendlas

Hi Herwig,

Thanks, this is all awesome! I will try to get to look at the changes as soon as possible. Fair warning, this is code I wrote ten years ago and I am in the middle of getting ready for a transcontinental move and major job change, so it won't happen overnight. :)

chumsley avatar Jun 13 '18 15:06 chumsley

Hi James,

Great, I'd love to hear your feedback!

No worries about timing, I'm used to other people's timelines in open source and already more than happy, you answered & are interested.

Best of fortune for your travels!

bendlas avatar Jun 14 '18 00:06 bendlas