[fidlfmt] Fix bug in deleting blank lines.
Prior to this fix, if there were multiple blank lines following a comment, the first one would get deleted because it needed to be coalesced with the subsequent lines, and the subsequent lines would get deleted because they were not next to a comment. This would leave no blank lines after a comment. This was not caught by tests because we were only exercising it in the case of an EOF. In the EOF case, we don't want trailing newlines, so it was the correct behavior. The other cases where we had trailing newlines after a comment (e.g., before const and enum) were special-cased to do the right thing. Change-Id: Ibba0e1ef7834cbe5a6e5af9c4e6faef837e724ea
Showing
- zircon/system/host/fidl/lib/formatter.cpp 19 additions, 2 deletionszircon/system/host/fidl/lib/formatter.cpp
- zircon/system/utest/fidl-compiler/testdata/badformat.fidl.noformat 9 additions, 0 deletions...stem/utest/fidl-compiler/testdata/badformat.fidl.noformat
- zircon/system/utest/fidl-compiler/testdata/goodformat.test.fidl 7 additions, 0 deletions.../system/utest/fidl-compiler/testdata/goodformat.test.fidl
Loading
Please register or sign in to comment