todo.txt (773B)
1 registers (tree) 2 Expenses: 3 ---- 4 |- Food: 5 ---- 6 |- Dessert(+5) 7 |- Dinner( 8 |- Auto: 9 ---- 10 |- Gas 11 |- Gas: 12 --- 13 14 record_tags = { 15 "Food:Dessert" 16 } 17 balance 18 ------- 19 20 21 somehow map the get_entries pipe to entry and do the foreach loop, so the loop will work async 22 balance = 0 23 balance_struct (tree) ; 24 for(entry in parse_entries(FILE* f, from = unix_epoch | -e, to = now)) { 25 date = entry->date // useful for sorting? 26 for (record in parse_records(entry)) { 27 int get_rec_ptr = record->nn_name; // to get the string name and to verify with other records 28 int get_val = record->amount; 29 balance_struct.add(get_rec_ptr, get_val); // add value 'get_val' to 'get_rec_ptr' 30 balance += get_val; 31 } 32 printf("-----------------\n"); 33 printf("%s %d", denom, balance); 34 }