Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

improve ripper documentation #219

Closed
wants to merge 1 commit into from

2 participants

@oscardelben

No description provided.

@marcandre
Collaborator

This issue was solved with changeset r38273.
Oscar, thank you for this pull request.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

@marcandre marcandre closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 8, 2012
  1. @oscardelben
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 1 deletion.
  1. +7 −1 ext/ripper/lib/ripper/lexer.rb
View
8 ext/ripper/lib/ripper/lexer.rb
@@ -13,6 +13,12 @@
class Ripper
# Tokenizes the Ruby program and returns an Array of String.
+ #
+ # require 'ripper'
+ # require 'pp'
+ #
+ # pp 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 +29,7 @@ def Ripper.tokenize(src, filename = '-', lineno = 1)
# 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" ],
Something went wrong with that request. Please try again.