-
Notifications
You must be signed in to change notification settings - Fork 26
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
allow multple comments in a line for the new compact syntax #143
Conversation
gerdreiss
commented
Mar 1, 2017
- extended parser for compact transaction syntax to allow multple comments
- added test case for multiple comments in a line
@gerdreiss I think you are on the right track, but this change still affects multi-line-transactions. Test case: test143.ledger:
test143.conf
gives:
|
Forgot to mention, I expect it to give the same output as current code. That is:
([info] is coming from sbt) |
Actually, my change does not affect the multiline transactions, I thought, because I haven't changed the parsing of those (Edit: sorry, it does, of course, as I don't allow semicolons there...). I understood that we didn't want that from what you've said in your issue comment: "for now, we will make the syntax change only for single-line-notation. Otherwise it will affect older input files." I must have misunderstood that. I thought that we want to support multiple comments in one line for compact transaction syntax only. So, do we want to handle the multiple comments there as one? At least that is how I understand the XML output... Edit 2: Sorry, I think I understand my mistake :) I'll look into it... |
Regarding your edit: Thanks for looking into it! |
@hrj Just to avoid further misunderstandings and mistakes ;) I suppose that this:
should lead to this:
Correct? |
Nope :) Since it's multi-line syntax, it shouldn't change behavior from existing code. Only single-line syntax (with the dot in the front) needs to change. Glad you asked! If it's still confusing, we could first try to add tests and then change the code (test driven development). I am nearing my sleep time here. I can look into it tomorrow, if you don't beat me to it. |
I have added two tests for comments in 3dc10ea If you rebase this branch and push again, I think this PR will be verified automatically by Travis. |
- added test case for multiple comments in a line
- added test case
@gerdreiss Another tip. If you add "closes #issue-number" to the PR description, the issue will be closed automatically when the PR is merged. |
@hrj good to know. my next PR will have that description 👍 |