>ruby E:\r_misc\ripper.rb

ruby 2.5.0dev (2017-10-02 trunk 60101) [x64-mingw32]

module T ; def self.test(w) w; end ; end
[:program,
 [[:module,
   [:const_ref, [:@const, "T", [1, 7]]],
   [:bodystmt,
    [[:void_stmt],
     [:defs,
      [:var_ref, [:@kw, "self", [1, 15]]],
      [:@period, ".", [1, 19]],
      [:@ident, "test", [1, 20]],
      [:paren,
       [:params, [[:@ident, "w", [1, 25]]], nil, nil, nil, nil, nil, nil]],
      [:bodystmt, [[:var_ref, [:@ident, "w", [1, 28]]]], nil, nil, nil]]],
    nil,
    nil,
    nil]]]]

module T ; def self.<<(w) w; end ; end
[:program,
 [[:module,
   [:const_ref, [:@const, "T", [1, 7]]],
   [:bodystmt,
    [[:void_stmt],
     [:defs,
      [:var_ref, [:@kw, "self", [1, 15]]],
      [:@period, ".", [1, 19]],
      [:@op, "<<", [1, 20]],
      [:paren,
       [:params, [[:@ident, "w", [1, 23]]], nil, nil, nil, nil, nil, nil]],
      [:bodystmt, [[:var_ref, [:@ident, "w", [1, 26]]]], nil, nil, nil]]],
    nil,
    nil,
    nil]]]]

module T ; class << self ; def test(w) w; end ; end ; end
[:program,
 [[:module,
   [:const_ref, [:@const, "T", [1, 7]]],
   [:bodystmt,
    [[:void_stmt],
     [:sclass,
      [:var_ref, [:@kw, "self", [1, 20]]],
      [:bodystmt,
       [[:def,
         [:@ident, "test", [1, 31]],
         [:paren,
          [:params, [[:@ident, "w", [1, 36]]], nil, nil, nil, nil, nil, nil]],
         [:bodystmt, [[:var_ref, [:@ident, "w", [1, 39]]]], nil, nil, nil]]],
       nil,
       nil,
       nil]]],
    nil,
    nil,
    nil]]]]

module T ; class << self ; def <<(w) w; end ; end ;  end
[:program,
 [[:module,
   [:const_ref, [:@const, "T", [1, 7]]],
   [:bodystmt,
    [[:void_stmt],
     [:sclass,
      [:var_ref, [:@kw, "self", [1, 20]]],
      [:bodystmt,
       [[:def,
         [:@op, "<<", [1, 31]],
         [:paren,
          [:params, [[:@ident, "w", [1, 34]]], nil, nil, nil, nil, nil, nil]],
         [:bodystmt, [[:var_ref, [:@ident, "w", [1, 37]]]], nil, nil, nil]]],
       nil,
       nil,
       nil]]],
    nil,
    nil,
    nil]]]]
