mirror of
https://github.com/golang/go
synced 2024-11-13 17:10:21 -07:00
re-export of bools was changing
format from hex to decimal, confusing ar's strcmp-based value comparison. switched export format to "true" or "false" to keep bools separate from ints. R=ken OCL=22944 CL=22944
This commit is contained in:
parent
794efd7e78
commit
dec12d3654
@ -119,9 +119,9 @@ dumpexportconst(Sym *s)
|
||||
Bprint(bout, "export ");
|
||||
else if(s->export == 2)
|
||||
Bprint(bout, "package ");
|
||||
Bprint(bout, "const %lS ", s);
|
||||
Bprint(bout, "const %lS", s);
|
||||
if(t != T)
|
||||
Bprint(bout, "%#T ", t);
|
||||
Bprint(bout, " %#T", t);
|
||||
Bprint(bout, " = ");
|
||||
|
||||
switch(n->val.ctype) {
|
||||
@ -133,7 +133,10 @@ dumpexportconst(Sym *s)
|
||||
Bprint(bout, "%B\n", n->val.u.xval);
|
||||
break;
|
||||
case CTBOOL:
|
||||
Bprint(bout, "0x%llux\n", n->val.u.bval);
|
||||
if(n->val.u.bval)
|
||||
Bprint(bout, "true\n");
|
||||
else
|
||||
Bprint(bout, "false\n");
|
||||
break;
|
||||
case CTFLT:
|
||||
Bprint(bout, "%F\n", n->val.u.fval);
|
||||
|
@ -1969,6 +1969,14 @@ hidden_constant:
|
||||
yyerror("bad negated constant");
|
||||
}
|
||||
}
|
||||
| LTRUE
|
||||
{
|
||||
$$ = booltrue->val;
|
||||
}
|
||||
| LFALSE
|
||||
{
|
||||
$$ = boolfalse->val;
|
||||
}
|
||||
|
||||
hidden_importsym:
|
||||
sym1 '.' sym2
|
||||
|
Loading…
Reference in New Issue
Block a user