Merge branch 'master' of git://factorcode.org/git/factor
commit
ae001ce75c
|
@ -1,7 +1,7 @@
|
||||||
! (c)Joe Groff bsd license
|
! (c)Joe Groff bsd license
|
||||||
USING: accessors assocs classes classes.struct combinators
|
USING: accessors assocs classes classes.struct combinators
|
||||||
kernel math prettyprint.backend prettyprint.custom
|
kernel math prettyprint.backend prettyprint.custom
|
||||||
prettyprint.sections see.private sequences words ;
|
prettyprint.sections see.private sequences strings words ;
|
||||||
IN: classes.struct.prettyprint
|
IN: classes.struct.prettyprint
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
@ -18,7 +18,7 @@ IN: classes.struct.prettyprint
|
||||||
<flow \ { pprint-word
|
<flow \ { pprint-word
|
||||||
{
|
{
|
||||||
[ name>> text ]
|
[ name>> text ]
|
||||||
[ c-type>> text ]
|
[ c-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
|
} cleave
|
||||||
|
|
|
@ -187,7 +187,7 @@ STRUCT: struct-test-array-slots
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
STRUCT: struct-test-optimization
|
STRUCT: struct-test-optimization
|
||||||
{ x int[3] } { y int } ;
|
{ x { "int" 3 } } { y int } ;
|
||||||
|
|
||||||
[ t ] [ [ struct-test-optimization memory>struct y>> ] { memory>struct y>> } inlined? ] unit-test
|
[ t ] [ [ struct-test-optimization memory>struct y>> ] { memory>struct y>> } inlined? ] unit-test
|
||||||
[ t ] [
|
[ t ] [
|
||||||
|
|
|
@ -232,10 +232,13 @@ ERROR: invalid-struct-slot token ;
|
||||||
c-type c-type-boxed-class
|
c-type c-type-boxed-class
|
||||||
dup \ byte-array = [ drop \ c-ptr ] when ;
|
dup \ byte-array = [ drop \ c-ptr ] when ;
|
||||||
|
|
||||||
|
: scan-c-type ( -- c-type )
|
||||||
|
scan dup "{" = [ drop \ } parse-until >array ] when ;
|
||||||
|
|
||||||
: parse-struct-slot ( -- slot )
|
: parse-struct-slot ( -- slot )
|
||||||
struct-slot-spec new
|
struct-slot-spec new
|
||||||
scan >>name
|
scan >>name
|
||||||
scan [ >>c-type ] [ struct-slot-class >>class ] bi
|
scan-c-type [ >>c-type ] [ struct-slot-class >>class ] bi
|
||||||
\ } parse-until [ dup empty? ] [ peel-off-attributes ] until drop ;
|
\ } parse-until [ dup empty? ] [ peel-off-attributes ] until drop ;
|
||||||
|
|
||||||
: parse-struct-slots ( slots -- slots' more? )
|
: parse-struct-slots ( slots -- slots' more? )
|
||||||
|
|
|
@ -30,7 +30,7 @@ CLASS: {
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "applicationShouldHandleReopen:hasVisibleWindows:" "int" { "id" "SEL" "id" "int" }
|
{ "applicationShouldHandleReopen:hasVisibleWindows:" "int" { "id" "SEL" "id" "int" }
|
||||||
[ [ 3drop ] dip 0 = [ show-listener ] when 0 ]
|
[ [ 3drop ] dip 0 = [ show-listener ] when 1 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "factorListener:" "id" { "id" "SEL" "id" }
|
{ "factorListener:" "id" { "id" "SEL" "id" }
|
||||||
|
|
Loading…
Reference in New Issue