-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simpler codegen #559
Simpler codegen #559
Conversation
Codecov Report
@@ Coverage Diff @@
## master #559 +/- ##
==========================================
- Coverage 88.2% 87.98% -0.22%
==========================================
Files 95 95
Lines 2933 2855 -78
==========================================
- Hits 2587 2512 -75
+ Misses 346 343 -3
Continue to review full report at Codecov.
|
FWIW, that's much easier for me to follow, and offspring have robbed me of a fair amount of my diminishing brain power 😃. It's kinda like debugging with source maps vs without. |
Yep, feels much nicer! And a good bit less code |
Something I snuck into #525 — if an expression in a
deindent
template literal is falsy, it will a) ignore it and b) remove the preceding whitespace. This makes it much easier to write codegen code that actually resembles the output — it's far more compact and (I think) easier to follow.Have also updated
deindent
so that if an expression is an array, it gets joined (with a newline separator) automatically, reducing noise.Some of the
&&
expressions in this PR probably shouldn't be inlined the way they are, but at least this gives us a bit more flexibility to find the most readable approach.