Module: Dhall::Parser::UnionTypeOrLiteralVariantType
- Defined in:
- lib/dhall/parser.rb
Instance Method Summary collapse
Instance Method Details
#value(label) ⇒ Object
320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/dhall/parser.rb', line 320 def value(label) rest = capture(:non_empty_union_type_or_literal)&.value type = UnionType.new( alternatives: { label => capture(:expression)&.value } ) if rest.is_a?(Union) rest.with(alternatives: type.merge(rest.alternatives)) else rest ? type.merge(rest) : type end end |