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
require 'parser/transform'
require "salama-object-file"
require "register"
require "register/builtin/space"

View File

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

View File

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