Commit Graph

796 Commits (ee2814e3a83e257969ed1f81e0b6a43bbb20865d)

Author SHA1 Message Date
Lennart Spitzner 0fdbd51de0 Revert embarrassing debugging leftover that breaks things badly 2020-02-06 20:28:53 +01:00
Lennart Spitzner 5895f954bd Remove dependency on neat-interpolation 2020-02-04 16:14:38 +01:00
Lennart Spitzner f4cff441e2 Merge branch 'release' 2020-02-04 14:12:44 +01:00
Lennart Spitzner f80e777163 Allow neat-interpolation-0.4.* 2020-02-04 14:11:45 +01:00
Lennart Spitzner fad9db8fd8 Autoformat Config.hs 2020-01-23 13:56:25 +01:00
Lennart Spitzner 03e2b62c24 Introduce flag to disable formatting per-module
New inline config `-- brittany-disable` that parses but
ignores the current module. Useful if both brittany
and ghc-exactprint bug out for some syntax.
2020-01-23 13:56:25 +01:00
Lennart Spitzner 7fd2bef440
Merge pull request #273 from lspitzner/error-handling
Error handling
2020-01-23 01:17:07 +01:00
Lennart Spitzner 95686c20cd Merge branch 'master' into error-handling 2020-01-22 22:58:40 +01:00
Lennart Spitzner 128dd828c2 Fix newline issue on comments before where 2020-01-11 23:19:04 +01:00
Lennart Spitzner 2b303b2a20 Fix additional indentation bug for let-in 2020-01-10 16:32:18 +01:00
Lennart Spitzner d0256bb0db Make unknown syntax errors non-fatal/Fall back on exactprint 2020-01-03 11:58:53 +01:00
Lennart Spitzner 342cf16c56 Improve error message printing
- Omit unnecessary show-invocation
- Use showOutputable for the error span (location)

before/after:

  "RealSrcSpan SrcSpanPoint \"stdin\" 2 1: parse error (possibly incorrect indentation or mismatched brackets)"
  stdin:2:1: parse error (possibly incorrect indentation or mismatched brackets)
2020-01-03 11:58:53 +01:00
Lennart Spitzner af227a797d Add a few code comments 2019-12-20 01:20:07 +01:00
Lennart Spitzner 6724760f40 Fix non-idempotent newlines with comment + where (#263) 2019-12-20 01:12:25 +01:00
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