Get rid of some extra newlines in bpfmt am: d2f1141871
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/3007878 Change-Id: I958bf48af64ff4d70b7754dbbaf90345283e849b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
6f7c2d8049
2 changed files with 5 additions and 7 deletions
|
@ -144,6 +144,7 @@ func (p *printer) printSelect(s *Select) {
|
||||||
}
|
}
|
||||||
if len(s.Cases) == 1 && s.Cases[0].Pattern.Value == "__soong_conditions_default__" {
|
if len(s.Cases) == 1 && s.Cases[0].Pattern.Value == "__soong_conditions_default__" {
|
||||||
p.printExpression(s.Cases[0].Value)
|
p.printExpression(s.Cases[0].Value)
|
||||||
|
p.pos = s.RBracePos
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
p.requestSpace()
|
p.requestSpace()
|
||||||
|
@ -317,8 +318,8 @@ func (p *printer) printEndOfLineCommentsBefore(pos scanner.Position) {
|
||||||
if len(p.skippedComments) > 0 {
|
if len(p.skippedComments) > 0 {
|
||||||
for _, c := range p.skippedComments {
|
for _, c := range p.skippedComments {
|
||||||
p.printComment(c)
|
p.printComment(c)
|
||||||
|
p._requestNewline()
|
||||||
}
|
}
|
||||||
p._requestNewline()
|
|
||||||
p.skippedComments = nil
|
p.skippedComments = nil
|
||||||
}
|
}
|
||||||
for p.curComment < len(p.comments) && p.comments[p.curComment].Pos().Line < pos.Line {
|
for p.curComment < len(p.comments) && p.comments[p.curComment].Pos().Line < pos.Line {
|
||||||
|
@ -406,7 +407,9 @@ func (p *printer) printComment(cg *CommentGroup) {
|
||||||
p._requestNewline()
|
p._requestNewline()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.pos = comment.End()
|
if p.pos.Offset < comment.End().Offset {
|
||||||
|
p.pos = comment.End()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -281,7 +281,6 @@ module // test
|
||||||
output: `
|
output: `
|
||||||
// test
|
// test
|
||||||
module { // test
|
module { // test
|
||||||
|
|
||||||
srcs: [
|
srcs: [
|
||||||
"src1.c",
|
"src1.c",
|
||||||
"src2.c",
|
"src2.c",
|
||||||
|
@ -356,9 +355,7 @@ test // test
|
||||||
`,
|
`,
|
||||||
output: `
|
output: `
|
||||||
test { // test
|
test { // test
|
||||||
|
|
||||||
// test
|
// test
|
||||||
|
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
@ -598,12 +595,10 @@ foo {
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
// TODO(b/323382414): This shouldn't have an empty newline after stuff
|
|
||||||
output: `
|
output: `
|
||||||
// test
|
// test
|
||||||
foo {
|
foo {
|
||||||
stuff: "c2", // test2
|
stuff: "c2", // test2
|
||||||
|
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue