read multiple expressions; read exprs are wrapped in a begin
This commit is contained in:
parent
14dcb63c33
commit
40a2568142
23
src/parse.y
23
src/parse.y
|
@ -37,23 +37,40 @@ void yylex_destroy();
|
||||||
%token tQUOTE tQUASIQUOTE tUNQUOTE tUNQUOTE_SPLICING
|
%token tQUOTE tQUASIQUOTE tUNQUOTE tUNQUOTE_SPLICING
|
||||||
%token <datum> tSYMBOL tNUMBER tBOOLEAN tSTRING
|
%token <datum> tSYMBOL tNUMBER tBOOLEAN tSTRING
|
||||||
|
|
||||||
|
%type <datum> program_data
|
||||||
%type <datum> datum simple_datum compound_datum abbrev
|
%type <datum> datum simple_datum compound_datum abbrev
|
||||||
%type <datum> list list_data
|
%type <datum> list list_data
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
program
|
program
|
||||||
: datum
|
: program_data
|
||||||
{
|
{
|
||||||
p->value = $1;
|
p->value = pic_cons(p->pic, p->pic->sBEGIN, $1);
|
||||||
}
|
}
|
||||||
| incomplete_datum
|
| incomplete_program_data
|
||||||
{
|
{
|
||||||
p->incomp = true;
|
p->incomp = true;
|
||||||
p->value = pic_undef_value();
|
p->value = pic_undef_value();
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
program_data
|
||||||
|
: datum
|
||||||
|
{
|
||||||
|
$$ = pic_cons(p->pic, $1, pic_nil_value());
|
||||||
|
}
|
||||||
|
| datum program_data
|
||||||
|
{
|
||||||
|
$$ = pic_cons(p->pic, $1, $2);
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
|
incomplete_program_data
|
||||||
|
: incomplete_datum
|
||||||
|
| datum incomplete_program_data
|
||||||
|
;
|
||||||
|
|
||||||
datum
|
datum
|
||||||
: simple_datum
|
: simple_datum
|
||||||
| compound_datum
|
| compound_datum
|
||||||
|
|
Loading…
Reference in New Issue