all repos

clerk @ 0b03250d43079a3582484d8eb64805c3ba452e30

missing tooling for ledger/hledger

clerk/journal/ast/directives.go (view raw)

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
rename to clerk, 13 days ago
1
package ast
2
3
import "olexsmir.xyz/clerk/journal/token"
4
5
type AccountDirective struct {
6
	Account Account
7
	Comment *Comment
8
	Span    token.Span
9
}
10
11
func (AccountDirective) entryNode() {}
12
13
type CommodityDirective struct {
14
	Commodity string
15
	Format    *Amount // optional format hint: "1,000.00 UAH"
16
	Comment   *Comment
17
	Span      token.Span
18
}
19
20
func (CommodityDirective) entryNode() {}
21
22
type PayeeDirective struct {
23
	Name    string
24
	Comment *Comment
25
	Span    token.Span
26
}
27
28
func (PayeeDirective) entryNode() {}
29
30
type TagDirective struct {
31
	Name    string
32
	Comment *Comment
33
	Span    token.Span
34
}
35
36
func (TagDirective) entryNode() {}
37
38
type IncludeDirective struct {
39
	Path    string
40
	Comment *Comment
41
	Span    token.Span
42
}
43
44
func (IncludeDirective) entryNode() {}
45
46
type AliasDirective struct {
47
	From, To string
48
	Span     token.Span
49
}
50
51
func (AliasDirective) entryNode() {}
52
53
type YearDirective struct {
54
	Year int
55
	Span token.Span
56
}
57
58
func (YearDirective) entryNode() {}
59
60
type DecimalMarkDirective struct {
61
	Mark byte // '.' ','
62
	Span token.Span
63
}
64
65
func (DecimalMarkDirective) entryNode() {}
66
67
type DefaultCommodityDirective struct {
68
	Amount Amount
69
	Span   token.Span
70
}
71
72
func (DefaultCommodityDirective) entryNode() {}
73
74
type MarketPriceDirective struct {
75
	DateTime  DateTime
76
	Commodity string
77
	Amount    Amount
78
	Span      token.Span
79
}
80
81
func (MarketPriceDirective) entryNode() {}
82
83
type ApplyDirective struct {
84
	Expr    string // text after apply e.g "tag foo"
85
	Comment *Comment
86
	Span    token.Span
87
}
88
89
func (ApplyDirective) entryNode() {}
90
91
type EndDirective struct {
92
	Expr    string // text after end e.g "tag"
93
	Comment *Comment
94
	Span    token.Span
95
}
96
97
func (EndDirective) entryNode() {}
98
99
type CommentBlockDirective struct {
100
	Header  string // text after "comment" on the same line
101
	Content string
102
	Comment *Comment
103
	Span    token.Span
104
}
105
106
func (CommentBlockDirective) entryNode() {}
107
108
type IgnoredDirective struct {
109
	Span token.Span
110
}
111
112
func (IgnoredDirective) entryNode() {}