Skip to content
master
Go to file
Code

Latest commit

* Corrected `rq` installation method

Previous installation URI failed/offline: downloading files from distribution
s3 buckets instead. Also, this required new C++ deps that in turn led to a
newer base image requirement.

* Added `date:time` YAML SNAFU example: `12:34` is parsed as sexagesimal number in python

Ref: https://twitter.com/chrisbranch/status/1094581030147768320
Ref: https://docs.docker.com/v17.09/compose/compose-file/#ports

* Updated output as per newer dependencies/docker image
99b61b5

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

YAML sucks.

YAML specification is so ambigous, that you can't be sure if tomorrow you will parse the same data from YAML file as you have yesterday.

Let's see how different implementations parse YAML code. Settings are default or near to default or typical for that language. We use JSON to represent data the uniform way.

YAML source yaml2json.hs yaml2json.pl yaml2json.py yaml2json.rb rq
- false
- n
- off
[false,false,false]
["","n","off"]
[false, "n", false]
[false,"n",false]
[false,"n","off"]
- 0:00
- 01:00
- 12:34
["0:00","01:00","12:34"]
["0:00","01:00","12:34"]
["0:00", "01:00", 754]
[0,3600,45240]
["0:00","01:00","12:34"]
null
null
null
false
[ERROR] [rq] Encountered: EOF while parsing a value [ERROR] [rq] (Re-run with --trace or RUST_BACKTRACE=1 for a backtrace)
- -.inf
- .NaN
["-.inf",".NaN"]
["-.inf",".NaN"]
[-Infinity, NaN]
[-Infinity,NaN]
["-.inf",".NaN"]
- 1.23015e+3
- 12.3015e+02
- 1230.15
[1230.15,1230.15,1230.15]
["1.23015e+3","12.3015e+02","1230.15"]
[1230.15, 1230.15, 1230.15]
[1230.15,1230.15,1230.15]
[1230.15,1230.15,1230.15]
0xC
"0xC"
"0xC"
12
12
12
<<
"<<"
"<<"
ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:merge' in "", line 1, column 1
"<<"
"<<"
<<: {}
{}
{"<<":{}}
{}
{}
{"<<":{}}
"<<": {}
{}
{"<<":{}}
{"<<": {}}
{}
{"<<":{}}
<<: a
{"<<":"a"}
{"<<":"a"}
ConstructorError: while constructing a mapping in "", line 1, column 1 expected a mapping or list of mappings for merging, but found scalar in "", line 1, column 5
{"<<":"a"}
{"<<":"a"}
a: &alias
    k1: v1
    k2: v2

b: <<: *alias k1: override k3: v3

{"a":{"k2":"v2","k1":"v1"},"b":{"k3":"v3","k2":"v2","k1":"override"}}
{"a":{"k2":"v2","k1":"v1"},"b":{"k3":"v3","k1":"override","<<":{"k2":"v2","k1":"v1"}}}
{"a": {"k1": "v1", "k2": "v2"}, "b": {"k1": "override", "k2": "v2", "k3": "v3"}}
{"a":{"k1":"v1","k2":"v2"},"b":{"k1":"override","k2":"v2","k3":"v3"}}
{"a":{"k1":"v1","k2":"v2"},"b":{"<<":{"k1":"v1","k2":"v2"},"k1":"override","k3":"v3"}}
- 1000
- +1000
- 1_000
[1000,1000,"1_000"]
["1000","+1000","1_000"]
[1000, 1000, 1000]
[1000,1000,1000]
[1000,1000,"1_000"]
[8, 08, 0o10, 010]
[8,8,"0o10",10]
["8","08","0o10","010"]
[8, "08", "0o10", 8]
[8,"08","0o10",8]
[8,8,8,10]
"Sosa did fine.\u263A"
"Sosa did fine.☺"
"Sosa did fine.☺"
"Sosa did fine.\u263a"
"Sosa did fine.☺"
"Sosa did fine.☺"
You can’t perform that action at this time.