syntax
syntax copied to clipboard
ReScript's syntax as a standalone repo.
Here is some code from my ReasonML project: ``` let f = input => switch (input) { | Some(value) => if (someCondition(value)) { "\t"; } else if (someOtherCondition(value)) { "\n";...
``` external useUpdateAtom: (t) => (. 'value) => unit = "useUpdateAtom" ``` is formatted into ``` external useUpdateAtom: (t, . 'value) => unit = "useUpdateAtom" ```
https://rescript-lang.org/try?code=DYUwLgBARsCGEF4IAoB0FYEpED4VWwT2VgBppMg ```rescript let bla = (. a) => (b) => (a, b) ``` is being formatted to ```rescript let bla = (. a, b) => (a, b) ``` Which is...
It was discussed before but I am afraid that adding this later might introduce a breaking change. So making an issue here so the choice can be made to implement...
Implement parsing of operator tokens for value bindings and value description without escaping.
https://forum.rescript-lang.org/t/weird-auto-code-formatting-with-pipe-first-operator/1189 > Here is an example. ```rescript let foo = (fn, value) => fn(value) let bar = (value, fn) => fn(value) ``` > Two simple functions…one takes a function and...
https://forum.rescript-lang.org/t/weird-auto-code-formatting-with-pipe-first-operator/1189 ``` let myPromise = Js.Promise.make((~resolve, ~reject) => resolve(. 2)) myPromise->Js.Promise.then_(value => { Js.log(value) Js.Promise.resolve(value + 2) }, _)->Js.Promise.then_(value => { Js.log(value) Js.Promise.resolve(value + 3) }, _)->Js.Promise.catch(err => { Js.log2("Failure!!",...
Like this ``` @react.component let make = React.forwardRef((~id: option=?, ~className: option=?, // Remove me to fix the problem ~children: option=?, forwardedRef) => { }) ``` Try it out here https://rescript-lang.org/try?code=AIJwpghgxgLgdFA9gWwA6IHZgzAUAGzBgAJkIBrMYgXmICVJY4AzREAdwhABMHmAKfgD8AltwBcxRKhgjMAHgDOMECIwBzAHzUA-ABpcQqPgiLFAOQjIwk6bIXLVG7ftwB6N-TDJEANyrWxDCIxMwiAB5BABZUqCCIAEaEyIZQUSL43OAYtjJyGPIM0PBgydgwLgasHFzcYLxgzACUNJrEAN64xMTy3CK+xG6auAC+TbhAA
- needs more comments - comment interleaving needs to be explained - it's unclear the division between multi_printer and driver. And the api for printer (multi_printer.print) vs parser (napkin_driver.print_implementation, print_interface)...