Rename [i..j] to [i ..= j], the same as Rust

This commit is contained in:
Nigel Tao committed 2019-10-12 18:40:53 +11:00
1 parent 18c6e5716a
commit d501daddc3
18 files changed
+219 -206

No files matched your search

+9 -3
View File
@@ -234,9 +234,15 @@ func (n *TypeExpr) appendStr(buf []byte, tm *t.Map, depth uint32) []byte {
}
if n.Min() != nil || n.Max() != nil {
buf = append(buf, '[')
buf = n.Min().appendStr(buf, tm, false, 0)
buf = append(buf, ".."...)
buf = n.Max().appendStr(buf, tm, false, 0)
if n.Min() != nil {
buf = n.Min().appendStr(buf, tm, false, 0)
buf = append(buf, ' ')
}
buf = append(buf, "..="...)
if n.Max() != nil {
buf = append(buf, ' ')
buf = n.Max().appendStr(buf, tm, false, 0)
}
buf = append(buf, ']')
}
return buf