(fixes bugs/bug106)
package bug0
export const A = -1
package bug1
import "bug0"
R=ken
DELTA=21 (19 added, 0 deleted, 2 changed)
OCL=15901
CL=15968
%type <type> structtype interfacetype convtype
%type <type> Achantype Bchantype
+%type <val> hidden_constant
+
%left LOROR
%left LANDAND
%left LCOMM
}
/* constants */
-| LCONST hidden_importsym LLITERAL
+| LCONST hidden_importsym hidden_constant
{
doimportc1($2, &$3);
}
-| LCONST hidden_importsym hidden_importsym LLITERAL
+| LCONST hidden_importsym hidden_importsym hidden_constant
{
doimportc2($2, $3, &$4);
}
doimport9($2, $3);
}
+hidden_constant:
+ LLITERAL
+| '-' LLITERAL
+ {
+ $$ = $2;
+ switch($$.ctype){
+ case CTINT:
+ mpnegfix($$.u.xval);
+ break;
+ case CTFLT:
+ mpnegflt($$.u.fval);
+ break;
+ default:
+ yyerror("bad negated constant");
+ }
+ }
+
isym:
sym1 '.' sym2
{