YAML: don't use aliases/anchors for fixnums
parent
41d2c1e10d
commit
a2f4e84a9b
|
@ -563,3 +563,10 @@ ${ construct-value-obj } [ $ construct-value-obj >yaml-docs yaml-docs> ] unit-te
|
||||||
[ "- foo\n:)" yaml> ] [ libyaml-parser-error? ] must-fail-with
|
[ "- foo\n:)" yaml> ] [ libyaml-parser-error? ] must-fail-with
|
||||||
[ "- &foo 1\n- *baz\n" yaml> ] [ yaml-undefined-anchor? ] must-fail-with
|
[ "- &foo 1\n- *baz\n" yaml> ] [ yaml-undefined-anchor? ] must-fail-with
|
||||||
[ "" yaml> ] [ yaml-no-document? ] must-fail-with
|
[ "" yaml> ] [ yaml-no-document? ] must-fail-with
|
||||||
|
|
||||||
|
|
||||||
|
! !!!!!!!!!!!!!!!
|
||||||
|
! misc
|
||||||
|
|
||||||
|
! Don't use aliases/anchors for equal fixnums
|
||||||
|
{ f } [ CHAR: & { 0 0 } >yaml member? ] unit-test
|
||||||
|
|
|
@ -268,7 +268,7 @@ GENERIC: (replace-aliases) ( yaml-anchors obj -- obj' )
|
||||||
[ next-anchor<< ] bi*
|
[ next-anchor<< ] bi*
|
||||||
] bi ;
|
] bi ;
|
||||||
|
|
||||||
:: ?replace-aliases ( yaml-anchors obj -- obj' )
|
:: (?replace-aliases) ( yaml-anchors obj -- obj' )
|
||||||
yaml-anchors objects>> :> objects
|
yaml-anchors objects>> :> objects
|
||||||
obj objects at* [
|
obj objects at* [
|
||||||
[ yaml-anchors incr-anchor dup obj objects set-at ] unless*
|
[ yaml-anchors incr-anchor dup obj objects set-at ] unless*
|
||||||
|
@ -280,6 +280,9 @@ GENERIC: (replace-aliases) ( yaml-anchors obj -- obj' )
|
||||||
obj'
|
obj'
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
|
: ?replace-aliases ( yaml-anchors obj -- obj' )
|
||||||
|
dup fixnum? [ nip ] [ (?replace-aliases) ] if ;
|
||||||
|
|
||||||
M: object (replace-aliases) nip ;
|
M: object (replace-aliases) nip ;
|
||||||
|
|
||||||
M: byte-array (replace-aliases) nip ;
|
M: byte-array (replace-aliases) nip ;
|
||||||
|
|
Loading…
Reference in New Issue