Rich-Harris / esrap

Parse in reverse
MIT License
54 stars 4 forks source link

Groups #5

Closed Rich-Harris closed 1 year ago

Rich-Harris commented 1 year 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.