Initial commit
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
26
pest/ledger.pest
Normal file
26
pest/ledger.pest
Normal file
@@ -0,0 +1,26 @@
|
||||
alpha = _{ ASCII_ALPHA }
|
||||
digit = _{ ASCII_DIGIT }
|
||||
alpha_num = _{ ASCII_ALPHANUMERIC }
|
||||
any = _{ ASCII }
|
||||
nl = _{ NEWLINE }
|
||||
space = _{ " " }
|
||||
indent = _{ space{2} }
|
||||
word = _{ alpha+ }
|
||||
|
||||
year = { digit{2, 4} }
|
||||
month = { digit{1, 2} }
|
||||
day = { digit{1, 2} }
|
||||
date = { year ~ "/" ~ month ~ "/" ~ day }
|
||||
|
||||
title = { word+ }
|
||||
transaction_head = { date ~ space+ ~ title }
|
||||
|
||||
account = { word ~ ":"? }
|
||||
currency = { "EUR" }
|
||||
eur = { digit+ }
|
||||
cents = { digit{2} }
|
||||
money = { "-"? ~ eur ~ "." ~ cents ~ " " ~ currency }
|
||||
transaction_line = { indent ~ account* ~ indent+ ~ money }
|
||||
transaction = { transaction_head ~ nl ~ (transaction_line ~ nl)+ }
|
||||
|
||||
comment = { ";" ~ any }
|
||||
Reference in New Issue
Block a user