Commit dec12d36 authored by Russ Cox's avatar Russ Cox

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
parent 794efd7e
...@@ -119,9 +119,9 @@ dumpexportconst(Sym *s) ...@@ -119,9 +119,9 @@ dumpexportconst(Sym *s)
Bprint(bout, "export "); Bprint(bout, "export ");
else if(s->export == 2) else if(s->export == 2)
Bprint(bout, "package "); Bprint(bout, "package ");
Bprint(bout, "const %lS ", s); Bprint(bout, "const %lS", s);
if(t != T) if(t != T)
Bprint(bout, "%#T ", t); Bprint(bout, " %#T", t);
Bprint(bout, " = "); Bprint(bout, " = ");
switch(n->val.ctype) { switch(n->val.ctype) {
...@@ -133,7 +133,10 @@ dumpexportconst(Sym *s) ...@@ -133,7 +133,10 @@ dumpexportconst(Sym *s)
Bprint(bout, "%B\n", n->val.u.xval); Bprint(bout, "%B\n", n->val.u.xval);
break; break;
case CTBOOL: 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; break;
case CTFLT: case CTFLT:
Bprint(bout, "%F\n", n->val.u.fval); Bprint(bout, "%F\n", n->val.u.fval);
......
...@@ -1969,6 +1969,14 @@ hidden_constant: ...@@ -1969,6 +1969,14 @@ hidden_constant:
yyerror("bad negated constant"); yyerror("bad negated constant");
} }
} }
| LTRUE
{
$$ = booltrue->val;
}
| LFALSE
{
$$ = boolfalse->val;
}
hidden_importsym: hidden_importsym:
sym1 '.' sym2 sym1 '.' sym2
......
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