! 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 ;
! 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
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 )
[ [ arguments>> ] [ temporaries>> ] bi append ]
[ body>> [ assigned-locals ] map concat fast-set ] bi
'[
- dup dup _ in?
- [ <local-reader> ]
- [ <local> ]
- if
+ dup dup _ in? [ <local-reader> ] [ <local> ] if
] H{ } map>assoc
dup
[ nip local-reader? ] assoc-filter
! 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
! 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 )
! 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:
OptionalWhiteSpace
(UnaryMessageSend | Operand):rhs
=> [[ selector { rhs } ast-message boa ]]
-
+
KeywordMessageSegment = Keyword:k OptionalWhiteSpace (BinaryMessageSend | UnaryMessageSend | Operand):arg => [[ { k arg } ]]
KeywordMessage = OptionalWhiteSpace
KeywordMessageSegment:h