vocabs: On use-vocab we should throw an error if the vocabulary does not exist.
Also ui.pixel-formats.private does not exist so remove that. Fixes #2298.master
							parent
							
								
									8bc4a3f2b8
								
							
						
					
					
						commit
						8efe213273
					
				| 
						 | 
				
			
			@ -9,7 +9,7 @@ math.vectors namespaces sequences strings system threads ui ui.backend
 | 
			
		|||
ui.backend.gtk.input-methods ui.backend.gtk.io ui.backend.x11.keys
 | 
			
		||||
ui.clipboards ui.event-loop ui.gadgets ui.gadgets.private
 | 
			
		||||
ui.gadgets.worlds ui.gestures ui.pixel-formats
 | 
			
		||||
ui.pixel-formats.private ui.private vocabs.loader ;
 | 
			
		||||
ui.private vocabs.loader ;
 | 
			
		||||
IN: ui.backend.gtk
 | 
			
		||||
 | 
			
		||||
SINGLETON: gtk-ui-backend
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,7 +115,7 @@ ERROR: unbalanced-private-declaration vocab ;
 | 
			
		|||
        vocab-name "Already using ``" "'' vocabulary" surround note.
 | 
			
		||||
    ] [
 | 
			
		||||
        manifest get
 | 
			
		||||
        [ [ load-vocab ] dip search-vocabs>> push ]
 | 
			
		||||
        [ [ ?load-vocab ] dip search-vocabs>> push ]
 | 
			
		||||
        [ [ vocab-name ] dip search-vocab-names>> adjoin ]
 | 
			
		||||
        2bi
 | 
			
		||||
    ] if ;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -47,6 +47,11 @@ M: vocab lookup-vocab ;
 | 
			
		|||
 | 
			
		||||
M: object lookup-vocab vocab-name dictionary get at ;
 | 
			
		||||
 | 
			
		||||
ERROR: no-vocab-named name ;
 | 
			
		||||
 | 
			
		||||
: ?lookup-vocab ( vocab-spec -- vocab )
 | 
			
		||||
    dup lookup-vocab [ nip ] [ no-vocab-named ] if* ;
 | 
			
		||||
 | 
			
		||||
GENERIC: vocab-words-assoc ( vocab-spec -- assoc/f )
 | 
			
		||||
 | 
			
		||||
M: vocab vocab-words-assoc words>> ;
 | 
			
		||||
| 
						 | 
				
			
			@ -156,3 +161,6 @@ M: string require
 | 
			
		|||
 | 
			
		||||
: load-vocab ( name -- vocab )
 | 
			
		||||
    [ require ] [ lookup-vocab ] bi ;
 | 
			
		||||
 | 
			
		||||
: ?load-vocab ( name -- vocab )
 | 
			
		||||
    [ require ] [ ?lookup-vocab ] bi ;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue