Nested includes fail #21

Closed
simonmichael opened this Issue Apr 8, 2013 · 5 comments

Projects

None yet

1 participant

@simonmichael
Owner

Original author: MathStuf@gmail.com (August 09, 2010 00:26:10)

Example setup:

.journal:
!include .hledger/bank.journal

.hledger/bank.journal:
!include bank/year.journal

.hledger/bank/year.journal:
!include year/month.journal

Generates this error when trying anything with hledger:
could not parse journal data in /home/boeckb/.journal
"/home/boeckb/.journal" (line 4, column 1) in included file ".hledger/bank.journal":
".hledger/bank.journal" (line 2, column 1) in included file "bank/2006.journal":
"bank/2006.journal" (line 4, column 1) reading "bank/2006/08.journal":
bank/2006/08.journal: openFile: does not exist (No such file or directory)
hledger: could not parse journal data in /home/boeckb/.journal
"/home/boeckb/.journal" (line 4, column 1) in included file ".hledger/bank.journal":
".hledger/bank.journal" (line 2, column 1) in included file "bank/2006.journal":
"bank/2006.journal" (line 4, column 1) reading "bank/2006/08.journal":
bank/2006/08.journal: openFile: does not exist (No such file or directory)

Original issue: http://code.google.com/p/hledger/issues/detail?id=21

@simonmichael
Owner

From MathStuf@gmail.com on August 10, 2010 03:20:45
Fixed with attached patch. Why it fails on the third nested include, I have no idea. Unit test also updated to be deep enough to trigger the failure.

It's a little messy. The monads weren't meshing right and type errors were everywhere. The fullpath could be generated earlier and make inIncluded a better message, but using expandPath would be ideal.

@simonmichael
Owner

From simon@joyful.com on August 11, 2010 15:31:44
Looking good, could you "darcs send" this ? That way you'll get proper credit.

@simonmichael
Owner

From MathStuf@gmail.com on August 11, 2010 17:30:40
If I get time at home, yes. I leave for vacation (zero connectivity there) this weekend and won't return until Tuesday if I don't get a chance today.

@simonmichael
Owner

From MathStuf@gmail.com on September 02, 2010 18:05:26
Did the darcs send yesterday.

@simonmichael
Owner

From simon@joyful.com on September 03, 2010 17:58:39
Applied, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment