Rename $(etc) to [etc]

This commit is contained in:
Nigel Tao committed 2018-08-18 10:11:43 +10:00
1 parent 4e7ef5fb88
commit c1af1e2c82
14 files changed
+44 -42

No files matched your search

+1 -1
View File
@@ -328,7 +328,7 @@ const MaxExprDepth = 255
//
// For selectors, like "LHS.ID2", ID0 is IDDot.
//
// For lists, like "$(0, 1, 2)", ID0 is IDDollar.
// For lists, like "[0, 1, 2]", ID0 is IDComma.
//
// For statuses like "?foo" and bar."$baz", ID0 is IDStatus, ID1 is the package
// and ID2 is the message.
+3 -3
View File
@@ -126,15 +126,15 @@ func (n *Expr) appendStr(buf []byte, tm *t.Map, parenthesize bool, depth uint32)
buf = append(buf, '.')
buf = append(buf, tm.ByID(n.id2)...)
case t.IDDollar:
buf = append(buf, "$("...)
case t.IDComma:
buf = append(buf, '[')
for i, o := range n.list0 {
if i != 0 {
buf = append(buf, ", "...)
}
buf = o.AsExpr().appendStr(buf, tm, false, depth)
}
buf = append(buf, ')')
buf = append(buf, ']')
}
}