Module: Dhall::Parser::NonEmptyRecordLiteral

Defined in:
lib/dhall/parser.rb

Instance Method Summary collapse

Instance Method Details

#value(first_key) ⇒ Object



432
433
434
435
436
437
438
439
440
# File 'lib/dhall/parser.rb', line 432

def value(first_key)
  Record.new(
    record: captures(:record_literal_entry).map(&:value).reduce(
      first_key => capture(:expression).value
    ) do |final, rec|
      final.merge(rec) { raise TypeError, "duplicate field" }
    end
  )
end