all repos

clerk @ 4047965

missing tooling for ledger/hledger

clerk/journal/parser/testdata/automated_transaction.txtar (view raw)

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
add support of subdirectives and it's highlights, 1 month ago
1
-- input --
2
= ^income
3
    (liabilities:tax)  *.33
4
5
= expenses:gifts
6
    budget:gifts  *-1
7
    assets:budget  *1
8
9
= income:salary
10
    budget:savings  (amount * 0.5)
11
-- expect --
12
Journal
13
  AutomatedTransaction j:1:1-4:0
14
    Expr: "^income" j:1:3-2:0
15
    Posting j:2:1-4:0
16
      Type: unbalanced virtual
17
      Account j:2:6-2:21
18
        SubAccount: "liabilities" j:2:6-2:17
19
        SubAccount: "tax" j:2:18-2:21
20
      Amount j:2:25-3:0
21
        Quantity: 0.33
22
        Commodity: ""
23
        CommodityPos: Before
24
        HasSpace: false
25
        IsExpr: true
26
        Precision: 2
27
        Decimal: "."
28
  BlankLine j:4:0-4:1
29
  AutomatedTransaction j:4:1-8:0
30
    Expr: "expenses:gifts" j:4:3-5:0
31
    Posting j:5:1-6:1
32
      Account j:5:5-5:17
33
        SubAccount: "budget" j:5:5-5:11
34
        SubAccount: "gifts" j:5:12-5:17
35
      Amount j:5:20-6:0
36
        Quantity: -1
37
        Commodity: ""
38
        CommodityPos: Before
39
        HasSpace: false
40
        IsExpr: true
41
        Precision: 0
42
    Posting j:6:1-8:0
43
      Account j:6:5-6:18
44
        SubAccount: "assets" j:6:5-6:11
45
        SubAccount: "budget" j:6:12-6:18
46
      Amount j:6:21-7:0
47
        Quantity: 1
48
        Commodity: ""
49
        CommodityPos: Before
50
        HasSpace: false
51
        IsExpr: true
52
        Precision: 0
53
  BlankLine j:8:0-8:1
54
  AutomatedTransaction j:8:1-10:1
55
    Expr: "income:salary" j:8:3-9:0
56
    Posting j:9:1-10:1
57
      Account j:9:5-9:19
58
        SubAccount: "budget" j:9:5-9:11
59
        SubAccount: "savings" j:9:12-9:19
60
      Amount j:9:21-10:0
61
        Quantity: 0
62
        Commodity: ""
63
        CommodityPos: Before
64
        HasSpace: false
65
        IsExpr: true
66
        Expr: "amount * 0.5"
67
        Precision: 0