lib/ceml/script.rb in ceml-0.6.4 vs lib/ceml/script.rb in ceml-0.7.0

- old
+ new

@@ -4,14 +4,10 @@ # =========== # = casting = # =========== - def fits? candidate - roles_to_cast.any?{ |r| r.fits? candidate } - end - def roles_to_cast return [] unless cast.type == :await return cast.roles_to_cast(self) end @@ -112,11 +108,14 @@ return instructions.for(expand_roles(roles)) end def bytecode code = [[[:all], :start]] - return [[[:all], :null_assign], [[:all], :complete_assign]] if !instructions and title - instructions.list.each{ |inst| code.concat inst.bytecode } if instructions + if !instructions and title + code.concat [[[:all], :null_assign], [[:all], :complete_assign]] + elsif instructions + instructions.list.each{ |inst| code.concat inst.bytecode } if instructions + end code << [[:all], :finish] code end def asks(roles)