Number of levels in chart of accounts

82 views
Skip to first unread message

Andrew Tolmie

unread,
Jul 31, 2017, 1:37:10 PM7/31/17
to Beancount

I found that I cannot use the following account name
Income:UK:Santander:Checking:Interest
without bean-query reporting an error saying a colon is there.

I did not get the error if I kept the number of levels to four like this
Assets:UK:Santander:Checking

Is this restriction on number of account levels intentional? 

Martin Blais

unread,
Aug 1, 2017, 12:04:14 AM8/1/17
to Beancount
There is no such restriction
This sounds like a bug or some sort
Please file a ticket with a minimal file that reproduces the problem
Thank you

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscribe@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/0195d9e1-b8af-4ba0-adf1-6ab411d8d75e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Martin Blais

unread,
Aug 1, 2017, 6:23:14 PM8/1/17
to Beancount
Just tested this, I cannot reproduce this error.
I can create a file with this account name and query it, no problem.
Please provide a small file that reproduces this.
Thanks,



--

Andrew Tolmie

unread,
Aug 6, 2017, 5:46:45 PM8/6/17
to Beancount
My example is below:

22:39:47 Andrew@LAPTOP-V9S562AR:~/accounting
$ cat main.beancount

2012-02-01 open Assets:UK:Santander:Checking:0796 GBP
2012-02-01 open Income:UK:Santander:Checking:0796:Interest GBP

22:40:27 Andrew@LAPTOP-V9S562AR:~/accounting
$ bean-check main.beancount
/mnt/c/Users/andre/OneDrive/accounting/main.beancount:2:       syntax error, unexpected COLON, expecting EOL or COMMENT

/mnt/c/Users/andre/OneDrive/accounting/main.beancount:3:       syntax error, unexpected COLON, expecting EOL or COMMENT

/mnt/c/Users/andre/OneDrive/accounting/main.beancount:3:       Invalid token: 'Interest'

I am using Bash on Windows (Windows subsystem for linux).

Martin Blais

unread,
Aug 6, 2017, 11:47:30 PM8/6/17
to Beancount
Hi Andrew,
The problem is not the length of the account name, it is that each component must begin with a letter.
Your "0796" account name component is the problem here.
I think what happens here is that the account name is recognized up to the ":0796" bit and then it does not recognize that as anything useful by itself.
(I admit that the error message isn't really useful; it's auto-generated by the parser generator.)
Just call it "A0796" or something like that and it should work.
I hope this helps,



--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscribe@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.

Andrew Tolmie

unread,
Aug 7, 2017, 6:45:39 AM8/7/17
to Beancount
Thanks for the suggestion. I wonder if the parser should use any character in alphanumeric?


On Monday, August 7, 2017 at 4:47:30 AM UTC+1, Martin Blais wrote:
Hi Andrew,
The problem is not the length of the account name, it is that each component must begin with a letter.
Your "0796" account name component is the problem here.
I think what happens here is that the account name is recognized up to the ":0796" bit and then it does not recognize that as anything useful by itself.
(I admit that the error message isn't really useful; it's auto-generated by the parser generator.)
Just call it "A0796" or something like that and it should work.
I hope this helps,

On Sun, Aug 6, 2017 at 5:46 PM, Andrew Tolmie <andyth...@gmail.com> wrote:
My example is below:

22:39:47 Andrew@LAPTOP-V9S562AR:~/accounting
$ cat main.beancount

2012-02-01 open Assets:UK:Santander:Checking:0796 GBP
2012-02-01 open Income:UK:Santander:Checking:0796:Interest GBP

22:40:27 Andrew@LAPTOP-V9S562AR:~/accounting
$ bean-check main.beancount
/mnt/c/Users/andre/OneDrive/accounting/main.beancount:2:       syntax error, unexpected COLON, expecting EOL or COMMENT

/mnt/c/Users/andre/OneDrive/accounting/main.beancount:3:       syntax error, unexpected COLON, expecting EOL or COMMENT

/mnt/c/Users/andre/OneDrive/accounting/main.beancount:3:       Invalid token: 'Interest'

I am using Bash on Windows (Windows subsystem for linux).

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.

Martin Blais

unread,
Aug 8, 2017, 9:23:44 PM8/8/17
to Beancount
I think the parser can safely handle that. I ran tests and it seems safe to do so.

To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscribe@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages