Created
September 20, 2018 17:13
-
-
Save raine/b74925a1a57897bda41134b7101debfb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@{% function nuller() { return null; } %} | |
@{% function joiner(d) { return d.join(''); } %} | |
@{% const R = require('ramda'); %} | |
main -> any frame_size_candidate _ any {% R.nth(1) %} | |
frame_size_candidate -> | |
frame_size_prefix _ ":":? _ frame_size {% R.last %} | |
| frame_size_tshirt "-size"i {% R.head %} | |
| frame_size_tshirt _ "koko"i {% R.head %} | |
# | frame_size_number _ "cm"i | |
frame_size_prefix -> | |
"Rungon koko"i | |
| "Rungon koko (lisää myös otsikkoon)"i | |
| "Runko"i "koko"i:? | |
| "Rungonkoko"i _ "on"i | |
| "Runkokoko"i _ "on"i | |
| "Runko"i | |
| "Koko"i "a":? | |
| "Frame size"i | |
| "Size"i | |
frame_size -> | |
frame_size_cm {% R.head %} | |
| frame_size_tshirt {% R.head %} | |
frame_size_cm -> | |
frame_size_number {% R.pipe(R.head, x => x + 'cm') %} | |
frame_size_number -> ( | |
"4" [0-9] | |
| "5" [0-9] | |
| "6" [0-5] | |
) {% R.pipe(R.head, R.join('')) %} | |
frame_size_tshirt -> ( | |
"3XL"i | |
| "XXL"i | |
| "2XL"i | |
| "XL"i | |
| "L"i | |
| "M"i | |
| "S"i | |
| "XS"i | |
| "XXS"i | |
| "2XS"i | |
| "3XS"i | |
) {% R.pipe(R.flatten, R.head, R.toUpper) %} | |
any -> (. | "\n"):* {% nuller %} | |
_ -> [\s]:* {% function(d) {return null; } %} |
Author
raine
commented
Sep 20, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment