]> gitweb.factorcode.org Git - factor.git/commitdiff
vocabs.platforms: add some more switches
authorDoug Coleman <doug.coleman@gmail.com>
Wed, 8 Mar 2023 01:27:53 +0000 (19:27 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Wed, 8 Mar 2023 01:27:53 +0000 (19:27 -0600)
basis/vocabs/platforms/platforms.factor

index f6080da40f9ece65d4ea43a6de6e3fa7916211f8..855727999eb9740b84db4412d00dd646e079f02b 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2018 Doug Coleman.
 ! See https://factorcode.org/license.txt for BSD license.
-USING: accessors compiler.units kernel lexer multiline parser
-sequences splitting system vocabs vocabs.parser ;
+USING: accessors compiler.units kernel layouts lexer multiline
+parser sequences splitting system vocabs vocabs.parser ;
 IN: vocabs.platforms
 
 : with-vocabulary ( quot suffix -- )
@@ -19,10 +19,29 @@ IN: vocabs.platforms
         curry
     ] dip with-vocabulary drop ; inline
 
+SYNTAX: <TESTS
+    "TESTS>" parse-multiline-string drop ;
+
+SYNTAX: <32
+    "32>" parse-multiline-string
+    cell-bits 32 = [ ".32" parse-platform-section ] [ drop ] if ;
+
+SYNTAX: <64
+    "64>" parse-multiline-string
+    cell-bits 64 = [ ".64" parse-platform-section ] [ drop ] if ;
+
 SYNTAX: <UNIX
     "UNIX>" parse-multiline-string
     os unix? [ ".unix" parse-platform-section ] [ drop ] if ;
 
+SYNTAX: <BSD
+    "BSD>" parse-multiline-string
+    os bsd? [ ".bsd" parse-platform-section ] [ drop ] if ;
+
+SYNTAX: <FREEBSD
+    "FREEBSD>" parse-multiline-string
+    os freebsd? [ ".freebsd" parse-platform-section ] [ drop ] if ;
+
 SYNTAX: <MACOSX
     "MACOSX>" parse-multiline-string
     os macosx? [ ".macosx" parse-platform-section ] [ drop ] if ;
@@ -35,10 +54,27 @@ SYNTAX: <WINDOWS
     "WINDOWS>" parse-multiline-string
     os windows? [ ".windows" parse-platform-section ] [ drop ] if ;
 
+! Inverted sections
+SYNTAX: <!32
+    "!32>" parse-multiline-string
+    cell-bits 32 = [ drop ] [ ".32" parse-platform-section ] if ;
+
+SYNTAX: <!64
+    "!64>" parse-multiline-string
+    cell-bits 64 = [ drop ] [ ".64" parse-platform-section ] if ;
+
 SYNTAX: <!UNIX
     "!UNIX>" parse-multiline-string
     os unix? [ drop ] [ ".unix" parse-platform-section ] if ;
 
+SYNTAX: <!BSD
+    "!BSD>" parse-multiline-string
+    os bsd? [ drop ] [ ".bsd" parse-platform-section ] if ;
+
+SYNTAX: <!FREEBSD
+    "!FREEBSD>" parse-multiline-string
+    os freebsd? [ drop ] [ ".freebsd" parse-platform-section ] if ;
+
 SYNTAX: <!MACOSX
     "!MACOSX>" parse-multiline-string
     os macosx? [ drop ] [ ".macosx" parse-platform-section ] if ;
@@ -52,9 +88,10 @@ SYNTAX: <!WINDOWS
     os windows? [ drop ] [ ".windows" parse-platform-section ] if ;
 
 SYNTAX: USE-UNIX: scan-token os unix? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-BSD: scan-token os bsd? [ use-vocab ] [ drop ] if ;
 SYNTAX: USE-FREEBSD: scan-token os freebsd? [ use-vocab ] [ drop ] if ;
-SYNTAX: USE-LINUX: scan-token os linux? [ use-vocab ] [ drop ] if ;
 SYNTAX: USE-MACOSX: scan-token os macosx? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-LINUX: scan-token os linux? [ 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 ;