YAML: correctly emit f as "!!bool false"

db4
Jon Harper 2014-04-04 21:10:32 +02:00 committed by John Benediktsson
parent 83347ee964
commit 3623778d26
2 changed files with 15 additions and 0 deletions

View File

@ -65,6 +65,20 @@ ${ test-objs } [ $ test-docs yaml-docs> ] unit-test
${ test-docs } [ $ test-objs >yaml-docs ] unit-test
${ test-docs } [ $ test-docs yaml-docs> >yaml-docs ] unit-test
! Misc types
CONSTANT: test-types { 1 t f 1.0 }
CONSTANT: test-represented-types """--- !!seq
- !!int 1
- !!bool true
- !!bool false
- !!float 1.0
...
"""
${ test-types } [ $ test-represented-types yaml> ] unit-test
${ test-types } [ $ test-types >yaml yaml> ] unit-test
! Anchors
CONSTANT: test-anchors """- &1 "1"
- *1

View File

@ -207,6 +207,7 @@ M: object emit-value ( emitter event obj -- ) emit-scalar ;
: emit-set ( emitter event set -- )
[ members ] [ cardinality f <array> ] bi zip concat emit-sequence ;
M: f emit-value ( emitter event seq -- ) emit-scalar ;
M: string emit-value ( emitter event seq -- ) emit-scalar ;
M: byte-array emit-value ( emitter event seq -- ) emit-scalar ;
M: sequence emit-value ( emitter event seq -- )