]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/alien/data/map/map.factor
use a "pointer" wrapper tuple to indicate pointer types instead of the current slipsh...
[factor.git] / extra / alien / data / map / map.factor
index 8039015a85bb4f7d0a0d189a9b5d89872e115f4f..06997bce56af5ed882514005f5207a112355be7c 100644 (file)
@@ -1,7 +1,8 @@
 ! (c)Joe Groff bsd license
 USING: accessors alien alien.c-types alien.data alien.parser arrays
 byte-arrays combinators effects.parser fry generalizations grouping kernel
-lexer locals macros make math math.ranges parser sequences sequences.private ;
+lexer locals macros make math math.ranges parser sequences
+sequences.generalizations sequences.private ;
 FROM: alien.arrays => array-length ;
 IN: alien.data.map
 
@@ -53,7 +54,7 @@ INSTANCE: data-map-param immutable-sequence
     nip '[ _ <sliced-groups> ] ;
 
 : [>param] ( type -- quot )
-    c-type-count over c-type-name?
+    c-type-count over c-type-word?
     [ [>c-type-param] ] [ [>object-param] ] if ; 
 
 MACRO: >param ( in -- quot: ( array -- param ) )
@@ -73,7 +74,7 @@ MACRO: >param ( in -- quot: ( array -- param ) )
     "Factor sequences as data-map outputs not supported" throw ;
 
 : [alloc-param] ( type -- quot )
-    c-type-count over c-type-name?
+    c-type-count over c-type-word?
     [ [alloc-c-type-param] ] [ [alloc-object-param] ] if ; 
 
 MACRO: alloc-param ( out -- quot: ( len -- param ) )
@@ -117,14 +118,14 @@ MACRO: data-map! ( ins outs -- )
 
 : parse-data-map-effect ( accum -- accum )
     ")" parse-effect
-    [ in>>  [ parse-c-type ] map parsed ]
-    [ out>> [ parse-c-type ] map parsed ] bi ;
+    [ in>>  [ (parse-c-type) ] map suffix! ]
+    [ out>> [ (parse-c-type) ] map suffix! ] bi ;
 
 PRIVATE>
 
 SYNTAX: data-map(
-    parse-data-map-effect \ data-map parsed ;
+    parse-data-map-effect \ data-map suffix! ;
 
 SYNTAX: data-map!(
-    parse-data-map-effect \ data-map! parsed ;
+    parse-data-map-effect \ data-map! suffix! ;