Permalink
Browse files

Complete renaming of expression handling to "formula" handling.

  • Loading branch information...
1 parent bab1480 commit ec15bb781c3b939a9ddc06939b772c4b55fe2534 @cpoirier committed Oct 15, 2011
@@ -29,7 +29,7 @@ class Attribute < Placeholder
def initialize( definition, production = nil )
super(definition.type, production)
@definition = definition
- @effective = definition.type.expression(Productions::ValueAccessor.new(self))
+ @effective = definition.type.placeholder(Productions::ValueAccessor.new(self))
end
def get_definition() ; @definition ; end
@@ -52,7 +52,7 @@ def present?( true_value = nil, false_value = nil )
false_value = FormulaCapture.capture(false_value)
result_type = true_value ? FormulaCapture.merge_types(true_value.get_type, false_value.get_type) : FormulaCapture.resolve_type(:boolean)
- result_type.expression(Productions::PresentCheck.new(self, true_value, false_value))
+ result_type.placeholder(Productions::PresentCheck.new(self, true_value, false_value))
end
@@ -51,13 +51,13 @@ def get_related( entity_name, link_attribute = nil, &link_expression )
end
if link_expression then
- link_path = link_expression.call(related_entity.root_tuple.expression)
+ link_path = link_expression.call(related_entity.root_tuple.placeholder)
else
link_path = related_entity.search do |attribute, path|
type = attribute.evaluated_type
next unless type.is_a?(Schema::ReferenceType)
next unless @names.member?(type.entity_name)
- attribute.expression(path)
+ attribute.placeholder(path)
end
end
@@ -76,7 +76,7 @@ def get_related( entity_name, link_attribute = nil, &link_expression )
warn_todo("if the link attribute for a related lookup is part of a key, the result should be a single (optional) record")
- return Schema::SetType.build(related_entity.reference_type).expression(Productions::RelatedTuples.new(@entity, link_path))
+ return Schema::SetType.build(related_entity.reference_type).placeholder(Productions::RelatedTuples.new(@entity, link_path))
end
def method_missing( symbol, *args, &block )
@@ -28,7 +28,7 @@ class Accessor
def self.build_key_accessor( entity_plan, key )
entity = entity_plan.definition
- query = entity.expression.where do |tuple|
+ query = entity.placeholder.where do |tuple|
Language::FormulaCapture.resolution_scope(entity.schema) do
comparisons = []
key.attributes.each_with_index do |attribute, index|
@@ -54,7 +54,7 @@ def method_missing( symbol, *args, &block )
when /^get_by_(\w+)$/
accessor_name = $1
if @definition.accessors.member?(accessor_name) then
- return @transaction.retrieve(@definition.accessors[accessor_name].expression)
+ return @transaction.retrieve(@definition.accessors[accessor_name].placeholder)
end
end
end
@@ -68,7 +68,7 @@ def attribute_path()
end
def print_to( printer, width = nil )
- printer.print("#{self.class.unqualified_name.to_s.ljust(18)} #{@name.to_s.ljust(width > 15 ? width : 15)} ", false)
+ printer.print("#{self.class.unqualified_name.to_s.ljust(18)} #{@name.to_s.ljust(width > 19 ? width : 19)} ", false)
structure.print_to(printer)
end

0 comments on commit ec15bb7

Please sign in to comment.