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 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? [
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 ] }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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