* parse.y (superclass): make superclass rule optional and allow
  any contents without a terminator.  [EXPERIMENTAL]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-08-11 02:53:31 +00:00
Родитель 8322c36a9b
Коммит d311b7d0eb
4 изменённых файлов: 10 добавлений и 15 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Tue Aug 11 11:53:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (superclass): make superclass rule optional and allow
any contents without a terminator. [EXPERIMENTAL]
Tue Aug 11 10:58:42 2015 Juanito Fatas <juanitofatas@gmail.com> Tue Aug 11 10:58:42 2015 Juanito Fatas <juanitofatas@gmail.com>
* string.c: [DOC] Make #end_with? example doc symmetry * string.c: [DOC] Make #end_with? example doc symmetry

14
parse.y
Просмотреть файл

@ -4465,15 +4465,7 @@ backref : tNTH_REF
| tBACK_REF | tBACK_REF
; ;
superclass : term superclass : '<'
{
/*%%%*/
$$ = 0;
/*%
$$ = Qnil;
%*/
}
| '<'
{ {
lex_state = EXPR_BEG; lex_state = EXPR_BEG;
command_start = TRUE; command_start = TRUE;
@ -4482,13 +4474,11 @@ superclass : term
{ {
$$ = $3; $$ = $3;
} }
| error term | /* none */
{ {
/*%%%*/ /*%%%*/
yyerrok;
$$ = 0; $$ = 0;
/*% /*%
yyerrok;
$$ = Qnil; $$ = Qnil;
%*/ %*/
} }

Просмотреть файл

@ -619,6 +619,7 @@ class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase
'def x() end', 'def x() end',
'def x; end', 'def x; end',
'class C; end', 'class C; end',
'class C end',
"module M end", "module M end",
'a # => blah', 'a # => blah',
'x { |y| nil }', 'x { |y| nil }',
@ -629,7 +630,6 @@ class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase
] ]
invalid_syntax = [ invalid_syntax = [
'def x end', 'def x end',
'class C end',
'class C < end', 'class C < end',
'module M < C end', 'module M < C end',
'a=># blah', 'a=># blah',

Просмотреть файл

@ -206,9 +206,9 @@ class TestParse < Test::Unit::TestCase
END END
end end
assert_raise(SyntaxError) do assert_nothing_raised(SyntaxError) do
eval <<-END, nil, __FILE__, __LINE__+1 eval <<-END, nil, __FILE__, __LINE__+1
class Foo Bar; end class Foo 1; end
END END
end end
end end