diff --git a/ChangeLog b/ChangeLog index 5169378054..897f8d7db6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Aug 11 11:53:28 2015 Nobuyoshi Nakada + + * parse.y (superclass): make superclass rule optional and allow + any contents without a terminator. [EXPERIMENTAL] + Tue Aug 11 10:58:42 2015 Juanito Fatas * string.c: [DOC] Make #end_with? example doc symmetry diff --git a/parse.y b/parse.y index 3123e60498..3975e513c3 100644 --- a/parse.y +++ b/parse.y @@ -4465,15 +4465,7 @@ backref : tNTH_REF | tBACK_REF ; -superclass : term - { - /*%%%*/ - $$ = 0; - /*% - $$ = Qnil; - %*/ - } - | '<' +superclass : '<' { lex_state = EXPR_BEG; command_start = TRUE; @@ -4482,13 +4474,11 @@ superclass : term { $$ = $3; } - | error term + | /* none */ { /*%%%*/ - yyerrok; $$ = 0; /*% - yyerrok; $$ = Qnil; %*/ } diff --git a/test/rdoc/test_rdoc_markup_to_html.rb b/test/rdoc/test_rdoc_markup_to_html.rb index 1e4b84fe9e..dbbd287188 100644 --- a/test/rdoc/test_rdoc_markup_to_html.rb +++ b/test/rdoc/test_rdoc_markup_to_html.rb @@ -619,6 +619,7 @@ class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase 'def x() end', 'def x; end', 'class C; end', + 'class C end', "module M end", 'a # => blah', 'x { |y| nil }', @@ -629,7 +630,6 @@ class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase ] invalid_syntax = [ 'def x end', - 'class C end', 'class C < end', 'module M < C end', 'a=># blah', diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 80d09c1e7b..673b0e7b74 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -206,9 +206,9 @@ class TestParse < Test::Unit::TestCase END end - assert_raise(SyntaxError) do + assert_nothing_raised(SyntaxError) do eval <<-END, nil, __FILE__, __LINE__+1 - class Foo Bar; end + class Foo 1; end END end end