Commit 18ee75ec authored by Luuk van Dijk's avatar Luuk van Dijk

gc: handle printing of string/arrayrune conversions

Fixes #2714.

R=rsc
CC=golang-dev
https://golang.org/cl/5540066
parent 436b37d8
......@@ -943,6 +943,7 @@ static int opprec[] = {
[OAPPEND] = 8,
[OARRAYBYTESTR] = 8,
[OARRAYLIT] = 8,
[OARRAYRUNESTR] = 8,
[OCALLFUNC] = 8,
[OCALLINTER] = 8,
[OCALLMETH] = 8,
......@@ -969,6 +970,8 @@ static int opprec[] = {
[OPRINT] = 8,
[ORECV] = 8,
[ORUNESTR] = 8,
[OSTRARRAYBYTE] = 8,
[OSTRARRAYRUNE] = 8,
[OSTRUCTLIT] = 8,
[OTARRAY] = 8,
[OTCHAN] = 8,
......@@ -1214,7 +1217,9 @@ exprfmt(Fmt *f, Node *n, int prec)
case OCONVIFACE:
case OCONVNOP:
case OARRAYBYTESTR:
case OARRAYRUNESTR:
case OSTRARRAYBYTE:
case OSTRARRAYRUNE:
case ORUNESTR:
if(n->type == T || n->type->sym == S)
return fmtprint(f, "(%T)(%N)", n->type, n->left);
......@@ -1372,7 +1377,8 @@ nodedump(Fmt *fp, Node *n)
indent(fp);
}
}
fmtprint(fp, "[%p]", n);
// fmtprint(fp, "[%p]", n);
switch(n->op) {
default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment