Move vool block compilation into constant generation

When the lambda is passed as argument, it must be moved. This triggers the generation of a corresponding parfait object (as before, and as for other constants) but now also triggers the code build. The code being the constant as it were
Also some more name fixes from renames
This commit is contained in:
2019-08-19 14:33:02 +03:00
parent 3ddf2e3837
commit a722a4c285
7 changed files with 13 additions and 12 deletions

View File

@ -10,12 +10,11 @@ module Vool
# As cache key we must use the type of the object (which is the first word of _every_ object)
# as that is constant, and function implementations depend on the type (not class)
class SendStatement < CallStatement
attr_reader :block
def block
return nil if arguments.empty?
bl = arguments.last
bl.is_a?(BlockStatement) ? bl : nil
bl.is_a?(LambdaExpression) ? bl : nil
end
def add_block( block )