Merge remote-tracking branch 'origin/master' into modern-harvey3
commit
5963f3a520
|
@ -106,6 +106,7 @@ CONSTANT: default-components
|
||||||
"stage2: deployment mode" print
|
"stage2: deployment mode" print
|
||||||
] [
|
] [
|
||||||
"debugger" require
|
"debugger" require
|
||||||
|
os unix? [ "debugger.unix" require ] when
|
||||||
"listener" require
|
"listener" require
|
||||||
] if
|
] if
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,9 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: debugger io kernel math prettyprint sequences system
|
USING: accessors debugger io kernel math prettyprint sequences
|
||||||
io.launcher.unix accessors strings ;
|
system unix.signals ;
|
||||||
IN: debugger.unix
|
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. ( n -- )
|
||||||
signal-name [ " (" ")" surround write ] when* ;
|
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.backend io.backend.unix.multiplexers io.buffers io.files
|
||||||
io.ports io.timeouts kernel kernel.private libc locals make math
|
io.ports io.timeouts kernel kernel.private libc locals make math
|
||||||
namespaces sequences summary system threads unix unix.ffi
|
namespaces sequences summary system threads unix unix.ffi
|
||||||
unix.stat unix.types ;
|
unix.signals unix.stat unix.types ;
|
||||||
QUALIFIED: io
|
QUALIFIED: io
|
||||||
IN: io.backend.unix
|
IN: io.backend.unix
|
||||||
|
|
||||||
|
@ -185,8 +185,6 @@ M: stdin cancel-operation
|
||||||
size-read-fd <fd> init-fd <input-port> >>size
|
size-read-fd <fd> init-fd <input-port> >>size
|
||||||
data-read-fd <fd> >>data ;
|
data-read-fd <fd> >>data ;
|
||||||
|
|
||||||
INITIALIZED-SYMBOL: dispatch-signal-hook [ [ drop ] ]
|
|
||||||
|
|
||||||
: signal-pipe-fd ( -- n )
|
: signal-pipe-fd ( -- n )
|
||||||
OBJ-SIGNAL-PIPE special-object ; inline
|
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
|
! Tested with OpenSSL 0.9.8a_0 on Mac OS X 10.4.9 PowerPC
|
||||||
!
|
!
|
||||||
! export LD_LIBRARY_PATH=/opt/local/lib
|
! export LD_LIBRARY_PATH=/opt/local/lib
|
||||||
|
|
||||||
USING: alien alien.c-types alien.destructors alien.libraries
|
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
|
IN: openssl.libcrypto
|
||||||
|
|
||||||
<< "libcrypto" {
|
<< "libcrypto" {
|
||||||
{ [ os windows? ] [ "libcrypto-37.dll" ] }
|
{ [ 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" ] }
|
{ [ os unix? ] [ "libcrypto.so" ] }
|
||||||
} cond cdecl add-library >>
|
} cond cdecl add-library >>
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
! Portions copyright (C) 2008 Slava Pestov
|
! Portions copyright (C) 2008 Slava Pestov
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien alien.c-types alien.destructors alien.libraries
|
USING: alien alien.c-types alien.destructors alien.libraries
|
||||||
alien.parser alien.syntax classes.struct combinators kernel literals
|
alien.libraries.finder alien.parser alien.syntax classes.struct
|
||||||
namespaces openssl.libcrypto system ;
|
combinators kernel literals namespaces openssl.libcrypto system ;
|
||||||
|
|
||||||
IN: openssl.libssl
|
IN: openssl.libssl
|
||||||
|
|
||||||
<< "libssl" {
|
<< "libssl" {
|
||||||
{ [ os windows? ] [ "libssl-38.dll" ] }
|
{ [ 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" ] }
|
{ [ os unix? ] [ "libssl.so" ] }
|
||||||
} cond cdecl add-library >>
|
} cond cdecl add-library >>
|
||||||
|
|
||||||
|
|
|
@ -265,15 +265,14 @@ GENERIC: (compile) ( peg -- quot )
|
||||||
: execute-parser ( word -- result )
|
: execute-parser ( word -- result )
|
||||||
pos get apply-rule process-parser-result ;
|
pos get apply-rule process-parser-result ;
|
||||||
|
|
||||||
: preset-parser-word ( parser -- parser word )
|
: preset-parser-word ( parser -- word parser )
|
||||||
gensym [ >>compiled ] keep ;
|
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
|
! Return the body of the word that is the compiled version
|
||||||
! of the parser.
|
! of the parser.
|
||||||
|
[ peg>> (compile) ( -- result ) define-declared ]
|
||||||
2dup swap peg>> (compile) ( -- result ) define-declared
|
[ id>> "peg-id" set-word-prop ] 2bi ;
|
||||||
swap id>> "peg-id" set-word-prop ;
|
|
||||||
|
|
||||||
: compile-parser ( parser -- word )
|
: compile-parser ( parser -- word )
|
||||||
! Look to see if the given parser has been compiled.
|
! Look to see if the given parser has been compiled.
|
||||||
|
@ -285,7 +284,7 @@ GENERIC: (compile) ( peg -- quot )
|
||||||
dup compiled>> [
|
dup compiled>> [
|
||||||
nip
|
nip
|
||||||
] [
|
] [
|
||||||
preset-parser-word [ define-parser-word ] keep
|
preset-parser-word dupd define-parser-word
|
||||||
] if* ;
|
] if* ;
|
||||||
|
|
||||||
: compile-parser-quot ( parser -- quot )
|
: compile-parser-quot ( parser -- quot )
|
||||||
|
|
|
@ -1,9 +1,30 @@
|
||||||
! Copyright (C) 2011 Joe Groff.
|
! Copyright (C) 2011 Joe Groff.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: assocs io.backend.unix kernel namespaces sequences
|
USING: accessors assocs kernel math namespaces sequences threads ;
|
||||||
threads ;
|
|
||||||
IN: unix.signals
|
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
|
<PRIVATE
|
||||||
|
|
||||||
INITIALIZED-SYMBOL: signal-handlers [ H{ } ]
|
INITIALIZED-SYMBOL: signal-handlers [ H{ } ]
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! 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
|
IN: smalltalk.ast
|
||||||
|
|
||||||
SINGLETONS: nil self super ;
|
SINGLETONS: nil self super ;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! 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
|
IN: smalltalk.classes
|
||||||
|
|
||||||
INITIALIZED-SYMBOL: classes [ H{ } clone ]
|
INITIALIZED-SYMBOL: classes [ H{ } clone ]
|
||||||
|
|
|
@ -4,8 +4,7 @@ USING: accessors arrays assocs combinators continuations fry
|
||||||
generic kernel locals locals.types math quotations sequences
|
generic kernel locals locals.types math quotations sequences
|
||||||
sequences.generalizations sets smalltalk.ast smalltalk.classes
|
sequences.generalizations sets smalltalk.ast smalltalk.classes
|
||||||
smalltalk.compiler.assignment smalltalk.compiler.lexenv
|
smalltalk.compiler.assignment smalltalk.compiler.lexenv
|
||||||
smalltalk.compiler.return smalltalk.selectors splitting vocabs
|
smalltalk.compiler.return smalltalk.selectors splitting words ;
|
||||||
words ;
|
|
||||||
IN: smalltalk.compiler
|
IN: smalltalk.compiler
|
||||||
|
|
||||||
GENERIC: compile-ast ( lexenv ast -- quot )
|
GENERIC: compile-ast ( lexenv ast -- quot )
|
||||||
|
@ -69,10 +68,7 @@ M: ast-return compile-ast
|
||||||
[ [ arguments>> ] [ temporaries>> ] bi append ]
|
[ [ arguments>> ] [ temporaries>> ] bi append ]
|
||||||
[ body>> [ assigned-locals ] map concat fast-set ] bi
|
[ body>> [ assigned-locals ] map concat fast-set ] bi
|
||||||
'[
|
'[
|
||||||
dup dup _ in?
|
dup dup _ in? [ <local-reader> ] [ <local> ] if
|
||||||
[ <local-reader> ]
|
|
||||||
[ <local> ]
|
|
||||||
if
|
|
||||||
] H{ } map>assoc
|
] H{ } map>assoc
|
||||||
dup
|
dup
|
||||||
[ nip local-reader? ] assoc-filter
|
[ nip local-reader? ] assoc-filter
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: assocs kernel accessors quotations slots words
|
USING: accessors assocs combinators combinators.short-circuit
|
||||||
sequences namespaces combinators combinators.short-circuit
|
kernel namespaces quotations sequences slots smalltalk.classes
|
||||||
summary smalltalk.classes ;
|
summary words ;
|
||||||
IN: smalltalk.compiler.lexenv
|
IN: smalltalk.compiler.lexenv
|
||||||
|
|
||||||
! local-readers: assoc string => word
|
! local-readers: assoc string => word
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: io.files io.encodings.utf8
|
USING: compiler.units io.encodings.utf8 io.files
|
||||||
compiler.units smalltalk.parser smalltalk.compiler
|
smalltalk.compiler smalltalk.parser ;
|
||||||
smalltalk.library ;
|
|
||||||
IN: smalltalk.eval
|
IN: smalltalk.eval
|
||||||
|
|
||||||
: eval-smalltalk ( string -- result )
|
: eval-smalltalk ( string -- result )
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: peg peg.ebnf smalltalk.ast sequences sequences.deep strings
|
USING: accessors arrays assocs byte-arrays kernel math
|
||||||
math.parser multiline kernel arrays byte-arrays math assocs accessors ;
|
math.parser multiline peg.ebnf sequences sequences.deep
|
||||||
|
smalltalk.ast strings ;
|
||||||
IN: smalltalk.parser
|
IN: smalltalk.parser
|
||||||
|
|
||||||
! :mode=text:noTabs=true:
|
! :mode=text:noTabs=true:
|
||||||
|
@ -131,7 +132,7 @@ BinaryMessage = OptionalWhiteSpace
|
||||||
OptionalWhiteSpace
|
OptionalWhiteSpace
|
||||||
(UnaryMessageSend | Operand):rhs
|
(UnaryMessageSend | Operand):rhs
|
||||||
=> [[ selector { rhs } ast-message boa ]]
|
=> [[ selector { rhs } ast-message boa ]]
|
||||||
|
|
||||||
KeywordMessageSegment = Keyword:k OptionalWhiteSpace (BinaryMessageSend | UnaryMessageSend | Operand):arg => [[ { k arg } ]]
|
KeywordMessageSegment = Keyword:k OptionalWhiteSpace (BinaryMessageSend | UnaryMessageSend | Operand):arg => [[ { k arg } ]]
|
||||||
KeywordMessage = OptionalWhiteSpace
|
KeywordMessage = OptionalWhiteSpace
|
||||||
KeywordMessageSegment:h
|
KeywordMessageSegment:h
|
||||||
|
|
Loading…
Reference in New Issue