disable parsing of string c-types
							parent
							
								
									630e5ecc3b
								
							
						
					
					
						commit
						4e68c43f3d
					
				| 
						 | 
				
			
			@ -6,17 +6,17 @@ kernel parser sequences splitting words fry locals lexer
 | 
			
		|||
namespaces summary math vocabs.parser ;
 | 
			
		||||
IN: alien.parser
 | 
			
		||||
 | 
			
		||||
: parse-c-type-name ( name -- word/string )
 | 
			
		||||
    [ search ] keep or ;
 | 
			
		||||
: parse-c-type-name ( name -- word )
 | 
			
		||||
    dup search [ nip ] [ no-word ] if* ;
 | 
			
		||||
 | 
			
		||||
: parse-c-type ( string -- array )
 | 
			
		||||
    {
 | 
			
		||||
        { [ dup "void" =            ] [ drop void ] }
 | 
			
		||||
        { [ CHAR: ] over member?    ] [ parse-array-type parse-c-type-name prefix ] }
 | 
			
		||||
        { [ dup search c-type-word? ] [ parse-c-type-name ] }
 | 
			
		||||
        { [ dup c-types get at      ] [ ] }
 | 
			
		||||
        { [ "**" ?tail              ] [ drop void* ] }
 | 
			
		||||
        { [ "*" ?tail               ] [ parse-c-type-name resolve-pointer-type ] }
 | 
			
		||||
        [ no-c-type ]
 | 
			
		||||
        [ parse-c-type-name no-c-type ]
 | 
			
		||||
    } cond ;
 | 
			
		||||
 | 
			
		||||
: scan-c-type ( -- c-type )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue