if len(x.Elts) > 0 {
mode |= noExtraBlank
}
- p.print(mode, x.Rbrace, token.RBRACE, mode)
+ // need the initial indent to print lone comments with
+ // the proper level of indentation
+ p.print(indent, unindent, mode, x.Rbrace, token.RBRACE, mode)
p.level--
case *ast.Ellipsis:
*/
}
+var _ = []T{ /* lone comment */ }
+
+var _ = []T{
+ /* lone comment */
+}
+
+var _ = []T{
+ // lone comments
+ // in composite lit
+}
+
+var _ = [][]T{
+ {
+ // lone comments
+ // in composite lit
+ },
+}
+
+// TODO: gofmt doesn't add these tabs; make it so that these golden
+// tests run the printer in a way that it's exactly like gofmt.
+
+var _ = []T{ // lone comment
+}
+
+var _ = []T{ // lone comments
+ // in composite lit
+}
+
/* This comment is the last entry in this file. It must be printed and should be followed by a newline */
*/
}
+var _ = []T{/* lone comment */}
+
+var _ = []T{
+/* lone comment */
+}
+
+var _ = []T{
+// lone comments
+// in composite lit
+}
+
+var _ = [][]T{
+ {
+ // lone comments
+ // in composite lit
+ },
+}
+
+// TODO: gofmt doesn't add these tabs; make it so that these golden
+// tests run the printer in a way that it's exactly like gofmt.
+
+var _ = []T{// lone comment
+}
+
+var _ = []T{// lone comments
+// in composite lit
+}
+
/* This comment is the last entry in this file. It must be printed and should be followed by a newline */
// See Jebelean, "Improving the multiprecision Euclidean algorithm",
// Design and Implementation of Symbolic Computation Systems, pp 45-58.
func (z *Int) lehmerGCD(a, b *Int) *Int {
-
// ensure a >= b
if a.abs.cmp(b.abs) < 0 {
a, b = b, a
// loop invariant A >= B
for len(B.abs) > 1 {
-
// initialize the digits
var a1, a2, u0, u1, u2, v0, v1, v2 Word