Experimental preprocessor using existing parsers
See original GitHub issueIn the past day, I’ve put a small proof of concept of a refactor of this project to reuse the Svelte & Windi parsers. You can find it here grenierdev/svelte-windicss-preprocess.
<div class="min-h-screen bg-gray-100" />
stays
<div class="min-h-screen bg-gray-100" />
<div class="bg-white font-light sm:hover:(bg-gray-100 font-medium)" />
becomes
<div class="bg-white font-light sm:hover:bg-gray-100 sm:hover:font-medium" />
<div class="flex px-{a} lg:px-{b}" />
becomes
<div class="flex px-{a} lg:px-{b}" />
^---------^------------------------- intact, author will need to add style
manually for all possible values of {a}
and {b}
<div class="bg-white font-light sm:hover:(bg-gray-{b} font-medium)" />
becomes
<div class="bg-white font-light sm:hover:bg-gray-{b} sm:hover:font-medium" />
^------ intact, author will need to add style
manually for all possible values of {b}
<div class={`px-3 py-${c + 2 - 10} sm:(text-gray-${d} text-sm font-medium)`} />
becomes
<div class={`px-3 py-${c + 2 - 10} sm:text-gray-${d} sm:text-sm sm:font-medium`} />
^--------------------------^------- intact, author will need to add style
manually for all possible values of
{c + 2 - 10} and {d}
All of which could be passed to something described in https://github.com/windicss/svelte-windicss-preprocess/issues/35#issuecomment-790940288 (using WindiCSS at runtime).
Still just a proof of concept and does not yet cover all the features, namely the class directive.
Could be worth discussing?
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Parsing All of C by Taming the Preprocessor
and 520,000 macros for code expansion. In this paper, we present a new tool for parsing all of C, in- cluding arbitrary preprocessor...
Read more >Parsing Combinatory Categorial Grammar with Answer Set ...
In this work we propose and implement a new approach to CCG parsing that relies on a prominent knowledge representation formalism, answer set ......
Read more >The application of JavaCC to develop a C/C++ preprocessor
used to generate parsers in Java. With JavaCC, we developed a universal C/C++ preprocessor. which runs on any computer platform with a Java ......
Read more >Better Binarization for the CKY Parsing - ACL Anthology
Therefore we propose a novel binariza- tion method utilizing rich information learnt from training corpus (Section 5). Experimental results show that our ...
Read more >Training a Parser for Machine Translation Reordering
We present experiments on translation from English to three Subject-Object-. Verb (SOV) languages,1 because those require ex- tensive syntactic reordering to ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We have to evaluate all trade-offs in detail, before doing changes in that scale. I will look into your prototype in more detail during the weekend. I still think a combination of both would be the best fit here, but I will check!
I’ve wrap the whole
markup
function withconsole.time/timeEnd
.On my simple project, here are the timings
I did the same with v3.0.0-beta.1
I’m running this on Win10 with a 24cpu/32Gb ram on a M.2 SSD 6Gbps, node v14.15.0.