From c93cef8c8c45b8a3d7518707613f165b97766c67 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 27 Oct 2013 18:14:15 +0900 Subject: [PATCH] do not wrap with a begin read expressions if it is single --- src/parse.y | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/parse.y b/src/parse.y index 4b46dae6..fdf6247d 100644 --- a/src/parse.y +++ b/src/parse.y @@ -46,7 +46,14 @@ void yylex_destroy(); program : program_data { - p->value = pic_cons(p->pic, p->pic->sBEGIN, $1); + /* if single? */ + if (pic_eq_p(p->pic, pic_cdr(p->pic, $1), pic_nil_value())) { + p->value = pic_car(p->pic, $1); + } + /* if multiple? */ + else { + p->value = pic_cons(p->pic, p->pic->sBEGIN, $1); + } } | incomplete_program_data {