Commit Graph

782 Commits (420eac889e337c1b30a239bf57ca6a9f9eb0790b)

Author SHA1 Message Date
Lennart Spitzner 434854f8f3
Merge pull request #259 from eborden/datadecl
Data declaration for newtype and records
2019-12-09 22:46:03 +01:00
Lennart Spitzner 00c6854887 Fix two minor data-decl layouting issues 2019-12-09 22:35:26 +01:00
Lennart Spitzner a1282c3ac6 Add a testcase for the last commit 2019-12-09 11:22:43 -07:00
Lennart Spitzner 3fbbf3d661 Fix one misplaced comment bug on data decls 2019-12-09 11:22:43 -07:00
Lennart Spitzner 6c3d9c57c5 Comment the single-line record decl config flag out 2019-12-09 11:22:43 -07:00
Lennart Spitzner 5a49277eba Improve data decl layouting
- Fix bug in BackendUtil/lowest level of brittany about
  alignment being ignored after a comment,
- Properly layout large (more than single-line) types in
  record fields and in data decl rhs arguments,
- Properly layout data decl constructors with large "heads"
  (forall, constraints),
- Add a config flag to control single-line layout of record
  definition,
2019-12-09 11:20:28 -07:00
Evan Rutledge Borden 80f370a8e1 Support nullary data types
Add tests for nullary prefix data types and nullary record data types.
2019-12-09 11:17:32 -07:00
Lennart Spitzner 0381b9fe24 Fix record field comment indentation 2019-12-09 11:17:32 -07:00
Lennart Spitzner c367b1017b Fixup src-literatetests/Main formatting 2019-12-09 11:17:32 -07:00
Evan Rutledge Borden 9494d6203a Allow multi line formatting of normal records
Only single line formatting of normal records was being supported. For
records with long names we need multi line formatting. This also needs
to support both multi and left indentation policies.
2019-12-09 11:17:32 -07:00
Lennart Spitzner a23ef696e8 Fix test failure: DerivingStrategies exists since ghc-8.2 2019-12-09 11:17:32 -07:00
Lennart Spitzner 54f34344b3 Implement #min-ghc keyword for test script 2019-12-09 11:17:32 -07:00
Lennart Spitzner 48490a7110 Fix handling of comment before data-decl
`docWrapNodePrior` caused duplication of offset of `data` keyword
and of comments connected to it.
2019-12-09 11:17:31 -07:00
Evan Rutledge Borden ea9d3bb5b3 Add stack lock file for 8.0.2 2019-12-09 11:17:31 -07:00
Evan Rutledge Borden b2f4262749 Isolate deriving via test 2019-12-09 11:17:31 -07:00
Evan Rutledge Borden aeaa043e99 Support building DataDecl with 8.0.2 2019-12-09 11:17:31 -07:00
Evan Rutledge Borden 9971e3905d Support building DataDecl with 8.2.2 2019-12-09 11:17:31 -07:00
Evan Rutledge Borden dee63517ba Include stack lock files 2019-12-09 11:17:31 -07:00
Evan Rutledge Borden 868b8c61e3 Add a Makefile for easy testing many version
The `Makefile` includes `stack test` configurations to support building
versions of `brittany` with supported versions of `ghc`. Each version
uses a separate `.stack-work` directory to allow minimal compilation on
each change.
2019-12-09 11:17:31 -07:00
Lennart Spitzner 2f6967b7b8 Support comments in record data decls 2019-12-09 11:17:31 -07:00
Lennart Spitzner d21ecf89e6 Fix a comment bug in tuple-type layouting 2019-12-09 11:17:31 -07:00
Lennart Spitzner 208a1ceadb Start making datadecls work with ghc-8.4 2019-12-09 11:17:31 -07:00
Evan Rutledge Borden 57ba88a73c Work-in-progress add record declaration layout
Simple records are supports. The tests cover:

- single records
- multi-field types
- columnized alignment
- basic deriving
- deriving strategies
- existential quanitification

A few items block merger

- retaining comments

A few items can be deferred:

- normal types
- sum types
2019-12-09 11:17:31 -07:00
Lennart Spitzner 4f827491da Work-in-progress commit (deriving clause..) 2019-12-09 11:17:31 -07:00
Lennart Spitzner 172866755c Start impl. layouting for datatypes (#12)
Only newtypes work for now; the "interesting" data records
are not touched yet.

Comment insertion not really considered yet; probably needs work.
2019-12-09 11:17:31 -07:00
Lennart Spitzner f8892d41d4 Bump to 0.12.1.1; Update changelog 2019-12-09 13:38:26 +01:00
Lennart Spitzner e24271318d Improve record-expression layouting
- Finish consolidation, clearing a TODO
- Fix two comment placement issues around record wildcards
- Fix regression in brittany-0.12 about layouting large
  (multiline) record field updates
2019-12-05 14:30:50 +01:00
Lennart Spitzner f87c0c64b8 Implement experimental semicolon-into-newlines feature 2019-12-04 13:55:41 +01:00
Lennart Spitzner 77d6d5b553 Fix roundtripping of (~) constraint/type 2019-11-27 22:21:16 +01:00
Lennart Spitzner 41750dc8a8 Add doc chapter on exactprinting, plus minor doc fixups 2019-11-18 11:26:18 +01:00
Lennart Spitzner 974826f98f Fix whitespace regression on forall+constraint type sig 2019-11-08 12:11:35 +01:00
Lennart Spitzner 9d0669d6a6 Fix typo in ChangeLog.md 2019-11-08 12:07:41 +01:00
Lennart Spitzner 38f77f6c5e Update stack.yaml to allow compilation with ghc-8.8 2019-09-29 23:24:29 +02:00
Lennart Spitzner 17055479d3 Try fixing CI, ghc-8.8 seems to use more heap 2019-09-29 23:24:05 +02:00
Lennart Spitzner 89b7655bac Fix support for ghc-8.8 2019-09-29 21:45:46 +02:00
Lennart Spitzner 3482f6a36d Bump semigroups dependency bound 2019-09-29 18:24:13 +02:00
Lennart Spitzner b656b8cc27 Bump to 0.12.1.0; Update changelog 2019-09-29 18:19:48 +02:00
Lennart Spitzner a98d643a62 Disable perf test by default via new cabal flag 2019-09-29 14:08:27 +02:00
Lennart Spitzner 0795a39806 Fix infix matches with more than 2 args, fixes #219 2019-09-19 00:48:59 +02:00
Lennart Spitzner 6879436e67 Fix lambdas with lazy/bang pattern as first argument 2019-09-03 01:10:38 +02:00
Lennart Spitzner 702b993dab Fix prefix operator pattern-match invalid result 2019-09-03 00:23:58 +02:00
Lennart Spitzner 8861f16624 Fix comment handling with let-in 2019-09-02 17:04:44 +02:00
Lennart Spitzner 670b796edb Add ghc-8.8.1 to travis script 2019-09-02 17:04:44 +02:00
Lennart Spitzner 91d6e18aba Adapt to ghc-8.8 (deps are not ready though) 2019-09-02 17:04:44 +02:00
Lennart Spitzner c97f6dd559 Update cabal instructions 2019-09-02 13:58:35 +02:00
Lennart Spitzner f289389879 Fix comment wandering left inside instance decls 2019-08-28 14:48:11 +02:00
Lennart Spitzner 698356a880 Increase the timeout of one of the perf-tests 2019-08-28 14:23:33 +02:00
Lennart Spitzner 4de2862a04 Add commandline flag --no-user-config
Stops brittany from trying to read a user-global config
flag. Together with --config-file, this can be used to pass
one single config to brittany, thereby controlling exactly
and explicit what the inputs of brittany are.
Should be useful for testing stuff that might depend on
config.
2019-08-28 14:23:33 +02:00
Lennart Spitzner 033fdc6517 Apply brittany to Main.hs 2019-08-28 14:23:33 +02:00
Lennart Spitzner bd10c3c4ef Update copyright in commandline notices 2019-08-28 14:23:33 +02:00