39 |
list_t list; |
list_t list; |
40 |
size_t pc; |
size_t pc; |
41 |
struct { |
struct { |
42 |
|
size_t start; |
43 |
|
size_t end; |
44 |
|
} pclist; |
45 |
|
struct { |
46 |
char *ident; |
char *ident; |
47 |
list_t args; |
list_t args; |
48 |
} command; |
} command; |
61 |
%type <value> arg |
%type <value> arg |
62 |
%type <list> slist stringlist stringorlist arglist maybe_arglist |
%type <list> slist stringlist stringorlist arglist maybe_arglist |
63 |
%type <command> command |
%type <command> command |
64 |
%type <number> testlist |
%type <pclist> testlist |
65 |
%type <pc> action test statement list elsif else cond begin if block |
%type <pc> action test statement list elsif else cond begin if block |
66 |
%type <branch> elsif_branch maybe_elsif else_part |
%type <branch> elsif_branch maybe_elsif else_part |
67 |
|
|
175 |
|
|
176 |
testlist : cond_expr |
testlist : cond_expr |
177 |
{ |
{ |
178 |
if (sieve_code_instr (instr_push)) |
$$.start = $$.end = sieve_machine->pc; |
179 |
|
if (sieve_code_instr (instr_brz) |
180 |
|
|| sieve_code_number (0)) |
181 |
YYERROR; |
YYERROR; |
|
$$ = 1; |
|
182 |
} |
} |
183 |
| testlist ',' cond_expr |
| testlist ',' cond_expr |
184 |
{ |
{ |
185 |
if (sieve_code_instr (instr_push)) |
sieve_machine->prog[$1.end+1].pc = sieve_machine->pc; |
186 |
|
$1.end = sieve_machine->pc; |
187 |
|
if (sieve_code_instr (instr_brz) |
188 |
|
|| sieve_code_number (0)) |
189 |
YYERROR; |
YYERROR; |
190 |
$$ = $1 + 1; |
$$ = $1; |
191 |
} |
} |
192 |
; |
; |
193 |
|
|
203 |
{ /* to placate bison */ } |
{ /* to placate bison */ } |
204 |
| ANYOF '(' testlist ')' |
| ANYOF '(' testlist ')' |
205 |
{ |
{ |
206 |
if (sieve_code_instr (instr_anyof) |
sieve_code_anyof ($3.start); |
|
|| sieve_code_number ($3)) |
|
|
YYERROR; |
|
207 |
} |
} |
208 |
| ALLOF '(' testlist ')' |
| ALLOF '(' testlist ')' |
209 |
{ |
{ |
210 |
if (sieve_code_instr (instr_allof) |
sieve_code_allof ($3.start); |
|
|| sieve_code_number ($3)) |
|
|
YYERROR; |
|
211 |
} |
} |
212 |
| NOT cond_expr |
| NOT cond_expr |
213 |
{ |
{ |