Class: Dhallish::Ast::RecordNonRecursiveMergeNode
- Inherits:
-
Object
- Object
- Dhallish::Ast::RecordNonRecursiveMergeNode
- Defined in:
- lib/ast.rb
Instance Attribute Summary collapse
-
#lhs ⇒ Object
Returns the value of attribute lhs.
-
#rhs ⇒ Object
Returns the value of attribute rhs.
Instance Method Summary collapse
- #compute_type(ctx) ⇒ Object
- #evaluate(ctx) ⇒ Object
-
#initialize(lhs, rhs) ⇒ RecordNonRecursiveMergeNode
constructor
lhs and rhs should be RecordNodes.
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
#lhs ⇒ Object
Returns the value of attribute lhs.
516 517 518 |
# File 'lib/ast.rb', line 516 def lhs @lhs end |
#rhs ⇒ Object
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 |