From 0a155def040a9c5f4efa2a27e81f1c4a09dbf183 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Fri, 27 Sep 2019 08:26:02 -0700 Subject: [PATCH] smalltalk: cleanup usings. --- extra/smalltalk/ast/ast.factor | 3 ++- extra/smalltalk/classes/classes.factor | 2 +- extra/smalltalk/compiler/compiler.factor | 8 ++------ extra/smalltalk/compiler/lexenv/lexenv.factor | 6 +++--- extra/smalltalk/eval/eval.factor | 5 ++--- extra/smalltalk/parser/parser.factor | 7 ++++--- 6 files changed, 14 insertions(+), 17 deletions(-) diff --git a/extra/smalltalk/ast/ast.factor b/extra/smalltalk/ast/ast.factor index b3f8375587..c4b1d6b8b7 100644 --- a/extra/smalltalk/ast/ast.factor +++ b/extra/smalltalk/ast/ast.factor @@ -1,6 +1,7 @@ ! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: strings arrays memoize kernel sequences accessors combinators ; +USING: accessors arrays combinators kernel memoize sequences +strings ; IN: smalltalk.ast SINGLETONS: nil self super ; diff --git a/extra/smalltalk/classes/classes.factor b/extra/smalltalk/classes/classes.factor index 0790cde7d9..13f9c5e125 100644 --- a/extra/smalltalk/classes/classes.factor +++ b/extra/smalltalk/classes/classes.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel namespaces assocs accessors words sequences classes.tuple ; +USING: accessors assocs classes.tuple kernel namespaces words ; IN: smalltalk.classes SYMBOL: classes diff --git a/extra/smalltalk/compiler/compiler.factor b/extra/smalltalk/compiler/compiler.factor index f5a519f97d..0acf1e1bfa 100644 --- a/extra/smalltalk/compiler/compiler.factor +++ b/extra/smalltalk/compiler/compiler.factor @@ -4,8 +4,7 @@ USING: accessors arrays assocs combinators continuations fry generic kernel locals locals.types math quotations sequences sequences.generalizations sets smalltalk.ast smalltalk.classes smalltalk.compiler.assignment smalltalk.compiler.lexenv -smalltalk.compiler.return smalltalk.selectors splitting vocabs -words ; +smalltalk.compiler.return smalltalk.selectors splitting words ; IN: smalltalk.compiler GENERIC: compile-ast ( lexenv ast -- quot ) @@ -69,10 +68,7 @@ M: ast-return compile-ast [ [ arguments>> ] [ temporaries>> ] bi append ] [ body>> [ assigned-locals ] map concat fast-set ] bi '[ - dup dup _ in? - [ ] - [ ] - if + dup dup _ in? [ ] [ ] if ] H{ } map>assoc dup [ nip local-reader? ] assoc-filter diff --git a/extra/smalltalk/compiler/lexenv/lexenv.factor b/extra/smalltalk/compiler/lexenv/lexenv.factor index 3a7d29e6da..9d952bca34 100644 --- a/extra/smalltalk/compiler/lexenv/lexenv.factor +++ b/extra/smalltalk/compiler/lexenv/lexenv.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: assocs kernel accessors quotations slots words -sequences namespaces combinators combinators.short-circuit -summary smalltalk.classes ; +USING: accessors assocs combinators combinators.short-circuit +kernel namespaces quotations sequences slots smalltalk.classes +summary words ; IN: smalltalk.compiler.lexenv ! local-readers: assoc string => word diff --git a/extra/smalltalk/eval/eval.factor b/extra/smalltalk/eval/eval.factor index 56841beafd..545c1d933c 100644 --- a/extra/smalltalk/eval/eval.factor +++ b/extra/smalltalk/eval/eval.factor @@ -1,8 +1,7 @@ ! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: io.files io.encodings.utf8 -compiler.units smalltalk.parser smalltalk.compiler -smalltalk.library ; +USING: compiler.units io.encodings.utf8 io.files +smalltalk.compiler smalltalk.parser ; IN: smalltalk.eval : eval-smalltalk ( string -- result ) diff --git a/extra/smalltalk/parser/parser.factor b/extra/smalltalk/parser/parser.factor index 5e29c229bd..ccf2361828 100644 --- a/extra/smalltalk/parser/parser.factor +++ b/extra/smalltalk/parser/parser.factor @@ -1,7 +1,8 @@ ! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: peg peg.ebnf smalltalk.ast sequences sequences.deep strings -math.parser multiline kernel arrays byte-arrays math assocs accessors ; +USING: accessors arrays assocs byte-arrays kernel math +math.parser multiline peg.ebnf sequences sequences.deep +smalltalk.ast strings ; IN: smalltalk.parser ! :mode=text:noTabs=true: @@ -131,7 +132,7 @@ BinaryMessage = OptionalWhiteSpace OptionalWhiteSpace (UnaryMessageSend | Operand):rhs => [[ selector { rhs } ast-message boa ]] - + KeywordMessageSegment = Keyword:k OptionalWhiteSpace (BinaryMessageSend | UnaryMessageSend | Operand):arg => [[ { k arg } ]] KeywordMessage = OptionalWhiteSpace KeywordMessageSegment:h