ledger/test/regress/F559EC12.test
John Wiegley b1b4e2aadf Add support for typed metadata
The metadata construct 'Key: Value' is now just a special case for
'Key:: "Value"'.  Another after a :: in metadata setting is parsed as a
full value expression and typed as such.  For example:

  ; Key:: $400 + $500

  ledger -l 'tag("Key") < $1000'
2010-06-12 15:43:00 -04:00

45 lines
1.1 KiB
Text

format "%-12(scrub(amount))"
<<<
>>>1
--- Context is first posting of the following transaction ---
2004/05/27 Book Store
; This note applies to all postings. :SecondTag:
Expenses:Books 20 BOOK @ $10
; Metadata: Some Value
; Typed:: $100 + $200
; :ExampleTag:
; Here follows a note describing the posting.
Liabilities:MasterCard $-200.00
--- Input format string ---
%-12(scrub(amount))
--- Format elements ---
Element: EXPR flags: 0x1 min: 12 max: 0 expr: scrub(amount)
--- Formatted string ---
"20 BOOK "
>>>2
=== 0
format "%12(scrub(amount))"
>>>1
--- Context is first posting of the following transaction ---
2004/05/27 Book Store
; This note applies to all postings. :SecondTag:
Expenses:Books 20 BOOK @ $10
; Metadata: Some Value
; Typed:: $100 + $200
; :ExampleTag:
; Here follows a note describing the posting.
Liabilities:MasterCard $-200.00
--- Input format string ---
%12(scrub(amount))
--- Format elements ---
Element: EXPR flags: 0x0 min: 12 max: 0 expr: scrub(amount)
--- Formatted string ---
" 20 BOOK"
>>>2
=== 0