Introduce "array[N] T" and "slice T" type syntax

This commit is contained in:
Nigel Tao committed 2018-04-05 22:21:08 +10:00
1 parent 2b91e7861c
commit d33db6dae0
15 files changed
+83 -68

No files matched your search

+2 -2
View File
@@ -212,12 +212,12 @@ func (n *TypeExpr) appendStr(buf []byte, tm *t.Map, depth uint32) []byte {
buf = append(buf, "ptr "...)
return n.Inner().appendStr(buf, tm, depth)
case t.KeyArray:
buf = append(buf, '[')
buf = append(buf, "array["...)
buf = n.ArrayLength().appendStr(buf, tm, false, 0)
buf = append(buf, "] "...)
return n.Inner().appendStr(buf, tm, depth)
case t.KeySlice:
buf = append(buf, "[] "...)
buf = append(buf, "slice "...)
return n.Inner().appendStr(buf, tm, depth)
case t.KeyOpenParen:
buf = append(buf, "func "...)