Reformat x:y as x: y

This commit is contained in:
Nigel Tao committed 2019-10-12 21:21:39 +11:00
1 parent a9ea63ff06
commit 5b4e3647c0
12 files changed
+195 -196

No files matched your search

+1 -1
View File
@@ -94,7 +94,7 @@ func (n *Expr) appendStr(buf []byte, tm *t.Map, parenthesize bool, depth uint32)
buf = append(buf, ", "...)
}
buf = append(buf, tm.ByID(o.AsArg().Name())...)
buf = append(buf, ':')
buf = append(buf, ": "...)
buf = o.AsArg().Value().appendStr(buf, tm, false, depth)
}
buf = append(buf, ')')
+8 -8
View File
@@ -29,17 +29,17 @@ func TestString(tt *testing.T) {
"x",
"f()",
"f(a:i)",
"f(a:i, b:j)",
"f(a:i, b:j) + 1",
"f(a:i, b:j)(c:k)",
"f(a:i, b:j)(c:k, d:l, e:m + 2) + 3",
"f(a: i)",
"f(a: i, b: j)",
"f(a: i, b: j) + 1",
"f(a: i, b: j)(c: k)",
"f(a: i, b: j)(c: k, d: l, e: m + 2) + 3",
"x[i]",
"x[i][j]",
"x[i .. j]",
"x[i](arg:j)",
"x(arg:i)[j]",
"x[i](arg: j)",
"x(arg: i)[j]",
"x.y",
"x.y.z.a",
@@ -56,7 +56,7 @@ func TestString(tt *testing.T) {
"x * ((a / b) - (i / j))",
"x + y + z",
"x + (i * j.k[l] * (-m << 4) * (n & o(o0:p, o1:q[.. r.s + 5]))) + z",
"x + (i * j.k[l] * (-m << 4) * (n & o(o0: p, o1: q[.. r.s + 5]))) + z",
"x as base.bool",
"x as base.u32",
-1
View File
@@ -1185,5 +1185,4 @@ var isTightRight = [...]bool{
IDDot: true,
IDExclam: true,
IDQuestion: true,
IDColon: true,
}