Skip to content
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

[FEATURE REQUEST] Nicer pretty-printing #632

Closed
copy opened this issue Nov 21, 2017 · 0 comments
Closed

[FEATURE REQUEST] Nicer pretty-printing #632

copy opened this issue Nov 21, 2017 · 0 comments

Comments

@copy
Copy link
Contributor

copy commented Nov 21, 2017

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 var instead of grouping them with , (reference)
@hhugo hhugo changed the title Nicer pretty-printing [FEATURE REQUESTNicer pretty-printing Sep 30, 2021
@hhugo hhugo changed the title [FEATURE REQUESTNicer pretty-printing [FEATURE REQUEST] Nicer pretty-printing Sep 30, 2021
@hhugo hhugo closed this as completed Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants