]> gitweb.factorcode.org Git - factor.git/blobdiff - core/bootstrap/primitives.factor
bootstrap.primitives: shorter code for mapping architecture to assembly file
[factor.git] / core / bootstrap / primitives.factor
index 04c34f9609ab5858d83f19653bf598dc4a244473..cd215ce16a26f627127182eb3dadca225f4f7f20 100755 (executable)
@@ -1,14 +1,13 @@
 ! Copyright (C) 2004, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.strings arrays byte-arrays generic hashtables
-hashtables.private io io.encodings.ascii kernel math
-math.private math.order namespaces make parser sequences strings
-vectors words quotations assocs layouts classes classes.private
-classes.builtin classes.singleton classes.tuple
+USING: accessors alien alien.strings arrays assocs byte-arrays classes
+classes.intersection classes.union combinators generic hashtables
+hashtables.private io io.encodings.ascii kernel math math.private math.order
+namespaces make parser quotations sequences strings vectors words layouts
+classes.private classes.builtin classes.singleton classes.tuple
 classes.tuple.private kernel.private vocabs vocabs.loader
-source-files definitions slots classes.union
-classes.intersection classes.predicate compiler.units
-bootstrap.image.private io.files accessors combinators ;
+source-files definitions slots  classes.predicate compiler.units
+bootstrap.image.private io.files splitting ;
 IN: bootstrap.primitives
 
 "Creating primitives and basic runtime structures..." print flush
@@ -17,15 +16,11 @@ H{ } clone sub-primitives set
 
 "vocab:bootstrap/syntax.factor" parse-file
 
-architecture get {
-    { "windows-x86.32" "x86.32.windows" }
-    { "windows-x86.64" "x86.64.windows" }
-    { "unix-x86.32"  "x86.32.unix"  }
-    { "unix-x86.64"  "x86.64.unix"  }
-    { "linux-ppc.32" "ppc.32.linux" }
-    { "linux-ppc.64" "ppc.64.linux" }
-} ?at [ "Bad architecture: " prepend throw ] unless
-"vocab:bootstrap/assembler/" ".factor" surround parse-file
+: asm-file ( arch -- file )
+    "-" split reverse "." join
+    "vocab:bootstrap/assembler/" ".factor" surround ;
+
+architecture get asm-file parse-file
 
 "vocab:bootstrap/layouts/layouts.factor" parse-file