module DhallishGrammar::RecordTypeLiteral4

Public Instance Methods

to_node() click to toggle source
# File lib/DhallishGrammar.rb, line 1446
def to_node()
        data = { fstkey.text_value => fstexp.to_node() }
        tail.elements.each { |node|
                key = node.key.text_value
                assert("no key should apeare multiple times in a record: `#{key}`") { !data.key?(key) }
                data[key] = node.exp.to_node()
        }
        Dhallish::Ast::RecordTypeNode.new data
end