]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/gobject-introspection/gobject-introspection.factor
factor: trim using lists
[factor.git] / basis / gobject-introspection / gobject-introspection.factor
old mode 100755 (executable)
new mode 100644 (file)
index 5d02cc7..798f694
@@ -1,25 +1,24 @@
 ! Copyright (C) 2010 Anton Gorenko.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors combinators environment gobject-introspection.common
-gobject-introspection.ffi gobject-introspection.loader
-gobject-introspection.types io io.files io.pathnames kernel lexer
-locals make namespaces parser sequences splitting summary vocabs
-vocabs.parser xml ;
+USING: accessors combinators environment
+gobject-introspection.common gobject-introspection.ffi
+gobject-introspection.loader gobject-introspection.types io
+io.files io.pathnames kernel lexer make namespaces parser
+sequences splitting summary vocabs vocabs.parser xdg xml ;
 IN: gobject-introspection
 
 ERROR: gir-not-found name paths ;
 
 M: gir-not-found summary
     [ name>> "“" "” file not found on paths:\n" surround ]
-    [ paths>> "\n" join ] bi
+    [ paths>> join-lines ] bi
     "\n\nUse the existing path or declare GIR_DIRS environment variable"
     3append ;
 
 <PRIVATE
 
 : system-gir-dirs ( -- dirs )
-    "XDG_DATA_DIRS" os-env "/usr/local/share/:/usr/share/" or
-    ":" split [ "gir-1.0" append-path ] map ;
+    xdg-data-dirs [ "gir-1.0" append-path ] map ;
 
 : custom-gir-dirs ( -- dirs )
     "GIR_DIRS" os-env ":" split ;
@@ -34,16 +33,16 @@ M: gir-not-found summary
     ] { } make ;
 
 :: resolve-gir-path ( path -- path )
-    path exists?
+    path file-exists?
     [ path ] [
         current-vocab-dirs custom-gir-dirs system-gir-dirs
         3append sift :> paths
-        paths [ path append-path exists? ] find nip
+        paths [ path append-path file-exists? ] find nip
         [ path append-path ] [ path paths gir-not-found ] if*
     ] if ;
 
 : define-gir-vocab ( path -- )
-    resolve-gir-path dup "  loading " write print
+    resolve-gir-path dup "Loading " write print
     file>xml xml>repository
     {
         [ namespace>> name>> current-namespace-name set-global ]
@@ -53,7 +52,7 @@ M: gir-not-found summary
 
 PRIVATE>
 
-SYNTAX: GIR: scan define-gir-vocab ;
+SYNTAX: GIR: scan-token define-gir-vocab ;
 
 SYNTAX: IMPLEMENT-STRUCTS:
     ";" parse-tokens