-
Notifications
You must be signed in to change notification settings - Fork 430
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
Support conditional compilation / static if #1359
Comments
https://github.com/mcclure/ppx_const may be a good start. It may need to be updated to use omp and friends. |
note bucklescript support of conditional compilation is baked in, the |
Bucklescript solves this very elegantly in lexing. |
@hcarty's suggestion seems like the easiest and sanest for now |
@IwanKaramazow @jordwalke It seems like refmt doesn't support the syntax for https://github.com/janestreet/ppx_optcomp. Do you know how we'd write that syntax https://github.com/mcclure/ppx_const in Reason? I couldn't find something that refmts. EDIT: This works for the first link :)
|
we need "Support conditional compilation / static if" in reason which is baked in! @chenglou could you have a plan to support it? |
@bsansouci how to use https://github.com/mcclure/ppx_const in reason? could you give me suggestion? |
@yyc-git Hey, right now the only way to use ppx_const would be to depend on it on opam.
to get the right version of the compiler then add I'm not 100% sure it'll work though, I have not tried it. EDIT: ping me on discord if you want to chat. I can help better in real time. |
@bsansouci Thanks for your reply! |
@yyc-git Hey I just landed a change in bsb-native that should allow you to use matchenv. See https://github.com/Schmavery/reprocessing/blob/master/src/Reprocessing_Hotreload.re for the syntax and all. |
@bsansouci Thankes a lot. Is Bsb(js backend) support it? I need it in js backbend anyway. |
Yes, bsb-native is 100% compatible with bsb. Just small extensions to support compiling to bytecode/native :) |
@bsansouci Good job~ now I'm using Reason 3, which require bsb 2.0. so does bsb-native support reason3? support bsb 2.0? |
Yup bsb-Native supports reason 3 :) |
Hey everyone :D
I saw that Bucklescript has support for condition compilation but it's a preprocessor fed into
-pp
, which means we can't use it in conjuction with Reason (since refmt is also a preprocessor).How could we support static if statement like Bucklescript does?
It would help the cross platform story a lot in my opinion!
The text was updated successfully, but these errors were encountered: