Closed jmtd closed 7 months ago
I'm not sure why the order of rconditionalblocks appears to be reversed from the order in rules files.
Probably relevant: https://github.com/simonmichael/hledger/blob/master/hledger-lib/Hledger/Read/RulesReader.hs#L457
I'm not sure why the order of rconditionalblocks appears to be reversed from the order in rules files. That's where I'll look when I next pick this up.
Red herring. The parser code prepends ConditionalBlocks as it parses them (presumably for efficiency); at the end of parsing mkrules
reverses the list.
I think this is ready for review.
regexMatchValue
to use rconditionalblocks
rather than rblocksassigning
, as I'm not sure yet how to update that field to reflect an altered set of ConditionalBlocksMaybe (Either FieldTemplate ConditionalBlock)
is a bit of a mouthful. We could introduce a type alias for the Either
bit. On the other hand, the function is now only used in two places, so perhaps that's overkill.hledgerField
and hledgerFieldValue
are. I've been staring at them too long to judge right now.Thanks for the fix @jmtd!
(I tried to merge keeping history, probably made a mess as usual..)
Thanks for the work on this! I'm looking forward to being able to use it.
Which reminds me I need to get that Nix Flake working so I can run arbitrary versions in production...
This is a beginning of an attempt to fix #2158. First a test to capture the problem:
I'm not sure why the order of
rconditionalblocks
appears to be reversed from the order in rules files. That's where I'll look when I next pick this up.