]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 28 Aug 2009 02:40:11 +0000 (21:40 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 28 Aug 2009 02:40:11 +0000 (21:40 -0500)
basis/classes/struct/prettyprint/prettyprint.factor
basis/classes/struct/struct-tests.factor
basis/classes/struct/struct.factor
basis/ui/backend/cocoa/tools/tools.factor

index feeecd881ba5a7cb15731d078d0335af968ccfd7..6368424ec66ceb6e4aa18486752c66bd1909dfd9 100644 (file)
@@ -1,7 +1,7 @@
 ! (c)Joe Groff bsd license
 USING: accessors assocs classes classes.struct combinators
 kernel math prettyprint.backend prettyprint.custom
-prettyprint.sections see.private sequences words ;
+prettyprint.sections see.private sequences strings words ;
 IN: classes.struct.prettyprint
 
 <PRIVATE
@@ -18,7 +18,7 @@ IN: classes.struct.prettyprint
     <flow \ { pprint-word
     {
         [ name>> text ]
-        [ c-type>> text ]
+        [ c-type>> dup string? [ text ] [ pprint* ] if ]
         [ read-only>> [ \ read-only pprint-word ] when ]
         [ initial>> [ \ initial: pprint-word pprint* ] when* ]
     } cleave
index 64b8ba83e259246bbb4749e4a09f569ecbf5da5e..2995e9d6d6842b4b67d39c5043f052969e1fa88c 100644 (file)
@@ -187,7 +187,7 @@ STRUCT: struct-test-array-slots
 ] unit-test
 
 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 ] [
index 52f3b7df9f4d7b8e33643769c38e32fd9dea2a68..2cafb5e8fe24b6d2770635e694210769f933ef9d 100644 (file)
@@ -232,10 +232,13 @@ ERROR: invalid-struct-slot token ;
     c-type c-type-boxed-class
     dup \ byte-array = [ drop \ c-ptr ] when ;
 
+: scan-c-type ( -- c-type )
+    scan dup "{" = [ drop \ } parse-until >array ] when ;
+
 : parse-struct-slot ( -- slot )
     struct-slot-spec new
     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-struct-slots ( slots -- slots' more? )
index cf5493f33dd271b53d49f9115b8bfba99857e9d7..b8c01f0bd925882ebea16585f1ba03b07c7eeb39 100644 (file)
@@ -30,7 +30,7 @@ CLASS: {
 }
 
 { "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" }