-
Notifications
You must be signed in to change notification settings - Fork 513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Unexpected date period token '1000' (BZ#554) #1626
Comments
Comment author: seanh With a budget entry starting:
ledger gives "Error: Unexpected date period token '1000'". Reducing it to 100 years gets rid of the error. |
Comment author: Martin Michlmayr (@tbm)
|
Christoph-D
added a commit
to Christoph-D/ledger
that referenced
this issue
Jun 10, 2018
This fixes issue ledger#1626. The tokenizer eagerly classifies 4-digit integers as TOK_A_YEAR tokens. In some contexts such as "every 1000 years", this causes errors. I think the tokenizer does not have enough information available to distinguish between integers and years. After this patch, the tokenizer will always classify integers as TOK_INT tokens. The "has 4 digits" heuristic to determine if an integer is a year is moved to the place where it's actually needed (and it can be slightly more generic there, too).
Christoph-D
added a commit
to Christoph-D/ledger
that referenced
this issue
Jun 10, 2018
This fixes ledger#1626. The tokenizer eagerly classifies 4-digit integers as TOK_A_YEAR tokens. In some contexts such as "every 1000 years", this causes errors. I think the tokenizer does not have enough information available to distinguish between integers and years. After this patch, the tokenizer will always classify integers as TOK_INT tokens. The "has 4 digits" heuristic to determine if an integer is a year is moved to the place where it's actually needed (and it can be slightly more generic there, too).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: the issue was created automatically with bugzilla2github
Bugzilla bug ID: BZ#554
From: seanh
CC: @tbm
The text was updated successfully, but these errors were encountered: