lib/ruote/exp/fe_define.rb in ruote-2.1.11 vs lib/ruote/exp/fe_define.rb in ruote-2.2.0

- old
+ new

@@ -1,7 +1,7 @@ #-- -# Copyright (c) 2005-2010, John Mettraux, jmettraux@gmail.com +# Copyright (c) 2005-2011, John Mettraux, jmettraux@gmail.com # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell @@ -90,18 +90,18 @@ end # Returns true if the tree's root expression is a definition # (define, process_definition, ...) # - def self.is_definition? (tree) + def self.is_definition?(tree) self.expression_names.include?(tree.first) end # Used by instances of this class and also the expression pool, # when launching a new process instance. # - def self.reorganize (tree) + def self.reorganize(tree) definitions, bodies = tree[2].partition { |b| is_definition?(b) } name = tree[1]['name'] || tree[1].keys.find { |k| tree[1][k] == nil } [ name, [ 'define', tree[1], definitions + bodies ] ]