Class: Dhallish::Ast::RecordNonRecursiveMergeNode

Inherits:
Object
  • Object
show all
Defined in:
lib/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lhs, rhs) ⇒ RecordNonRecursiveMergeNode

lhs and rhs should be RecordNodes



520
521
522
523
# File 'lib/ast.rb', line 520

def initialize(lhs, rhs)
	@lhs = lhs
	@rhs = rhs
end

Instance Attribute Details

#lhsObject

Returns the value of attribute lhs.



516
517
518
# File 'lib/ast.rb', line 516

def lhs
  @lhs
end

#rhsObject

Returns the value of attribute rhs.



517
518
519
# File 'lib/ast.rb', line 517

def rhs
  @rhs
end

Instance Method Details

#compute_type(ctx) ⇒ Object



525
526
527
528
529
# File 'lib/ast.rb', line 525

def compute_type(ctx)
	lhs = @lhs.compute_type ctx
	rhs = @rhs.compute_type ctx
	::Dhallish::mergeRecordTypesPrefereRight(lhs, rhs)
end

#evaluate(ctx) ⇒ Object



531
532
533
534
535
# File 'lib/ast.rb', line 531

def evaluate(ctx)
	lhs = @lhs.evaluate(ctx)
	rhs = @rhs.evaluate(ctx)
	::Dhallish::mergeRecordsPrefereRight(lhs, rhs)
end