all repos

clerk @ e12aa47

missing tooling for ledger/hledger

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

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
add support of subdirectives and it's highlights, 1 month ago
1
-- input --
2
commodity $
3
  format 1.000,00
4
5
commodity EUR
6
  format EUR 100.00  ; ok
7
8
commodity $100
9
-- expect --
10
Journal
11
  CommodityDirective j:1:1-4:0
12
    Commodity: "$" j:1:11-2:0
13
    Format j:2:3-2:9
14
      Amount j:2:10-3:0
15
        Quantity: 1000
16
        Commodity: ""
17
        CommodityPos: Before
18
        HasSpace: false
19
        Precision: 2
20
        Decimal: ","
21
        Thousands: "."
22
  BlankLine j:4:0-4:1
23
  CommodityDirective j:4:1-7:0
24
    Commodity: "EUR" j:4:11-5:0
25
    Format j:5:3-5:9
26
      Amount j:5:10-5:20
27
        Quantity: 100
28
        Commodity: "EUR" j:5:10-5:13
29
        CommodityPos: Before
30
        HasSpace: true
31
        Precision: 2
32
        Decimal: "."
33
      Comment j:5:22-6:0
34
        Marker: ";"
35
        Text: "ok"
36
  BlankLine j:7:0-7:1
37
  CommodityDirective j:7:1-8:1
38
    Commodity: "$" j:7:11-7:12
39
    Format inline
40
      Amount j:7:12-8:0
41
        Quantity: 100
42
        Commodity: "$" j:7:11-7:12
43
        CommodityPos: Before
44
        HasSpace: false
45
        Precision: 0
46
  Errors
47
    j:2:10-2:10: commodity directive symbol "$" and format directive symbol "" should be the same
48
    j:7:12-7:12: Please include a decimal point or decimal comma in commodity directives, to help us parse correctly. It may be followed by zero or more decimal digits.