* Copyright (c) 1983 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
static char sccsid
[] = "@(#)parser5.c 3.11 (Berkeley) 6/29/88";
register struct value
*v
;
return p_expr12(v
, flag
);
if (p_expr11(v
, flag
) < 0)
p_error("%s: Numeric operand required.", opname
);
if (v
->v_type
== V_NUM
) {
int tmp
= cx
.x_type
== X_BUF
&& cx
.x_arg
!= 0 &&
v
->v_num
> 0 && v
->v_num
<= cx
.x_narg
;
*v
= cx
.x_arg
[v
->v_num
- 1];
p_error("%d: No such argument.", v
->v_num
);
struct var
*r
= var_lookup(name
);
p_error("%s: Undefined variable.", name
);
if (v
->v_type
== V_STR
&& (v
->v_str
= str_cpy(v
->v_str
)) == 0) {
* string, number, ( expr )
* Always return v_type == V_ERR when flag == 0.
register struct value
*v
;
if (p_expr(v
, flag
) < 0) {
cmd
= v
->v_type
== V_STR
? v
->v_str
: 0;
if (p_function(cmd
, v
, flag
) < 0) {