! Copyright (C) 2018 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors compiler.units kernel lexer multiline parser
-sequences splitting system vocabs.parser ;
+USING: accessors arrays compiler.units kernel lexer multiline
+namespaces parser sequences sets splitting system vocabs
+vocabs.loader.private vocabs.parser ;
IN: vocabs.platforms
: with-vocabulary ( quot suffix -- )
SYNTAX: USE-LINUX: scan-token os linux? [ use-vocab ] [ drop ] if ;
SYNTAX: USE-MACOSX: scan-token os macosx? [ use-vocab ] [ drop ] if ;
SYNTAX: USE-WINDOWS: scan-token os windows? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-OS-SUFFIX: scan-token os name>> "." glue require ;
-SYNTAX: USE-X86-32: scan-token os x86.32? [ use-vocab ] [ drop ] if ;
-SYNTAX: USE-X86-64: scan-token os x86.64? [ use-vocab ] [ drop ] if ;
-SYNTAX: USE-ARM-32: scan-token os arm.32? [ use-vocab ] [ drop ] if ;
-SYNTAX: USE-ARM-64: scan-token os arm.64? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-X86: scan-token cpu x86? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-X86-32: scan-token cpu x86.32? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-X86-64: scan-token cpu x86.64? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-ARM: scan-token cpu arm? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-ARM-32: scan-token cpu arm.32? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-ARM-64: scan-token cpu arm.64? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-PPC: scan-token cpu ppc? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-PPC-32: scan-token cpu ppc.32? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-PPC-64: scan-token cpu ppc.64? [ use-vocab ] [ drop ] if ;
SYNTAX: USE-IF: scan-token scan-object call( -- ? ) [ use-vocab ] [ drop ] if ;
+
+SYNTAX: WHEN-UNIX: scan-object os unix? [ call( -- ) ] [ drop ] if ;
+SYNTAX: WHEN-FREEBSD: scan-object os freebsd? [ call( -- ) ] [ drop ] if ;
+SYNTAX: WHEN-LINUX: scan-object os linux? [ call( -- ) ] [ drop ] if ;
+SYNTAX: WHEN-MACOSX: scan-object os macosx? [ call( -- ) ] [ drop ] if ;
+SYNTAX: WHEN-WINDOWS: scan-object os windows? [ call( -- ) ] [ drop ] if ;
+
+SYNTAX: IF-UNIX: scan-object scan-object os unix? -rot ? call( -- ) ;
+SYNTAX: IF-FREEBSD: scan-object scan-object os freebsd? -rot ? call( -- ) ;
+SYNTAX: IF-LINUX: scan-object scan-object os linux? -rot ? call( -- ) ;
+SYNTAX: IF-MACOSX: scan-object scan-object os macosx? -rot ? call( -- ) ;
+SYNTAX: IF-WINDOWS: scan-object scan-object os windows? -rot ? call( -- ) ;