modify get_line_offset to deal with a non-comment token in a same lin…#44
modify get_line_offset to deal with a non-comment token in a same lin…#44DanielT merged 2 commits intoDanielT:mainfrom
Conversation
…e with previous comment token
|
Hi, thanks for the pull request. I understand what you're trying to do, but I think this change is incorrect. It will (presumably - no unit test!) work in the situation you described above, but it will break the formatting when comments are preserved between optional blocks. It will also not work if there are two comments in a row for some reason: A better approach would be to track how many tokens were skipped in Parser::expect_token(), and then look back by that many in get_line_offset. Additionally, it would be good to have
|
Understood, very valid points here. I will close this for now , and pull again with a better implementation. |
…dd comments and tests for said scenarios.
|
Hi,
|
|
Thanks for the update |
If there is a block like this:
when using a2ltool merge it will transform to the following format, in one line:
this pull request will resolve this problem.