Fixed bug where primitive-type? could not handle "Class*" types
parent
519277a0a0
commit
c32d7c5c97
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2009 Jeremy Hughes.
|
! Copyright (C) 2009 Jeremy Hughes.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien.c-types assocs combinators.short-circuit fry
|
USING: alien.c-types assocs combinators.short-circuit
|
||||||
kernel memoize sequences splitting ;
|
continuations fry kernel memoize sequences splitting ;
|
||||||
IN: alien.inline.types
|
IN: alien.inline.types
|
||||||
|
|
||||||
: factorize-type ( str -- str' )
|
: factorize-type ( str -- str' )
|
||||||
|
@ -19,8 +19,10 @@ MEMO: resolved-primitives ( -- seq )
|
||||||
primitive-types [ resolve-typedef ] map ;
|
primitive-types [ resolve-typedef ] map ;
|
||||||
|
|
||||||
: primitive-type? ( type -- ? )
|
: primitive-type? ( type -- ? )
|
||||||
factorize-type resolve-typedef [ resolved-primitives ] dip
|
[
|
||||||
'[ _ = ] any? ;
|
factorize-type resolve-typedef [ resolved-primitives ] dip
|
||||||
|
'[ _ = ] any?
|
||||||
|
] [ 2drop f ] recover ;
|
||||||
|
|
||||||
: pointer? ( type -- ? )
|
: pointer? ( type -- ? )
|
||||||
[ "*" tail? ] [ "&" tail? ] bi or ;
|
[ "*" tail? ] [ "&" tail? ] bi or ;
|
||||||
|
|
Loading…
Reference in New Issue