fix failing classes.struct tests

db4
Joe Groff 2009-09-15 19:10:05 -05:00
parent 1346087a12
commit 3c541f736f
2 changed files with 11 additions and 16 deletions

View File

@ -20,7 +20,7 @@ IN: classes.struct.prettyprint
<flow \ { pprint-word <flow \ { pprint-word
f <inset { f <inset {
[ name>> text ] [ name>> text ]
[ c-type>> dup string? [ text ] [ pprint* ] if ] [ type>> dup string? [ text ] [ pprint* ] if ]
[ read-only>> [ \ read-only pprint-word ] when ] [ read-only>> [ \ read-only pprint-word ] when ]
[ initial>> [ \ initial: pprint-word pprint* ] when* ] [ initial>> [ \ initial: pprint-word pprint* ] when* ]
} cleave block> } cleave block>
@ -111,7 +111,7 @@ M: struct-mirror >alist ( mirror -- alist )
] [ ] [
'[ '[
_ struct>assoc _ struct>assoc
[ [ [ name>> ] [ c-type>> ] bi 2array ] dip ] assoc-map [ [ [ name>> ] [ type>> ] bi 2array ] dip ] assoc-map
] [ drop { } ] recover ] [ drop { } ] recover
] bi append ; ] bi append ;

View File

@ -5,7 +5,7 @@ combinators compiler.tree.debugger compiler.units destructors
io.encodings.utf8 io.pathnames io.streams.string kernel libc io.encodings.utf8 io.pathnames io.streams.string kernel libc
literals math mirrors multiline namespaces prettyprint literals math mirrors multiline namespaces prettyprint
prettyprint.config see sequences specialized-arrays system prettyprint.config see sequences specialized-arrays system
tools.test parser lexer eval ; tools.test parser lexer eval layouts ;
SPECIALIZED-ARRAY: char SPECIALIZED-ARRAY: char
SPECIALIZED-ARRAY: int SPECIALIZED-ARRAY: int
SPECIALIZED-ARRAY: ushort SPECIALIZED-ARRAY: ushort
@ -199,26 +199,23 @@ UNION-STRUCT: struct-test-float-and-bits
T{ struct-slot-spec T{ struct-slot-spec
{ name "x" } { name "x" }
{ offset 0 } { offset 0 }
{ initial 0 }
{ class fixnum } { class fixnum }
{ type "char" } { type "char" }
{ reader x>> }
{ writer (>>x) }
} }
T{ struct-slot-spec T{ struct-slot-spec
{ name "y" } { name "y" }
{ offset 4 } { offset 4 }
{ class $[ cell 8 = fixnum integer ? ] } { initial 123 }
{ class integer }
{ type "int" } { type "int" }
{ reader y>> }
{ writer (>>y) }
} }
T{ struct-slot-spec T{ struct-slot-spec
{ name "z" } { name "z" }
{ offset 8 } { offset 8 }
{ initial f }
{ type "bool" } { type "bool" }
{ class boolean } { class object }
{ reader z>> }
{ writer (>>z) }
} }
} ] [ "struct-test-foo" c-type fields>> ] unit-test } ] [ "struct-test-foo" c-type fields>> ] unit-test
@ -228,16 +225,14 @@ UNION-STRUCT: struct-test-float-and-bits
{ offset 0 } { offset 0 }
{ type "float" } { type "float" }
{ class float } { class float }
{ reader f>> } { initial 0.0 }
{ writer (>>f) }
} }
T{ struct-slot-spec T{ struct-slot-spec
{ name "bits" } { name "bits" }
{ offset 0 } { offset 0 }
{ type "uint" } { type "uint" }
{ class $[ cell 8 = fixnum integer ? ] } { class integer }
{ reader bits>> } { initial 0 }
{ writer (>>bits) }
} }
} ] [ "struct-test-float-and-bits" c-type fields>> ] unit-test } ] [ "struct-test-float-and-bits" c-type fields>> ] unit-test