Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

FunctionDatabase cleanup

  • Loading branch information...
commit 8f9e781166f0a42c639a27954312b61d019be8fa 1 parent c9e21cd
@quix authored
View
4 lib/pure/pure_private/driver.rb
@@ -6,15 +6,13 @@
module Pure
module PurePrivate
module Driver
- include FunctionDatabase
-
module_function
def build_and_compute(mod, root, num_threads, &block)
begin
CompTree.build do |driver|
mod.ancestors.each { |ancestor|
- if defs = FUNCTION_DATABASE[ancestor]
+ if defs = FunctionDatabase[ancestor]
defs.each_pair { |function_name, spec|
existing_node = driver.nodes[function_name]
if existing_node.nil? or existing_node.function.nil?
View
8 lib/pure/pure_private/function_database.rb
@@ -1,10 +1,8 @@
module Pure
module PurePrivate
- module FunctionDatabase
- FUNCTION_DATABASE = Hash.new { |hash, key|
- hash[key] = Hash.new
- }
- end
+ FunctionDatabase = Hash.new { |hash, key|
+ hash[key] = Hash.new
+ }
end
end
View
6 lib/pure/pure_private/singleton_features.rb
@@ -7,8 +7,6 @@
module Pure
module PurePrivate
module SingletonFeatures
- include FunctionDatabase
-
def compute(root, opts)
Driver.create_instance_and_compute(self, root, opts)
end
@@ -44,7 +42,7 @@ def fun(*args, &block)
define_method(node_sym, &block)
}
spec = Extractor.extract(fun_mod, :fun, caller)
- FUNCTION_DATABASE[fun_mod][node_sym] = spec.merge(
+ FunctionDatabase[fun_mod][node_sym] = spec.merge(
:name => node_sym,
:args => child_syms,
:origin => :fun
@@ -53,7 +51,7 @@ def fun(*args, &block)
end
def method_added(function_name)
- FUNCTION_DATABASE[self][function_name] = (
+ FunctionDatabase[self][function_name] = (
Extractor.extract(self, function_name, caller).merge(:origin => :def)
)
end
Please sign in to comment.
Something went wrong with that request. Please try again.