]> gitweb.factorcode.org Git - factor.git/commitdiff
alien.c-types: c-type no longer calls parser at runtime, tools.deploy.shaker now...
authorSlava Pestov <slava@shill.local>
Sat, 17 Oct 2009 04:50:17 +0000 (23:50 -0500)
committerSlava Pestov <slava@shill.local>
Sat, 17 Oct 2009 04:50:17 +0000 (23:50 -0500)
basis/alien/c-types/c-types.factor
basis/alien/parser/parser.factor
basis/tools/deploy/shaker/shaker.factor
basis/tools/deploy/shaker/strip-specialized-arrays.factor [new file with mode: 0644]

index 8196f46263b45af6406b6114b3df5e46e7267414..d622a42c9dc9ab56bc7eaf5c86edff8118354917 100755 (executable)
@@ -81,9 +81,13 @@ M: string resolve-pointer-type
     dup void? [ no-c-type ] when
     dup c-type-name? [ c-type ] when ;
 
+<PRIVATE
+
 : parse-array-type ( name -- dims c-type )
     "[" split unclip
-    [ [ "]" ?tail drop parse-word ] map ] dip ;
+    [ [ "]" ?tail drop string>number ] map ] dip ;
+
+PRIVATE>
 
 M: string c-type ( name -- c-type )
     CHAR: ] over member? [
index cc0d774ccffff83bad61ca37f7ef09241f42c13d..4b83739efe07cc1782ea389d8d971cf0002eee61 100644 (file)
@@ -10,6 +10,10 @@ IN: alien.parser
 : parse-c-type-name ( name -- word )
     dup search [ ] [ no-word ] ?if ;
 
+: parse-array-type ( name -- dims c-type )
+    "[" split unclip
+    [ [ "]" ?tail drop parse-word ] map ] dip ;
+
 : (parse-c-type) ( string -- type )
     {
         { [ dup "void" =         ] [ drop void ] }
index 994073b149c024833f1c875b734fadc093924c5d..d9b9a5dbd52660854470d17bc9103acf3316d840 100755 (executable)
@@ -85,6 +85,13 @@ IN: tools.deploy.shaker
         run-file
     ] when ;
 
+: strip-specialized-arrays ( -- )
+    strip-dictionary? "specialized-arrays" vocab and [
+        "Stripping specialized arrays" show
+        "vocab:tools/deploy/shaker/strip-specialized-arrays.factor"
+        run-file
+    ] when ;
+
 : strip-word-names ( words -- )
     "Stripping word names" show
     [ f >>name f >>vocabulary drop ] each ;
@@ -503,6 +510,7 @@ SYMBOL: deploy-vocab
     strip-call
     strip-cocoa
     strip-debugger
+    strip-specialized-arrays
     compute-next-methods
     strip-init-hooks
     add-command-line-hook
diff --git a/basis/tools/deploy/shaker/strip-specialized-arrays.factor b/basis/tools/deploy/shaker/strip-specialized-arrays.factor
new file mode 100644 (file)
index 0000000..195a3db
--- /dev/null
@@ -0,0 +1,5 @@
+IN: specialized-arrays
+
+ERROR: cannot-define-array-in-deployed-app type ;
+
+: define-array-vocab ( type -- ) cannot-define-array-in-deployed-app ;