Commit Graph

6693 Commits

Author SHA1 Message Date
Alex Chen
e45070aab5 Update dependency bounds for megaparsec 2018-10-09 11:15:33 -06:00
Alex Chen
a8d642d5b5 lib: revise comments for "final" parse errors
- also simplify their implementation a bit
2018-10-09 11:05:46 -06:00
Simon Michael
2c9c4ebf79
Merge branch 'master' into ExceptTLayer 2018-10-04 21:04:02 -10:00
Nikhil Jha
611ad9d5c7 Remove Twitter
Fix #870
2018-10-01 15:00:59 -10:00
Simon Michael
0db44dd8b8 site: download: update stack install command
[ci skip]
2018-10-01 10:22:30 -10:00
Simon Michael
c46175158f site: download: add -s to curl commands
[ci skip]
2018-10-01 10:07:51 -10:00
Simon Michael
4fb0e401a1 install: bump version 2018-10-01 10:01:17 -10:00
Simon Michael
aba0db8490 install: ensure a new-enough version of stack; output improvements 2018-10-01 10:00:46 -10:00
Simon Michael
87e54507e0 install: fix missing cassava-megaparsec dependency 2018-10-01 09:38:54 -10:00
Simon Michael
ca4a7fae3b install: clean up vars 2018-10-01 09:25:39 -10:00
Simon Michael
4e30ac8e9e install: cleanups 2018-10-01 09:25:39 -10:00
Simon Michael
ef792493d0 site: download page
[ci skip]
2018-09-30 20:39:36 -10:00
Simon Michael
04d5b73d2b site: download page
[ci skip]
2018-09-30 20:36:56 -10:00
Simon Michael
3a7a37475d doc: release notes: fix link
[ci skip]
2018-09-30 20:27:09 -10:00
Simon Michael
d5b7e961d3 doc: release notes: fix link
[ci skip]
2018-09-30 20:26:03 -10:00
Simon Michael
fb6f669684 doc: release notes 2018-09-30 20:22:33 -10:00
Simon Michael
d15fbb5a6b doc: add 1.11 manuals snapshot 2018-09-30 20:20:23 -10:00
Simon Michael
0699cf8734 doc: release notes 2018-09-30 20:15:54 -10:00
Simon Michael
7bc500ccd2 update embedded manuals 2018-09-30 20:08:15 -10:00
Simon Michael
b798c48040 bump version to 1.11 2018-09-30 20:07:45 -10:00
Simon Michael
92c8a6fffb changelogs 2018-09-30 20:05:26 -10:00
Alex Chen
3d2584d869 lib: switch to megaparsec 7 2018-09-30 20:15:12 -06:00
Simon Michael
fa74840206 install: drop hledger-irr 2018-09-30 14:37:34 -10:00
Alex Chen
26369c28a3 lib: remove old code for include file parse errors 2018-09-29 22:55:10 -06:00
Alex Chen
31d4e930e7 lib: Re-implement 'includedirectivep' with the new 'ExceptT' layer
- Parse errors encountered in include files are treated as "final" parse
  errors in the parent file, preventing backtracking and fixing an issue
  in #853
2018-09-29 22:54:49 -06:00
Alex Chen
3e54fc77a4 lib: make 'includedirectivep' an 'ErroringJournalParser'
- Update tests as well, requiring test utilities in Utils/Test.hs
  analogous to the those for 'JournalParser' but instead for
  'ErroringJournalParser'
2018-09-29 22:34:52 -06:00
Alex Chen
855a8f1985 lib: Re-implement the 'ExceptT' layer of the parser
We previously had another parser type, 'type ErroringJournalParser =
ExceptT String ...' for throwing parse errors without the possibility of
backtracking. This parser type was removed under the assumption that it
would be possible to write our parser without this capability. However,
after a hairy backtracking bug, we would now prefer to have the option
to prevent backtracking.

- Define a 'FinalParseError' type specifically for the 'ExceptT' layer
- Any parse error can be raised as a "final" parse error
- Tracks the stack of include files for parser errors, anticipating the
  removal of the tracking of stacks of include files in megaparsec 7
  - Although a stack of include files is also tracked in the 'StateT
    Journal' layer of the parser, it seems easier to guarantee correct
    error messages in the 'ExceptT FinalParserError' layer
  - This does not make the 'StateT Journal' stack redundant because the
    'ExceptT FinalParseError' stack cannot be used to detect cycles of
    include files
2018-09-29 22:33:34 -06:00
Alex Chen
2b3c97e1af lib: tweak custom parse errors
- Don't immediately throw custom parse errors into 'ParsecT'; rather,
  just construct and return them
- This anticipates the re-implementation of an 'ExceptT' layer of the
  parser, which should be able throw custom parse errors
2018-09-29 22:32:34 -06:00
Alex Chen
5e1f0ba6f7 lib: add a field to 'Journal' for a stack of include files
- In anticipation of megaparsec 7, which removes support for stacks of
  include files (as far as I can tell)
- Intended for the 'StateT Journal' layer of the parser
  - A stack of include files would be better in a 'ReaderT' layer, but I
    don't want to add another layer to the parser
- Intended for detecting cycles of include files
  - Potential issue: for proper error messages for include file cycles,
    we must remember to provide the filepath of the root journal file via
    the initial journal state passed to a 'JournalParser'; I imagine
    that we may forget to do so because in all other cases it is okay
    not to do so.
2018-09-29 22:32:27 -06:00
Simon Michael
e670bd4e9a tests: typo 2018-09-27 13:51:31 -10:00
Dmitry Astapov
743098034b tests: return on investment 2018-09-27 13:42:31 -10:00
Dmitry Astapov
3397ccdd4c cli: command to compute return on investment 2018-09-27 13:42:31 -10:00
Simon Michael
2960c9209f lib: whitespace 2018-09-27 10:51:36 -10:00
Simon Michael
f42b140d53 lib: note about strict Map 2018-09-27 10:51:36 -10:00
Simon Michael
1cb5357a7d update cabal file 2018-09-25 07:27:06 -10:00
Dmitry Astapov
bda202e4d4 cli: "close" can print only opening or closing transaction 2018-09-25 07:25:59 -10:00
Simon Michael
855bd54d19 budget: declaration and (actual) amount sorting for bal --budget
Account declaration-aware sorting is the default throughout hledger now.
2018-09-24 08:31:19 -10:00
Simon Michael
f2b4fca9b0 docs: journal: more account sorting updates
[ci skip]
2018-09-23 18:04:20 -10:00
Simon Michael
7a9ca5f6a9 docs: journal: more account sorting updates
[ci skip]
2018-09-23 17:55:21 -10:00
Simon Michael
477caa31c5 docs: journal: remove account code from example
[ci skip]
2018-09-23 17:48:19 -10:00
Dmitry Astapov
8c79d6529d lib: fix balance --budget in the presence of --value 2018-09-23 07:45:34 -10:00
Simon Michael
ef5e7511c2 tests: fix balance/sorting.test with released shelltest
It was using org-style nodes for organisation, which requires
a shelltest dev build.
2018-09-22 21:58:00 -10:00
Dmitry Astapov
cb979ed129 cli: command to list included files 2018-09-22 21:47:54 -10:00
Simon Michael
3de8c11de1 journal: a new account sorting mechanism, and a bunch of sorting fixes
A bunch of account sorting changes that got intermingled.

First, account codes have been dropped. They can still be parsed and
will be ignored, for now. I don't know if anyone used them.
Instead, account display order is now controlled by the order of account
directives, if any. From the mail list:

  I'd like to drop account codes, introduced in hledger 1.9 to control
  the display order of accounts. In my experience,

  - they are tedious to maintain
  - they duplicate/compete with the natural tendency to arrange account
    directives to match your mental chart of accounts
  - they duplicate/compete with the tree structure created by account
    names

  and it gets worse if you think about using them more extensively,
  eg to classify accounts by type.

  Instead, I plan to just let the position (parse order) of account
  directives determine the display order of those declared accounts.
  Undeclared accounts will be displayed after declared accounts,
  sorted alphabetically as usual.

Second, the various account sorting modes have been implemented more
widely and more correctly. All sorting modes (alphabetically, by account
declaration, by amount) should now work correctly in almost all commands
and modes (non-tabular and tabular balance reports, tree and flat modes,
the accounts command). Sorting bugs have been fixed, eg #875.
Only the budget report (balance --budget) does not yet support sorting.

Comprehensive functional tests for sorting in the accounts and balance
commands have been added. If you are confused by some sorting behaviour,
studying these tests is recommended, as sorting gets tricky.
2018-09-22 21:45:07 -10:00
Simon Michael
598129ad6a lib: pushAccount -> pushDeclaredAccount 2018-09-22 21:06:29 -10:00
Simon Michael
8c18bada0c lib, cli, ui, web: update cabal files 2018-09-22 21:01:23 -10:00
Simon Michael
03acd40668 lib, cli, ui, web: upper bound to avoid megaparsec 7 for now 2018-09-20 20:48:47 -10:00
Simon Michael
059ad9eb76 refactor: jaccounts -> jdeclaredaccounts 2018-09-17 05:52:13 -07:00
Simon Michael
944a49d359 tools: make: drop hunittest rule
[ci skip]
2018-09-09 08:35:03 -07:00
Simon Michael
73d39d02c7 tools: make: clarify doctest/haddocktest help (#866)
[ci skip]
2018-09-09 08:33:06 -07:00