small collector change

This commit is contained in:
Torsten Ruger 2016-12-08 15:19:37 +02:00
parent c361b74541
commit c3a28d2abc
3 changed files with 7 additions and 6 deletions

View File

@ -9,7 +9,6 @@ AST::Node.class_eval do
end end
end end
require 'parser/transform'
require "salama-object-file" require "salama-object-file"
require "register" require "register"
require "register/builtin/space" require "register/builtin/space"

View File

@ -11,7 +11,8 @@ class Walker < AST::Processor
def on_send node def on_send node
_ , method , file_node = *node _ , method , file_node = *node
if method == :require if method == :require
@collector.load file_node.children[0] + ".rb" file = file_node.children[0]
@collector.load("#{file}.rb") unless file.include?("parslet")
end end
if method == :require_relative if method == :require_relative
@collector.load File.dirname(@collector.current) + "/" + file_node.children[0] + ".rb" @collector.load File.dirname(@collector.current) + "/" + file_node.children[0] + ".rb"
@ -68,7 +69,7 @@ class Collector
def run def run
load "salama.rb" load "salama.rb"
load "parser/ruby22.rb" load "parser/ruby22.rb"
load "../../../.rbenv/versions/2.2.3/lib/ruby/2.2.0/racc/parser.rb" # load "../../../.rbenv/versions/2.2.3/lib/ruby/2.2.0/racc/parser.rb"
print print
end end
@ -84,10 +85,11 @@ class Collector
def print def print
@class_defs.uniq! @class_defs.uniq!
@files.uniq! @files.uniq!
puts "Class defs #{@class_defs.length}"
puts "Types #{@types.to_yaml}" puts "Types #{@types.to_yaml}"
puts "Class defs #{@class_defs.length}"
puts "Class defs #{@class_defs}"
puts "evals=#{@evals.length} #{@evals.uniq}" puts "evals=#{@evals.length} #{@evals.uniq}"
#puts "Not found #{@not_found.length} #{@not_found}" puts "Not found #{@not_found.length} #{@not_found}"
end end
end end

View File

@ -10,6 +10,6 @@ module MelonTests
def check def check
assert true assert true
puts @parser.parse @string_input #puts @parser.parse @string_input
end end
end end