aboutsummaryrefslogtreecommitdiff
path: root/yamlesque/src/main/scala/yamlValues.scala
blob: 3bc4f367b801916555e1375124bac809ed9709a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package yamlesque

sealed trait YamlValue {
  def print: String = YamlValue.DefaultPrinter(this)
}
object YamlValue {
  val DefaultPrinter = new YamlPrinter(true)
}

case class YamlMapping(fields: Map[String, YamlValue]) extends YamlValue
object YamlMapping {
  def apply(items: (String, YamlValue)*) = new YamlMapping(Map(items: _*))
}

case class YamlSequence(items: Vector[YamlValue]) extends YamlValue
object YamlSequence {
  def apply(items: YamlValue*) = new YamlSequence(items.toVector)
}

case class YamlScalar(value: String) extends YamlValue
object YamlScalar {
  final val Empty = YamlScalar("")
}