all repos

clerk @ e6f9851

missing tooling for ledger/hledger

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

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
add support of subdirectives and it's highlights, 1 month ago
1
-- input --
2
3
~ monthly
4
    expenses:rent          $2000
5
    assets:bank:checking
6
7
~ monthly from 2023-04-15 to 2023-06-16
8
    expenses:utilities          $400
9
    assets:bank:checking
10
11
~ every 2 months  in 2023, we will review
12
    expenses:utilities          $400
13
    assets:bank:checking
14
15
~ monthly  Next year blah blah
16
    expenses:food  $100
17
    assets:checking
18
19
~ monthly from 2018/6 ;In 2019 we will change this
20
    expenses:food  $100
21
    assets:checking
22
-- expect --
23
Journal
24
  BlankLine j:2:0-2:1
25
  PeriodicTransaction j:2:1-6:0
26
    Period: "monthly"
27
    Posting j:3:1-4:1
28
      Account j:3:5-3:18
29
        SubAccount: "expenses" j:3:5-3:13
30
        SubAccount: "rent" j:3:14-3:18
31
      Amount j:3:28-4:0
32
        Quantity: 2000
33
        Commodity: "$" j:3:28-3:29
34
        CommodityPos: Before
35
        HasSpace: false
36
        Precision: 0
37
    Posting j:4:1-6:0
38
      Account j:4:5-5:0
39
        SubAccount: "assets" j:4:5-4:11
40
        SubAccount: "bank" j:4:12-4:16
41
        SubAccount: "checking" j:4:17-5:0
42
      Amount: <elided>
43
  BlankLine j:6:0-6:1
44
  PeriodicTransaction j:6:1-10:0
45
    Period: "monthly from 2023-04-15 to 2023-06-16"
46
    From: 2023-04-15
47
    To: 2023-06-16
48
    Posting j:7:1-8:1
49
      Account j:7:5-7:23
50
        SubAccount: "expenses" j:7:5-7:13
51
        SubAccount: "utilities" j:7:14-7:23
52
      Amount j:7:33-8:0
53
        Quantity: 400
54
        Commodity: "$" j:7:33-7:34
55
        CommodityPos: Before
56
        HasSpace: false
57
        Precision: 0
58
    Posting j:8:1-10:0
59
      Account j:8:5-9:0
60
        SubAccount: "assets" j:8:5-8:11
61
        SubAccount: "bank" j:8:12-8:16
62
        SubAccount: "checking" j:8:17-9:0
63
      Amount: <elided>
64
  BlankLine j:10:0-10:1
65
  PeriodicTransaction j:10:1-14:0
66
    Period: "every 2 months"
67
    Description: "in 2023, we will review" j:10:19-11:0
68
    Posting j:11:1-12:1
69
      Account j:11:5-11:23
70
        SubAccount: "expenses" j:11:5-11:13
71
        SubAccount: "utilities" j:11:14-11:23
72
      Amount j:11:33-12:0
73
        Quantity: 400
74
        Commodity: "$" j:11:33-11:34
75
        CommodityPos: Before
76
        HasSpace: false
77
        Precision: 0
78
    Posting j:12:1-14:0
79
      Account j:12:5-13:0
80
        SubAccount: "assets" j:12:5-12:11
81
        SubAccount: "bank" j:12:12-12:16
82
        SubAccount: "checking" j:12:17-13:0
83
      Amount: <elided>
84
  BlankLine j:14:0-14:1
85
  PeriodicTransaction j:14:1-18:0
86
    Period: "monthly"
87
    Description: "Next year blah blah" j:14:12-15:0
88
    Posting j:15:1-16:1
89
      Account j:15:5-15:18
90
        SubAccount: "expenses" j:15:5-15:13
91
        SubAccount: "food" j:15:14-15:18
92
      Amount j:15:20-16:0
93
        Quantity: 100
94
        Commodity: "$" j:15:20-15:21
95
        CommodityPos: Before
96
        HasSpace: false
97
        Precision: 0
98
    Posting j:16:1-18:0
99
      Account j:16:5-17:0
100
        SubAccount: "assets" j:16:5-16:11
101
        SubAccount: "checking" j:16:12-17:0
102
      Amount: <elided>
103
  BlankLine j:18:0-18:1
104
  PeriodicTransaction j:18:1-21:1
105
    Period: "monthly from 2018/6"
106
    Comment j:18:23-19:0
107
      Marker: ";"
108
      Text: "In 2019 we will change this"
109
    Posting j:19:1-20:1
110
      Account j:19:5-19:18
111
        SubAccount: "expenses" j:19:5-19:13
112
        SubAccount: "food" j:19:14-19:18
113
      Amount j:19:20-20:0
114
        Quantity: 100
115
        Commodity: "$" j:19:20-19:21
116
        CommodityPos: Before
117
        HasSpace: false
118
        Precision: 0
119
    Posting j:20:1-21:1
120
      Account j:20:5-21:0
121
        SubAccount: "assets" j:20:5-20:11
122
        SubAccount: "checking" j:20:12-21:0
123
      Amount: <elided>