[前][次][番号順一覧][スレッド一覧]

ruby-changes:26216

From: marcandre <ko1@a...>
Date: Sat, 8 Dec 2012 16:06:33 +0900 (JST)
Subject: [ruby-changes:26216] marcandRe: r38273 (trunk): Improve rdoc for Ripper, based on a patch by Oscar Del Ben

marcandre	2012-12-08 16:06:24 +0900 (Sat, 08 Dec 2012)

  New Revision: 38273

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38273

  Log:
    Improve rdoc for Ripper, based on a patch by Oscar Del Ben [github:219]

  Modified files:
    trunk/ext/ripper/lib/ripper/lexer.rb

Index: ext/ripper/lib/ripper/lexer.rb
===================================================================
--- ext/ripper/lib/ripper/lexer.rb	(revision 38272)
+++ ext/ripper/lib/ripper/lexer.rb	(revision 38273)
@@ -13,6 +13,10 @@
 class Ripper
 
   # Tokenizes the Ruby program and returns an Array of String.
+  #
+  #   p Ripper.tokenize("def m(a) nil end")
+  #      # => ["def", " ", "m", "(", "a", ")", " ", "nil", " ", "end"]
+  #
   def Ripper.tokenize(src, filename = '-', lineno = 1)
     Lexer.new(src, filename, lineno).tokenize
   end
@@ -23,7 +27,7 @@
   #   require 'ripper'
   #   require 'pp'
   #
-  #   p Ripper.lex("def m(a) nil end")
+  #   pp Ripper.lex("def m(a) nil end")
   #     #=> [[[1,  0], :on_kw,     "def"],
   #          [[1,  3], :on_sp,     " "  ],
   #          [[1,  4], :on_ident,  "m"  ],

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]