update parser since not we run 2.4+
also update the statistics gatherer
This commit is contained in:
parent
eec72a9fca
commit
0a75e8c3ba
@ -8,7 +8,7 @@ PATH
|
||||
remote: .
|
||||
specs:
|
||||
rubyx (0.6.0)
|
||||
parser (~> 2.3.0)
|
||||
parser (~> 2.4.0)
|
||||
rx-file (~> 0.3)
|
||||
|
||||
GEM
|
||||
@ -60,8 +60,8 @@ GEM
|
||||
notiffany (0.1.1)
|
||||
nenv (~> 0.1)
|
||||
shellany (~> 0.0)
|
||||
parser (2.3.3.1)
|
||||
ast (~> 2.2)
|
||||
parser (2.4.0.2)
|
||||
ast (~> 2.3)
|
||||
pry (0.11.3)
|
||||
coderay (~> 1.1.0)
|
||||
method_source (~> 0.9.0)
|
||||
|
@ -1,12 +1,24 @@
|
||||
require "risc/interpreter"
|
||||
require "parser/ruby22"
|
||||
require 'rubygems'
|
||||
require 'bundler'
|
||||
Bundler.setup(:default, :test)
|
||||
|
||||
require "rubyx"
|
||||
require "parser/current"
|
||||
require "yaml"
|
||||
|
||||
# An experiment to find out how much ruby there is to achieve bootstrap
|
||||
#
|
||||
# currently (jan/2017) just under 150 classes, 1.5k methods , 10k sends, only 10 yields
|
||||
# 1 retry and redo (to be avoided), 4 ensure , 5 rescue
|
||||
#
|
||||
# currently (feb/2019) just over
|
||||
# 173 classes
|
||||
# 1.8k methods
|
||||
# 13k sends
|
||||
# 13 yields (250 blocks)
|
||||
# 1 redo (to be avoided)
|
||||
# 4 ensure
|
||||
# 6 rescue
|
||||
# 38 singleton classes (not in rubyx)
|
||||
# 14 evals (different versions , and all problematic)
|
||||
# and a whole list of every other possible ruby feature
|
||||
class Walker < AST::Processor
|
||||
def initialize collector
|
||||
@collector = collector
|
||||
@ -47,7 +59,7 @@ end
|
||||
class Collector
|
||||
|
||||
def initialize
|
||||
@parser = Parser::Ruby22
|
||||
@parser = Parser::CurrentRuby
|
||||
@paths = Bundler.load.specs.collect { |s| s.gem_dir + "/lib/" }
|
||||
@class_defs = []
|
||||
@const_uses = Hash.new(0)
|
||||
@ -89,7 +101,7 @@ class Collector
|
||||
def print
|
||||
@class_defs.uniq!
|
||||
@files.uniq!
|
||||
puts "Types #{@types.to_yaml}"
|
||||
puts "Types #{@types.sort.to_h.to_yaml}"
|
||||
puts "Class defs #{@class_defs.length}"
|
||||
puts "Class defs #{@class_defs}"
|
||||
puts "evals=#{@evals.length} #{@evals.uniq}"
|
@ -13,6 +13,6 @@ Gem::Specification.new do |s|
|
||||
s.require_paths = ['lib']
|
||||
s.summary = 'RubyX is a native object vm without any c, one day possibly a ruby vm'
|
||||
|
||||
s.add_dependency "parser" , "~> 2.3.0"
|
||||
s.add_dependency "parser" , "~> 2.4.0"
|
||||
s.add_dependency "rx-file" , "~> 0.3"
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user