merge revision(s) 35644:

* parse.y (f_arglist): should reset lexical states after empty
	  argument list with no parenthesis as well as parenthesized list,
	  so that reserved name method definition work.  [ruby-dev:45626]
	  [Bug #6403]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2012-05-25 01:36:52 +00:00
parent 915cbd051a
commit 046883d2ca
4 changed files with 17 additions and 3 deletions

View file

@ -1,3 +1,10 @@
Fri May 25 10:36:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (f_arglist): should reset lexical states after empty
argument list with no parenthesis as well as parenthesized list,
so that reserved name method definition work. [ruby-dev:45626]
[Bug #6403]
Mon May 21 16:24:40 2012 Akinori MUSHA <knu@iDaemons.org> Mon May 21 16:24:40 2012 Akinori MUSHA <knu@iDaemons.org>
* ext/syslog/syslog.c (mSyslog_inspect): Use rb_sprintf(). * ext/syslog/syslog.c (mSyslog_inspect): Use rb_sprintf().

View file

@ -4374,6 +4374,8 @@ f_arglist : '(' f_args rparen
| f_args term | f_args term
{ {
$$ = $1; $$ = $1;
lex_state = EXPR_BEG;
command_start = TRUE;
} }
; ;

View file

@ -52,6 +52,11 @@ class TestSyntax < Test::Unit::TestCase
f.close! f.close!
end end
def test_reserved_method_no_args
bug6403 = '[ruby-dev:45626]'
assert_valid_syntax("def self; :foo; end", __FILE__, bug6403)
end
private private
def make_tmpsrc(f, src) def make_tmpsrc(f, src)

View file

@ -1,10 +1,10 @@
#define RUBY_VERSION "1.9.3" #define RUBY_VERSION "1.9.3"
#define RUBY_PATCHLEVEL 226 #define RUBY_PATCHLEVEL 227
#define RUBY_RELEASE_DATE "2012-05-21" #define RUBY_RELEASE_DATE "2012-05-25"
#define RUBY_RELEASE_YEAR 2012 #define RUBY_RELEASE_YEAR 2012
#define RUBY_RELEASE_MONTH 5 #define RUBY_RELEASE_MONTH 5
#define RUBY_RELEASE_DAY 21 #define RUBY_RELEASE_DAY 25
#include "ruby/version.h" #include "ruby/version.h"