all repos

clerk @ 368f35af2811d8688f0ff80ac6f71b873203be00

missing tooling for ledger/hledger

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

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
lsp: semantic highlights, 2 months 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
	CommoditySpan token.Span // span of the commodity token
16
	Format        Amount     // optional format hint: "1,000.00 UAH"
17
	Comment       *Comment   // optional inline comment
18
	Span          token.Span
19
}
20
21
func (CommodityDirective) entryNode() {}
22
23
type PayeeDirective struct {
24
	Name    string
25
	Comment *Comment
26
	Span    token.Span
27
}
28
29
func (PayeeDirective) entryNode() {}
30
31
type TagDirective struct {
32
	Name    string
33
	Comment *Comment // optional inline comment
34
	Span    token.Span
35
}
36
37
func (TagDirective) entryNode() {}
38
39
type IncludeDirective struct {
40
	Path    string
41
	Comment *Comment // optional inline comment
42
	Span    token.Span
43
}
44
45
func (IncludeDirective) entryNode() {}
46
47
type AliasDirective struct {
48
	From, To Account
49
	Comment  *Comment // optional inline comment
50
	Span     token.Span
51
}
52
53
func (AliasDirective) entryNode() {}
54
55
type YearDirective struct {
56
	Year    int
57
	Comment *Comment // optional inline comment
58
	Span    token.Span
59
}
60
61
func (YearDirective) entryNode() {}
62
63
type DecimalMarkDirective struct {
64
	Mark    byte     // '.' ','
65
	Comment *Comment // optional inline comment
66
	Span    token.Span
67
}
68
69
func (DecimalMarkDirective) entryNode() {}
70
71
type DefaultCommodityDirective struct {
72
	Amount  Amount
73
	Comment *Comment // optional inline comment
74
	Span    token.Span
75
}
76
77
func (DefaultCommodityDirective) entryNode() {}
78
79
type MarketPriceDirective struct {
80
	DateTime  DateTime
81
	Commodity string
82
	Amount    Amount
83
	Comment   *Comment // optional inline comment
84
	Span      token.Span
85
}
86
87
func (MarketPriceDirective) entryNode() {}
88
89
type ConversionDirective struct {
90
	From    Amount
91
	To      Amount
92
	Comment *Comment // optional inline comment
93
	Span    token.Span
94
}
95
96
func (ConversionDirective) entryNode() {}
97
98
type ApplyDirective struct {
99
	Expr    string // text after apply e.g "tag foo"
100
	Comment *Comment
101
	Span    token.Span
102
}
103
104
func (ApplyDirective) entryNode() {}
105
106
type EndDirective struct {
107
	Expr    string   // text after end e.g "tag"
108
	Comment *Comment // optional inline comment
109
	Span    token.Span
110
}
111
112
func (EndDirective) entryNode() {}
113
114
type CommentBlockDirective struct {
115
	Header  string // text after "comment" on the same line
116
	Content string
117
	Comment *Comment // optional inline comment
118
	Span    token.Span
119
}
120
121
func (CommentBlockDirective) entryNode() {}
122
123
type IgnoredDirective struct {
124
	Text    string   // content after N (commodity symbol or text)
125
	Comment *Comment // optional inline comment
126
	Span    token.Span
127
}
128
129
func (IgnoredDirective) entryNode() {}