Project

General

Profile

Actions

Bug #13971

closed

Ripper changes sexp - class methods

Added by MSP-Greg (Greg L) over 6 years ago. Updated over 6 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.0dev (2017-10-04 trunk 60116) [x64-mingw32]
[ruby-core:83106]

Description

nobu, thank you for the fixes. I apologize; I missed some in the 1st report.

Code:

# frozen_string_literal: true

require 'ripper'
require 'pp'

puts "\n#{RUBY_DESCRIPTION}"

puts         "\nmodule T ; def self.test(w) w ; end ; end"
pp Ripper.sexp('module T ; def self.test(w) w ; end ; end')

puts         "\nmodule T ; def self.<<(w) w ; end ; end"
pp Ripper.sexp('module T ; def self.<<(w) w ; end ; end')

puts         "\nmodule T ; class << self ; def test(w) w ; end ; end ; end"
pp Ripper.sexp('module T ; class << self ; def test(w) w ; end ; end ; end')

puts         "\nmodule T ; class << self ; def <<(w) w ; end ; end ; end"
pp Ripper.sexp('module T ; class << self ; def <<(w) w ; end ; end ; end')

Distinction as to 'self':

svn 60116
[:var_ref, :self]

svn 60101
[:var_ref, [:@kw, "self", [1, 15]]]

I'm finding these by running YARD, which uses Ripper for both its parsing and code highlighting. I know RDoc is/has changed over to using Ripper for parsing.

Hence, I'm not sure if these are expected 'breaking' changes or things that are not picked up in current Ripper tests...

Full output in attached files for 60101 and 60116.


Files

60116.txt (1.92 KB) 60116.txt MSP-Greg (Greg L), 10/04/2017 03:18 PM
60101.txt (1.99 KB) 60101.txt MSP-Greg (Greg L), 10/04/2017 03:18 PM
Actions

Also available in: Atom PDF

Like0
Like0