From c080fb6d10bbcb697b6ba16e640de8db3f1973d0 Mon Sep 17 00:00:00 2001 From: Yukihiro Matsumoto Date: Thu, 9 Feb 1995 16:18:37 +0900 Subject: version 0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://cache.ruby-lang.org/pub/ruby/1.0/ruby-0.65-0.66.diff.gz Thu Feb 9 16:18:37 1995 Yukihiro Matsumoto (matz@ix-02) * version 0.66 * parse.y: protectをbeginに変更.begin..endは例外処理だけでなく, 文括弧としても働くことになった. --- parse.y | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 7c84221c8c..7dabc5d2fe 100644 --- a/parse.y +++ b/parse.y @@ -90,6 +90,10 @@ static void setup_top_local(); DEF UNDEF INCLUDE + BEGIN + RESQUE + ENSURE + END IF THEN ELSIF @@ -99,10 +103,6 @@ static void setup_top_local(); WHILE FOR IN - PROTECT - RESQUE - ENSURE - END REDO BREAK CONTINUE @@ -762,18 +762,17 @@ primary : literal value_expr($4); $$ = NEW_FOR($2, $4, $6); } - | PROTECT + | BEGIN compexpr resque ensure END { if ($3 == Qnil && $4 == Qnil) { - Warning("useless protect clause"); $$ = $2; } else { - $$ = NEW_PROT($2, $3, $4); + $$ = NEW_BEGIN($2, $3, $4); } } | LPAREN compexpr rparen @@ -1312,6 +1311,7 @@ static struct kwtable { "__LINE__", _LINE_, EXPR_END, "alias", ALIAS, EXPR_FNAME, "and", AND, EXPR_BEG, + "begin", BEGIN, EXPR_BEG, "break", BREAK, EXPR_END, "case", CASE, EXPR_BEG, "class", CLASS, EXPR_BEG, @@ -1329,7 +1329,6 @@ static struct kwtable { "module", MODULE, EXPR_BEG, "nil", NIL, EXPR_END, "or", OR, EXPR_BEG, - "protect", PROTECT, EXPR_BEG, "redo", REDO, EXPR_END, "resque", RESQUE, EXPR_BEG, "retry", RETRY, EXPR_END, -- cgit v1.2.3