fix -expr handling. generates sucky code atm, but at least it's generating

code now:P
This commit is contained in:
Bill Currie 2001-07-25 18:36:36 +00:00
parent 638cd005b0
commit 0c2cd8633c
2 changed files with 20 additions and 18 deletions

View file

@ -1233,6 +1233,8 @@ emit_sub_expr (expr_t *e, def_t *dest)
} else {
abort ();
}
if (!dest)
dest = PR_GetTempDef (e->e.expr.type, pr_scope);
op = PR_Opcode_Find (operator, priority, def_a, def_b, dest);
return emit_statement (e->line, op, def_a, def_b, dest);
case ex_def:

View file

@ -445,7 +445,7 @@ expr
| expr '(' arg_list ')' { $$ = function_expr ($1, $3); }
| expr '(' ')' { $$ = function_expr ($1, 0); }
| expr '.' expr { $$ = binary_expr ('.', $1, $3); }
| '-' expr { $$ = unary_expr ('-', $2); }
| '-' expr %prec '!' { $$ = unary_expr ('-', $2); }
| '!' expr { $$ = unary_expr ('!', $2); }
| NAME
{