Merge remote-tracking branch 'origin/master' into modern-harvey3
commit
5963f3a520
|
@ -106,6 +106,7 @@ CONSTANT: default-components
|
|||
"stage2: deployment mode" print
|
||||
] [
|
||||
"debugger" require
|
||||
os unix? [ "debugger.unix" require ] when
|
||||
"listener" require
|
||||
] if
|
||||
|
||||
|
|
|
@ -1,25 +1,9 @@
|
|||
! Copyright (C) 2009 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: debugger io kernel math prettyprint sequences system
|
||||
io.launcher.unix accessors strings ;
|
||||
USING: accessors debugger io kernel math prettyprint sequences
|
||||
system unix.signals ;
|
||||
IN: debugger.unix
|
||||
|
||||
CONSTANT: signal-names
|
||||
{
|
||||
"SIGHUP" "SIGINT" "SIGQUIT" "SIGILL" "SIGTRAP" "SIGABRT"
|
||||
"SIGEMT" "SIGFPE" "SIGKILL" "SIGBUS" "SIGSEGV" "SIGSYS"
|
||||
"SIGPIPE" "SIGALRM" "SIGTERM" "SIGURG" "SIGSTOP" "SIGTSIP"
|
||||
"SIGCONT" "SIGCHLD" "SIGTTIN" "SIGTTOU" "SIGIO" "SIGXCPU"
|
||||
"SIGXFSZ" "SIGVTALRM" "SIGPROF" "SIGWINCH" "SIGINFO"
|
||||
"SIGUSR1" "SIGUSR2"
|
||||
}
|
||||
|
||||
GENERIC: signal-name ( obj -- str/f )
|
||||
|
||||
M: signal signal-name n>> signal-name ;
|
||||
|
||||
M: integer signal-name ( n -- str/f ) 1 - signal-names ?nth ;
|
||||
|
||||
: signal-name. ( n -- )
|
||||
signal-name [ " (" ")" surround write ] when* ;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ classes.struct combinators destructors destructors.private fry
|
|||
io.backend io.backend.unix.multiplexers io.buffers io.files
|
||||
io.ports io.timeouts kernel kernel.private libc locals make math
|
||||
namespaces sequences summary system threads unix unix.ffi
|
||||
unix.stat unix.types ;
|
||||
unix.signals unix.stat unix.types ;
|
||||
QUALIFIED: io
|
||||
IN: io.backend.unix
|
||||
|
||||
|
@ -185,8 +185,6 @@ M: stdin cancel-operation
|
|||
size-read-fd <fd> init-fd <input-port> >>size
|
||||
data-read-fd <fd> >>data ;
|
||||
|
||||
INITIALIZED-SYMBOL: dispatch-signal-hook [ [ drop ] ]
|
||||
|
||||
: signal-pipe-fd ( -- n )
|
||||
OBJ-SIGNAL-PIPE special-object ; inline
|
||||
|
||||
|
|
|
@ -4,15 +4,14 @@
|
|||
! Tested with OpenSSL 0.9.8a_0 on Mac OS X 10.4.9 PowerPC
|
||||
!
|
||||
! export LD_LIBRARY_PATH=/opt/local/lib
|
||||
|
||||
USING: alien alien.c-types alien.destructors alien.libraries
|
||||
alien.syntax classes.struct combinators system ;
|
||||
alien.libraries.finder alien.syntax classes.struct combinators system ;
|
||||
|
||||
IN: openssl.libcrypto
|
||||
|
||||
<< "libcrypto" {
|
||||
{ [ os windows? ] [ "libcrypto-37.dll" ] }
|
||||
{ [ os macosx? ] [ "libcrypto.dylib" ] }
|
||||
{ [ os macosx? ] [ { "libcrypto.46.dylib" "libcrypto.44.dylib" } find-library-from-list ] }
|
||||
{ [ os unix? ] [ "libcrypto.so" ] }
|
||||
} cond cdecl add-library >>
|
||||
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
! Portions copyright (C) 2008 Slava Pestov
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien alien.c-types alien.destructors alien.libraries
|
||||
alien.parser alien.syntax classes.struct combinators kernel literals
|
||||
namespaces openssl.libcrypto system ;
|
||||
alien.libraries.finder alien.parser alien.syntax classes.struct
|
||||
combinators kernel literals namespaces openssl.libcrypto system ;
|
||||
|
||||
IN: openssl.libssl
|
||||
|
||||
<< "libssl" {
|
||||
{ [ os windows? ] [ "libssl-38.dll" ] }
|
||||
{ [ os macosx? ] [ "libssl.dylib" ] }
|
||||
{ [ os macosx? ] [ { "libssl.44.dylib" "libssl.42.dylib" } find-library-from-list ] }
|
||||
{ [ os unix? ] [ "libssl.so" ] }
|
||||
} cond cdecl add-library >>
|
||||
|
||||
|
|
|
@ -265,15 +265,14 @@ GENERIC: (compile) ( peg -- quot )
|
|||
: execute-parser ( word -- result )
|
||||
pos get apply-rule process-parser-result ;
|
||||
|
||||
: preset-parser-word ( parser -- parser word )
|
||||
gensym [ >>compiled ] keep ;
|
||||
: preset-parser-word ( parser -- word parser )
|
||||
gensym swap over >>compiled ;
|
||||
|
||||
: define-parser-word ( parser word -- )
|
||||
: define-parser-word ( word parser -- )
|
||||
! Return the body of the word that is the compiled version
|
||||
! of the parser.
|
||||
|
||||
2dup swap peg>> (compile) ( -- result ) define-declared
|
||||
swap id>> "peg-id" set-word-prop ;
|
||||
[ peg>> (compile) ( -- result ) define-declared ]
|
||||
[ id>> "peg-id" set-word-prop ] 2bi ;
|
||||
|
||||
: compile-parser ( parser -- word )
|
||||
! Look to see if the given parser has been compiled.
|
||||
|
@ -285,7 +284,7 @@ GENERIC: (compile) ( peg -- quot )
|
|||
dup compiled>> [
|
||||
nip
|
||||
] [
|
||||
preset-parser-word [ define-parser-word ] keep
|
||||
preset-parser-word dupd define-parser-word
|
||||
] if* ;
|
||||
|
||||
: compile-parser-quot ( parser -- quot )
|
||||
|
|
|
@ -1,9 +1,30 @@
|
|||
! Copyright (C) 2011 Joe Groff.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: assocs io.backend.unix kernel namespaces sequences
|
||||
threads ;
|
||||
USING: accessors assocs kernel math namespaces sequences threads ;
|
||||
IN: unix.signals
|
||||
|
||||
CONSTANT: signal-names
|
||||
{
|
||||
"SIGHUP" "SIGINT" "SIGQUIT" "SIGILL" "SIGTRAP" "SIGABRT"
|
||||
"SIGEMT" "SIGFPE" "SIGKILL" "SIGBUS" "SIGSEGV" "SIGSYS"
|
||||
"SIGPIPE" "SIGALRM" "SIGTERM" "SIGURG" "SIGSTOP" "SIGTSIP"
|
||||
"SIGCONT" "SIGCHLD" "SIGTTIN" "SIGTTOU" "SIGIO" "SIGXCPU"
|
||||
"SIGXFSZ" "SIGVTALRM" "SIGPROF" "SIGWINCH" "SIGINFO"
|
||||
"SIGUSR1" "SIGUSR2"
|
||||
}
|
||||
|
||||
TUPLE: signal n ;
|
||||
|
||||
GENERIC: signal-name ( obj -- str/f )
|
||||
|
||||
M: signal signal-name n>> signal-name ;
|
||||
|
||||
M: integer signal-name ( n -- str/f ) 1 - signal-names ?nth ;
|
||||
|
||||
SYMBOL: dispatch-signal-hook
|
||||
|
||||
dispatch-signal-hook [ [ drop ] ] initialize
|
||||
|
||||
<PRIVATE
|
||||
|
||||
INITIALIZED-SYMBOL: signal-handlers [ H{ } ]
|
||||
|
|
|
@ -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 ;
|
||||
|
|
|
@ -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
|
||||
|
||||
INITIALIZED-SYMBOL: classes [ H{ } clone ]
|
||||
|
|
|
@ -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?
|
||||
[ <local-reader> ]
|
||||
[ <local> ]
|
||||
if
|
||||
dup dup _ in? [ <local-reader> ] [ <local> ] if
|
||||
] H{ } map>assoc
|
||||
dup
|
||||
[ nip local-reader? ] assoc-filter
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue