add Item#closed_items
This commit is contained in:
parent
d931bcb513
commit
e4f2fffe50
@ -27,6 +27,16 @@ class Imbecile
|
|||||||
self == other
|
self == other
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def closed_items
|
||||||
|
if @rule.components[@position].is_a?(Array)
|
||||||
|
@rule.components[@position].map do |rule|
|
||||||
|
Item.new(rule, 0)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
[]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -13,8 +13,7 @@ class Imbecile
|
|||||||
this_eval_items = eval_items
|
this_eval_items = eval_items
|
||||||
eval_items = Set.new
|
eval_items = Set.new
|
||||||
this_eval_items.each do |item|
|
this_eval_items.each do |item|
|
||||||
if item.next_component.is_a?(Rule)
|
eval_items += item.closed_items
|
||||||
end
|
|
||||||
end
|
end
|
||||||
@items += eval_items
|
@items += eval_items
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user