js_of_ocaml
js_of_ocaml copied to clipboard
[FEATURE REQUEST] Nicer pretty-printing
The output of the --pretty still looks quite dense, in particular:
- There should be spaces around all binary operators and after
,,:,),; - The last semicolon shouldn't be omitted
- The placing of
{and}is odd, e.g.:
function caml_string_notequal(s1, s2)
{return 1 - caml_string_equal(s1, s2)}
- Sometimes long expressions are printed vertically, for example in
caml_utf8_of_utf16:
(c
>=
56319
||
i
+
1
==
l
||
(d = s.charCodeAt(i + 1))
<
56320
||
d
>
57343)
And some more subjective points:
- Braces after single-statement
if,while, etc. shouldn't be omitted - Declare each variable with a
varinstead of grouping them with,(reference)