Support repeating transaction expansion #5

Open
opened 2026-08-07 14:21:59 +00:00 by hum3 · 0 comments
Owner

Summary

Implement expansion of ~ repeating transactions into concrete transactions.

Depends on

hum3/tree-sitter-goluca#2 — grammar must land first and be incorporated into gotreesitter.

Behaviour

When parsing a ~ transaction, expand it into N concrete transactions:

  • Count-based (repeat 26 daily): generate 26 transactions incrementing by the interval
  • Until-based (repeat monthly until 2024-12-15): generate transactions until the end date (inclusive)

Interval semantics

| Interval | Meaning |
|----------|---------||
| daily | +1 calendar day |
| weekly | +7 calendar days |
| monthly | Same day-of-month; clamp to last day if needed (e.g. Jan 31 → Feb 28/29) |
| yearly | Same day-of-year; Feb 29 → Feb 28 in non-leap years |

Linked movements

Linked movements (+ prefix) repeat as a group — each expansion produces a complete transaction with all movements.

Expand at parse time

Initial implementation: expand during parsing so downstream code sees only concrete * transactions. A goluca expand subcommand could also materialise to a file.

Background

Research doc: https://h3-pta-formats.statichost.eu/research/repeating-transactions.html


Migrated from Codeberg: originally #5, opened 2026-03-27.

## Summary Implement expansion of `~` repeating transactions into concrete transactions. ## Depends on hum3/tree-sitter-goluca#2 — grammar must land first and be incorporated into gotreesitter. ## Behaviour When parsing a `~` transaction, expand it into N concrete transactions: - **Count-based** (`repeat 26 daily`): generate 26 transactions incrementing by the interval - **Until-based** (`repeat monthly until 2024-12-15`): generate transactions until the end date (inclusive) ### Interval semantics | Interval | Meaning | |----------|---------|| | `daily` | +1 calendar day | | `weekly` | +7 calendar days | | `monthly` | Same day-of-month; clamp to last day if needed (e.g. Jan 31 → Feb 28/29) | | `yearly` | Same day-of-year; Feb 29 → Feb 28 in non-leap years | ### Linked movements Linked movements (`+` prefix) repeat as a group — each expansion produces a complete transaction with all movements. ### Expand at parse time Initial implementation: expand during parsing so downstream code sees only concrete `*` transactions. A `goluca expand` subcommand could also materialise to a file. ## Background Research doc: https://h3-pta-formats.statichost.eu/research/repeating-transactions.html --- *Migrated from Codeberg: originally [#5](https://codeberg.org/hum3/go-luca/issues/5), opened 2026-03-27.*
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
hum3/go-luca#5
No description provided.