From ea36783fb3ea1e3829dbcb454409154819b7ff0e Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 13 Nov 2009 07:55:47 -0600 Subject: [PATCH] Fix bootstrap --- basis/stack-checker/alien/alien.factor | 2 +- core/bootstrap/syntax.factor | 171 +++++++++++++------------ core/compiler/units/units-tests.factor | 2 +- core/words/words.factor | 5 +- 4 files changed, 93 insertions(+), 87 deletions(-) diff --git a/basis/stack-checker/alien/alien.factor b/basis/stack-checker/alien/alien.factor index 2a20ba74cd..f9ab1ae96c 100644 --- a/basis/stack-checker/alien/alien.factor +++ b/basis/stack-checker/alien/alien.factor @@ -69,6 +69,6 @@ TUPLE: alien-callback-params < alien-node-params quot xt ; pop-literal nip >>abi pop-literal nip >>parameters pop-literal nip >>return - "( callback )" f >>xt + "( callback )" >>xt dup callback-bottom #alien-callback, ; diff --git a/core/bootstrap/syntax.factor b/core/bootstrap/syntax.factor index 57be2fb90f..bb159f04df 100644 --- a/core/bootstrap/syntax.factor +++ b/core/bootstrap/syntax.factor @@ -1,90 +1,93 @@ ! Copyright (C) 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: words words.symbol sequences vocabs kernel ; +USING: words words.symbol sequences vocabs kernel +compiler.units ; IN: bootstrap.syntax -"syntax" create-vocab drop +[ + "syntax" create-vocab drop -{ - "!" - "\"" - "#!" - "(" - "((" - ":" - ";" - "" - "SBUF\"" - "SINGLETON:" - "SINGLETONS:" - "SYMBOL:" - "SYMBOLS:" - "CONSTANT:" - "TUPLE:" - "SLOT:" - "T{" - "UNION:" - "INTERSECTION:" - "USE:" - "UNUSE:" - "USING:" - "QUALIFIED:" - "QUALIFIED-WITH:" - "FROM:" - "EXCLUDE:" - "RENAME:" - "ALIAS:" - "SYNTAX:" - "V{" - "W{" - "[" - "\\" - "M\\" - "]" - "delimiter" - "deprecated" - "f" - "flushable" - "foldable" - "inline" - "recursive" - "t" - "{" - "}" - "CS{" - "<<" - ">>" - "call-next-method" - "initial:" - "read-only" - "call(" - "execute(" -} [ "syntax" create drop ] each + { + "!" + "\"" + "#!" + "(" + "((" + ":" + ";" + "" + "SBUF\"" + "SINGLETON:" + "SINGLETONS:" + "SYMBOL:" + "SYMBOLS:" + "CONSTANT:" + "TUPLE:" + "SLOT:" + "T{" + "UNION:" + "INTERSECTION:" + "USE:" + "UNUSE:" + "USING:" + "QUALIFIED:" + "QUALIFIED-WITH:" + "FROM:" + "EXCLUDE:" + "RENAME:" + "ALIAS:" + "SYNTAX:" + "V{" + "W{" + "[" + "\\" + "M\\" + "]" + "delimiter" + "deprecated" + "f" + "flushable" + "foldable" + "inline" + "recursive" + "t" + "{" + "}" + "CS{" + "<<" + ">>" + "call-next-method" + "initial:" + "read-only" + "call(" + "execute(" + } [ "syntax" create drop ] each -"t" "syntax" lookup define-symbol + "t" "syntax" lookup define-symbol +] with-compilation-unit diff --git a/core/compiler/units/units-tests.factor b/core/compiler/units/units-tests.factor index c827d370d5..eccc292f26 100644 --- a/core/compiler/units/units-tests.factor +++ b/core/compiler/units/units-tests.factor @@ -7,7 +7,7 @@ IN: compiler.units.tests ! Non-optimizing compiler bugs [ 1 1 ] [ - "A" "B" [ [ [ 1 ] dip ] 2array 1array modify-code-heap ] keep + "A" [ [ [ 1 ] dip ] 2array 1array modify-code-heap ] keep 1 swap execute ] unit-test diff --git a/core/words/words.factor b/core/words/words.factor index 712e3ba558..3dbfb3c864 100755 --- a/core/words/words.factor +++ b/core/words/words.factor @@ -137,8 +137,11 @@ M: word reset-word : ( name vocab -- word ) 2dup [ hashcode ] bi@ bitxor >fixnum (word) dup new-word ; +: ( name -- word ) + f \ counter >fixnum (word) ; + : gensym ( -- word ) - "( gensym )" f \ gensym counter >fixnum (word) ; + "( gensym )" ; : define-temp ( quot effect -- word ) [ gensym dup ] 2dip define-declared ;