diff options
author | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-09-19 22:17:16 +0000 |
---|---|---|
committer | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-09-19 22:17:16 +0000 |
commit | cca61dafe8f2799994a57f067ea10472992c13b5 (patch) | |
tree | 560d4992037277e588108e34e101fe37d3e35a20 /ext/ripper/lib | |
parent | 0503756fe5e56453ba1e10674615b71cd2c5a554 (diff) | |
download | ruby-cca61dafe8f2799994a57f067ea10472992c13b5.tar.gz |
* ext/ripper/lib/ripper.rb: Documentation for Ripper.
+:void_stmt+ is meaningless
[Bug #6929] [ruby-core:47507]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/ripper/lib')
-rw-r--r-- | ext/ripper/lib/ripper.rb | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/ext/ripper/lib/ripper.rb b/ext/ripper/lib/ripper.rb index 43116c7b8e..96a181b9c6 100644 --- a/ext/ripper/lib/ripper.rb +++ b/ext/ripper/lib/ripper.rb @@ -20,19 +20,18 @@ require 'ripper/sexp' # require 'ripper' # require 'pp' # -# pp Ripper.sexp('def hello(world); "Hello, #{world}!"; end') +# pp Ripper.sexp('def hello(world) "Hello, #{world}!"; end') # #=> [:program, # [[:def, # [:@ident, "hello", [1, 4]], # [:paren, -# [:params, [[:@ident, "world", [1, 10]]], nil, nil, nil, nil, nil, nil]], +# [:params, [[:@ident, "world", [1, 10]]], nil, nil, nil, nil]], # [:bodystmt, -# [[:void_stmt], -# [:string_literal, +# [[:string_literal, # [:string_content, -# [:@tstring_content, "Hello, ", [1, 19]], -# [:string_embexpr, [[:var_ref, [:@ident, "world", [1, 28]]]]], -# [:@tstring_content, "!", [1, 34]]]]], +# [:@tstring_content, "Hello, ", [1, 18]], +# [:string_embexpr, [[:var_ref, [:@ident, "world", [1, 27]]]]], +# [:@tstring_content, "!", [1, 33]]]]], # nil, # nil, # nil]]]] @@ -47,7 +46,7 @@ require 'ripper/sexp' # which contains the full definition of the method. # # In our case, we're simply returning a String, so next we have the -# +:void_stmt+ followed by a +:string_literal+. +# +:string_literal+ expression. # # Within our +:string_literal+ you'll notice two <code>@tstring_content</code>, # this is the literal part for <code>Hello, </code> and <code>!</code>. Between |