hledger/hledger-lib/Hledger
Jonathan Dowland b7027c8bbb feat:import: resolve matchgroup references in ConditionalBlock scope (#2158)
Adjust getEffectiveAssignment to compute an intermediary form of the
active assignments (with an additional Either wrapper to distinguish
top-level and conditional assignments) and move the remaining work to
its only caller, hledgerField.

Rework hledgerFieldValue. Instead of calling hledgerField, call
getEffectiveAssignment and--in the conditional block case--construct
a CsvRules scoped just to the active ConditionalBlock before calling
renderTemplate.

Adjust regexMatchValue to use rconditionalblocks to access conditional
blocks from the CsvRules, rather than rblocksassigning, since we haven't
narrowed the scope of that field.

The result is match group references are only expanded for match groups
that occur within the in-scope ConditionalBlock. Fixes: #2158.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:40 +00:00
..
Data dev: fix some partial head/tails, silence ghc 9.8's new warnings 2024-02-28 15:58:21 -10:00
Read feat:import: resolve matchgroup references in ConditionalBlock scope (#2158) 2024-02-29 21:44:40 +00:00
Reports dev: fix some partial head/tails, silence ghc 9.8's new warnings 2024-02-28 15:58:21 -10:00
Utils dev: fix some partial head/tails, silence ghc 9.8's new warnings 2024-02-28 15:58:21 -10:00
Data.hs ref: move journal checking/pretty errors down further, to Hledger.Data 2022-05-21 18:29:13 -10:00
Query.hs dev: fix some partial head/tails, silence ghc 9.8's new warnings 2024-02-28 15:58:21 -10:00
Read.hs ;imp:cli:errors: make file-not-found error more format agnostic 2024-02-26 10:25:22 -10:00
Reports.hs cln: tests: Remove test and tests, which are just aliases for testCase 2021-08-30 16:32:19 -10:00
Utils.hs imp: more precision handling fixes, debug output, test updates (precisiongeddon) 2023-11-08 13:59:18 -08:00