Merge branch 'master' of git://factorcode.org/git/factor

db4
Daniel Ehrenberg 2010-03-17 21:38:35 -04:00
commit 8f92583946
10 changed files with 51 additions and 39 deletions

View File

@ -0,0 +1 @@
Joe Groff

View File

@ -0,0 +1,10 @@
! Copyright (C) 2010 Joe Groff.
! See http://factorcode.org/license.txt for BSD license.
USING: alien.c-types alien.parser summary sequences accessors
prettyprint ;
IN: alien.debugger
M: no-c-type summary name>> unparse "“" "” is not a C type" surround ;
M: *-in-c-type-name summary
name>> "Cannot define a C type “" "” that ends with an asterisk (*)" surround ;

View File

@ -0,0 +1,3 @@
Slava Pestov
Doug Coleman
Joe Groff

View File

@ -1,10 +1,10 @@
! Copyright (C) 2008, 2010 Slava Pestov, Doug Coleman. ! Copyright (C) 2008, 2010 Slava Pestov, Doug Coleman, Joe Groff.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien alien.c-types alien.parser USING: accessors alien alien.c-types alien.libraries arrays
alien.libraries arrays assocs classes combinators assocs classes combinators combinators.short-circuit
combinators.short-circuit compiler.units effects grouping compiler.units effects grouping kernel parser sequences
kernel parser sequences splitting words fry locals lexer splitting words fry locals lexer namespaces summary math
namespaces summary math vocabs.parser ; vocabs.parser ;
IN: alien.parser IN: alien.parser
: parse-c-type-name ( name -- word ) : parse-c-type-name ( name -- word )

View File

@ -23,6 +23,7 @@ IN: bootstrap.compiler
"prettyprint" vocab [ "prettyprint" vocab [
"stack-checker.errors.prettyprint" require "stack-checker.errors.prettyprint" require
"alien.prettyprint" require "alien.prettyprint" require
"alien.debugger" require
] when ] when
"cpu." cpu name>> append require "cpu." cpu name>> append require

View File

@ -1,15 +1,15 @@
! Copyright (C) 2004, 2010 Slava Pestov. ! Copyright (C) 2004, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: slots alien.c-types alien.parser arrays definitions generic USING: slots arrays definitions generic hashtables summary io
hashtables summary io kernel math namespaces make prettyprint kernel math namespaces make prettyprint prettyprint.config
prettyprint.config sequences assocs sequences.private strings sequences assocs sequences.private strings io.styles
io.styles io.pathnames vectors words system splitting math.parser io.pathnames vectors words system splitting math.parser
classes.mixin classes.tuple continuations continuations.private classes.mixin classes.tuple continuations continuations.private
combinators generic.math classes.builtin classes compiler.units combinators generic.math classes.builtin classes compiler.units
generic.standard generic.single vocabs init kernel.private generic.standard generic.single vocabs init kernel.private
io.encodings accessors math.order destructors source-files parser io.encodings accessors math.order destructors source-files
classes.tuple.parser effects.parser lexer generic.parser strings.parser parser classes.tuple.parser effects.parser lexer generic.parser
vocabs.loader vocabs.parser source-files.errors ; strings.parser vocabs.loader vocabs.parser source-files.errors ;
IN: debugger IN: debugger
GENERIC: error-help ( error -- topic ) GENERIC: error-help ( error -- topic )
@ -328,8 +328,10 @@ M: lexer-error error-help
M: bad-effect summary M: bad-effect summary
drop "Bad stack effect declaration" ; drop "Bad stack effect declaration" ;
M: invalid-row-variable summary M: invalid-row-variable summary
drop "Stack effect row variables can only occur as the first input or output" ; drop "Stack effect row variables can only occur as the first input or output" ;
M: row-variable-can't-have-type summary M: row-variable-can't-have-type summary
drop "Stack effect row variables cannot have a declared type" ; drop "Stack effect row variables cannot have a declared type" ;
@ -347,11 +349,6 @@ M: wrong-values summary drop "Quotation's stack effect does not match call site"
M: stack-effect-omits-dashes summary drop "Stack effect must contain “--”" ; M: stack-effect-omits-dashes summary drop "Stack effect must contain “--”" ;
M: no-c-type summary name>> unparse "“" "” is not a C type" surround ;
M: *-in-c-type-name summary
name>> "Cannot define a C type “" "” that ends with an asterisk (*)" surround ;
{ {
{ [ os windows? ] [ "debugger.windows" require ] } { [ os windows? ] [ "debugger.windows" require ] }
{ [ os unix? ] [ "debugger.unix" require ] } { [ os unix? ] [ "debugger.unix" require ] }

View File

@ -1 +1,2 @@
Slava Pestov Slava Pestov
Joe Groff

View File

@ -1,8 +1,7 @@
! Copyright (C) 2005, 2010 Slava Pestov. ! Copyright (C) 2005, 2010 Slava Pestov, Joe Groff.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: kernel math math.order strings arrays vectors sequences USING: kernel math math.order strings arrays vectors sequences
sequences.private accessors fry combinators.short-circuit sequences.private accessors fry combinators ;
combinators ;
IN: grouping IN: grouping
<PRIVATE <PRIVATE
@ -64,8 +63,7 @@ TUPLE: chunking-seq { seq read-only } { n read-only } ;
2dup >= [ - ] [ drop ] if ; inline 2dup >= [ - ] [ drop ] if ; inline
: check-circular-clumps ( seq n -- seq n ) : check-circular-clumps ( seq n -- seq n )
2dup { [ nip 0 <= ] [ swap length > ] } 2|| 2dup 1 - swap bounds-check 2drop ; inline
[ "Invalid clump size" throw ] when ; inline
PRIVATE> PRIVATE>
@ -115,15 +113,18 @@ INSTANCE: sliced-clumps abstract-clumps
: all-eq? ( seq -- ? ) [ eq? ] monotonic? ; : all-eq? ( seq -- ? ) [ eq? ] monotonic? ;
TUPLE: circular-slice TUPLE: circular-slice { from read-only } { to read-only } { seq read-only } ;
{ from read-only }
{ to read-only }
{ seq read-only } ;
INSTANCE: circular-slice virtual-sequence INSTANCE: circular-slice virtual-sequence
M: circular-slice equal? over slice? [ sequence= ] [ 2drop f ] if ; M: circular-slice equal? over slice? [ sequence= ] [ 2drop f ] if ;
M: circular-slice hashcode* [ sequence-hashcode ] recursive-hashcode ; M: circular-slice hashcode* [ sequence-hashcode ] recursive-hashcode ;
M: circular-slice length [ to>> ] [ from>> ] bi - ; inline M: circular-slice length [ to>> ] [ from>> ] bi - ; inline
M: circular-slice virtual-exemplar seq>> ; inline M: circular-slice virtual-exemplar seq>> ; inline
M: circular-slice virtual@ M: circular-slice virtual@
[ from>> + ] [ seq>> ] bi [ length slice-mod ] keep ; inline [ from>> + ] [ seq>> ] bi [ length slice-mod ] keep ; inline
@ -155,4 +156,3 @@ M: circular-clumps nth
: circular-clump ( seq n -- array ) : circular-clump ( seq n -- array )
<circular-clumps> { } like ; inline <circular-clumps> { } like ; inline

View File

@ -27,23 +27,23 @@ M: recursive-quotation-error summary
M: undeclared-recursion-error summary M: undeclared-recursion-error summary
word>> name>> word>> name>>
"The inline recursive word " " must be declared recursive" surround ; "The inline recursive word " " must be declared recursive" surround ;
M: diverging-recursion-error summary M: diverging-recursion-error summary
word>> name>> word>> name>>
"The recursive word " " digs arbitrarily deep into the stack" surround ; "The recursive word " " digs arbitrarily deep into the stack" surround ;
M: unbalanced-recursion-error summary M: unbalanced-recursion-error summary
word>> name>> word>> name>>
"The recursive word " " leaves with the stack having the wrong height" surround ; "The recursive word " " leaves with the stack having the wrong height" surround ;
M: inconsistent-recursive-call-error summary M: inconsistent-recursive-call-error summary
word>> name>> word>> name>>
"The recursive word " "The recursive word "
" calls itself with a different set of quotation parameters than were input" surround ; " calls itself with a different set of quotation parameters than were input" surround ;
M: transform-expansion-error summary M: transform-expansion-error summary
word>> name>> "Macro expansion of " " threw an error" surround ; word>> name>> "Macro expansion of " " threw an error" surround ;
M: transform-expansion-error error. M: transform-expansion-error error.
[ summary print ] [ summary print ]
@ -52,14 +52,13 @@ M: transform-expansion-error error.
tri ; tri ;
M: do-not-compile summary M: do-not-compile summary
word>> name>> "Cannot compile call to " prepend ; word>> name>> "Cannot compile call to “" "”" surround ;
M: unbalanced-branches-error summary M: unbalanced-branches-error summary
word>> name>> word>> name>>
"The input quotations to " " don't match their expected effects" surround ; "The input quotations to " " don't match their expected effects" surround ;
M: unbalanced-branches-error error. M: unbalanced-branches-error error.
dup summary print dup summary print
[ quots>> ] [ declareds>> ] [ actuals>> ] tri 3array flip [ quots>> ] [ declareds>> ] [ actuals>> ] tri 3array flip
{ "Input" "Expected" "Got" } prefix simple-table. ; { "Input" "Expected" "Got" } prefix simple-table. ;

View File

@ -21,6 +21,6 @@ TYPEDEF: __uint32_t blksize_t
TYPEDEF: __uint32_t fflags_t TYPEDEF: __uint32_t fflags_t
TYPEDEF: long ssize_t TYPEDEF: long ssize_t
TYPEDEF: int pid_t TYPEDEF: int pid_t
TYPEDEF: int time_t TYPEDEF: long time_t
ALIAS: <time_t> <int> ALIAS: <time_t> <long>