ruby-changes:52980
From: yui-knk <ko1@a...>
Date: Sat, 20 Oct 2018 13:41:26 +0900 (JST)
Subject: [ruby-changes:52980] yui-knk:r65194 (trunk): ast.c: Fix the documents of `RubyVM::AST.parse` and `RubyVM::AST.parse_file`
yui-knk 2018-10-20 13:41:19 +0900 (Sat, 20 Oct 2018) New Revision: 65194 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65194 Log: ast.c: Fix the documents of `RubyVM::AST.parse` and `RubyVM::AST.parse_file` * ast.c: r63602 fixed to raise `SyntaxError` when `RubyVM::AST.parse` or `RubyVM::AST.parse_file` fail to parse input. Modified files: trunk/ast.c Index: ast.c =================================================================== --- ast.c (revision 65193) +++ ast.c (revision 65194) @@ -58,7 +58,7 @@ ast_new_internal(rb_ast_t *ast, NODE *no https://github.com/ruby/ruby/blob/trunk/ast.c#L58 * Parses the given string into an abstract syntax tree, * returning the root node of that tree. * - * Returns <code>nil</code> if the given string is invalid syntax. + * SyntaxError is raised if the given string is invalid syntax. * * RubyVM::AST.parse("x = 1 + 2") * # => #<RubyVM::AST::Node(NODE_SCOPE(0) 1:0, 1:9): > @@ -92,7 +92,7 @@ rb_ast_s_parse(VALUE module, VALUE str) https://github.com/ruby/ruby/blob/trunk/ast.c#L92 * Reads the file from <code>pathname</code>, then parses it like ::parse, * returning the root node of the abstract syntax tree. * - * Returns <code>nil</code> if <code>pathname</code>'s contents are not + * SyntaxError is raised if <code>pathname</code>'s contents are not * valid Ruby syntax. * * RubyVM::AST.parse_file("my-app/app.rb") -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/