alien.c-types: c-type no longer calls parser at runtime, tools.deploy.shaker now strips out runtime specialized array code generation
parent
4ed91ff5ee
commit
5afce2cc9e
|
@ -81,9 +81,13 @@ M: string resolve-pointer-type
|
||||||
dup void? [ no-c-type ] when
|
dup void? [ no-c-type ] when
|
||||||
dup c-type-name? [ c-type ] when ;
|
dup c-type-name? [ c-type ] when ;
|
||||||
|
|
||||||
|
<PRIVATE
|
||||||
|
|
||||||
: parse-array-type ( name -- dims c-type )
|
: parse-array-type ( name -- dims c-type )
|
||||||
"[" split unclip
|
"[" split unclip
|
||||||
[ [ "]" ?tail drop parse-word ] map ] dip ;
|
[ [ "]" ?tail drop string>number ] map ] dip ;
|
||||||
|
|
||||||
|
PRIVATE>
|
||||||
|
|
||||||
M: string c-type ( name -- c-type )
|
M: string c-type ( name -- c-type )
|
||||||
CHAR: ] over member? [
|
CHAR: ] over member? [
|
||||||
|
|
|
@ -10,6 +10,10 @@ IN: alien.parser
|
||||||
: parse-c-type-name ( name -- word )
|
: parse-c-type-name ( name -- word )
|
||||||
dup search [ ] [ no-word ] ?if ;
|
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 )
|
: (parse-c-type) ( string -- type )
|
||||||
{
|
{
|
||||||
{ [ dup "void" = ] [ drop void ] }
|
{ [ dup "void" = ] [ drop void ] }
|
||||||
|
|
|
@ -85,6 +85,13 @@ IN: tools.deploy.shaker
|
||||||
run-file
|
run-file
|
||||||
] when ;
|
] 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 -- )
|
: strip-word-names ( words -- )
|
||||||
"Stripping word names" show
|
"Stripping word names" show
|
||||||
[ f >>name f >>vocabulary drop ] each ;
|
[ f >>name f >>vocabulary drop ] each ;
|
||||||
|
@ -503,6 +510,7 @@ SYMBOL: deploy-vocab
|
||||||
strip-call
|
strip-call
|
||||||
strip-cocoa
|
strip-cocoa
|
||||||
strip-debugger
|
strip-debugger
|
||||||
|
strip-specialized-arrays
|
||||||
compute-next-methods
|
compute-next-methods
|
||||||
strip-init-hooks
|
strip-init-hooks
|
||||||
add-command-line-hook
|
add-command-line-hook
|
||||||
|
|
|
@ -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 ;
|
Loading…
Reference in New Issue