davidbonnet / astring

🌳 Tiny and fast JavaScript code generator from an ESTree-compliant AST.
https://david.bonnet.cc/astring/demo/
MIT License
1.17k stars 57 forks source link

comment generate is very bad #711

Open janryWang opened 2 months ago

janryWang commented 2 months ago

Motivation

Describe cases that motivate the implementation of the expected behavior.

var x = (a + b /* 123*/ ) * c

Expected behavior

Describe how the feature should work.

var x = (a + b /* 123*/ ) * c

Actual behavior

var x = (a + b ) * c

Describe the actual behavior of the feature or remove this section if the feature has not been implemented yet.

davidbonnet commented 2 months ago

Relates to #562

davidbonnet commented 2 months ago

Bottom line: Astring should indeed produce comments as close as possible to the original source code.