diff --git a/beancount-parser-lima/examples/data/full.beancount b/beancount-parser-lima/examples/data/full.beancount index 6b65b3a..31c6c06 100644 --- a/beancount-parser-lima/examples/data/full.beancount +++ b/beancount-parser-lima/examples/data/full.beancount @@ -45,6 +45,10 @@ pushmeta price: "expensive" 2012-01-09 * "VISA DDA PUR 444500 WHOLEFDS -- VISA DDA PUR 444500 WHOLEFDS HOU 10236 NEW YORK * NY" +; Martin +2013-01-01 * "Buy CRA shares" ^old-transactions-008 + Assets:CA:RBC-Investing:Taxable-CAD:Cash -1395.43 CAD @ 1/1.4576 USD + 2023-05-29 * "New World Gardens North East Va ;" ^newworld.co.nz Assets:Bank:Current -30 -9.65 NZD ofxid: "0.12-3456-1234567-01.29May2023.1" ; from ledger-autosync diff --git a/beancount-parser-lima/src/lexer.rs b/beancount-parser-lima/src/lexer.rs index 6649d4e..af66f52 100644 --- a/beancount-parser-lima/src/lexer.rs +++ b/beancount-parser-lima/src/lexer.rs @@ -13,7 +13,7 @@ use time::{Date, Month, Time}; #[logos(error = LexerError, skip r"[ \t]+")] #[logos(subpattern ignored_whole_line= r"([*:!&#?%][^\n]*\n)")] // rolled into end-of-line handling below #[logos(subpattern comment_to_eol= r"(;[^\n]*)")] // rolled into end-of-line handling below -#[logos(subpattern currency = r"[A-Z][A-Z0-9'\._-]*|/[A-Z0-9'\._-]+")] // not all matches are valid so we lean on the validation provided by try_from +#[logos(subpattern currency = r"[A-Z][A-Z0-9'\._-]*|/[0-9'\._-]*[A-Z][A-Z0-9'\._-]*")] #[logos(subpattern date = r"\d{4}[\-/]\d{2}[\-/]\d{2}")] #[logos(subpattern time = r"\d{1,2}:\d{2}(:\d{2})?")] #[logos(subpattern account_type = r"[\p{Lu}\p{Lo}][\p{L}\p{N}\-]*")]