Reason: [GoodFirstTask] Fix formatting of GADTs

Created on 19 Apr 2018  路  2Comments  路  Source: reasonml/reason

I was experimenting with some new Reason React JSX representations and I noticed that in one of the recent syntax refactorings, formatting of GADTs became very ugly:


type jsx('nature) =
  | Empty: jsx(empty)
  | Cons(elem(('s1, 'a1), 'sub1), jsx('tl)): jsx(
                                                   (('s1, 'a1) => 'sub1, 'tl),
                                                 );

This is a good first task if anyone is interested in learning the code base.

GOOD FIRST TASK BUG Printer

Most helpful comment

To new people looking to get started:

  • Claim this task if you want to work on it. Ask me or others in Discord for help if necessary.
  • Clone the Reason repo, and get it building on master. That shouldn't be hard.
  • Start by finding out what AST shape is produced by that code sample above, by running cat fileThatHasThatSample.re | refmt --parse re --print ast. (Or if you're using the esy workflow for developing, prefix the call to refmt ... like esy refmt ....
  • Start tweaking the formatting code in ./src/reason-parser/reason_pprint_ast.ml

All 2 comments

To new people looking to get started:

  • Claim this task if you want to work on it. Ask me or others in Discord for help if necessary.
  • Clone the Reason repo, and get it building on master. That shouldn't be hard.
  • Start by finding out what AST shape is produced by that code sample above, by running cat fileThatHasThatSample.re | refmt --parse re --print ast. (Or if you're using the esy workflow for developing, prefix the call to refmt ... like esy refmt ....
  • Start tweaking the formatting code in ./src/reason-parser/reason_pprint_ast.ml

I'll have a look at this

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chenglou picture chenglou  路  3Comments

chenglou picture chenglou  路  3Comments

braibant picture braibant  路  4Comments

TrakBit picture TrakBit  路  3Comments

ondrejsevcik picture ondrejsevcik  路  3Comments