|
// retoor <retoor@molodetz.nl>
|
|
|
|
import "yaml" for Yaml
|
|
|
|
var simple = Yaml.parse("name: test")
|
|
System.print(simple["name"]) // expect: test
|
|
|
|
var num = Yaml.parse("count: 42")
|
|
System.print(num["count"]) // expect: 42
|
|
|
|
var float = Yaml.parse("value: 3.14")
|
|
System.print(float["value"]) // expect: 3.14
|
|
|
|
var bool = Yaml.parse("active: true")
|
|
System.print(bool["active"]) // expect: true
|
|
|
|
var boolFalse = Yaml.parse("active: false")
|
|
System.print(boolFalse["active"]) // expect: false
|
|
|
|
var nullVal = Yaml.parse("value: null")
|
|
System.print(nullVal["value"]) // expect: null
|
|
|
|
var quoted = Yaml.parse("name: \"hello world\"")
|
|
System.print(quoted["name"]) // expect: hello world
|
|
|
|
var singleQuoted = Yaml.parse("name: 'hello world'")
|
|
System.print(singleQuoted["name"]) // expect: hello world
|