Rich-Harris / esrap

Parse in reverse
MIT License
52 stars 3 forks source link

Groups #5

Closed Rich-Harris closed 12 months ago

Rich-Harris commented 12 months ago

This results in (IMHO) tidier output. Previously, we'd add blank lines between any statements within a body that took up multiple lines. The new algorithm is based on groups — imports are grouped, variables are grouped, and statements that require multiple lines are put in their own group. We also start a new group if we encounter a statement with leading comments.