Commit 5baaa490 authored by Russ Cox's avatar Russ Cox

gc: better printing of named constants, func literals

R=ken2
CC=golang-dev
https://golang.org/cl/2121045
parent 889377c5
...@@ -119,6 +119,10 @@ exprfmt(Fmt *f, Node *n, int prec) ...@@ -119,6 +119,10 @@ exprfmt(Fmt *f, Node *n, int prec)
break; break;
case OLITERAL: case OLITERAL:
if(n->sym != S) {
fmtprint(f, "%S", n->sym);
break;
}
switch(n->val.ctype) { switch(n->val.ctype) {
default: default:
goto bad; goto bad;
...@@ -259,6 +263,10 @@ exprfmt(Fmt *f, Node *n, int prec) ...@@ -259,6 +263,10 @@ exprfmt(Fmt *f, Node *n, int prec)
exprfmt(f, n->left, 0); exprfmt(f, n->left, 0);
break; break;
case OCLOSURE:
fmtprint(f, "func literal");
break;
case OCOMPLIT: case OCOMPLIT:
fmtprint(f, "composite literal"); fmtprint(f, "composite literal");
break; break;
......
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