From 01e5aadcd055b18c06d0bd6ec7b44d3b85402ecc Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 17 Mar 2010 17:39:12 +1300 Subject: [PATCH 1/5] unix.types.freebsd: fix time_t typedef --- basis/unix/types/freebsd/freebsd.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/unix/types/freebsd/freebsd.factor b/basis/unix/types/freebsd/freebsd.factor index 215e344231..4973df989d 100644 --- a/basis/unix/types/freebsd/freebsd.factor +++ b/basis/unix/types/freebsd/freebsd.factor @@ -21,6 +21,6 @@ TYPEDEF: __uint32_t blksize_t TYPEDEF: __uint32_t fflags_t TYPEDEF: long ssize_t TYPEDEF: int pid_t -TYPEDEF: int time_t +TYPEDEF: long time_t -ALIAS: +ALIAS: From cdee2439d8163c663346894b28d68b976b1b7207 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 17 Mar 2010 19:13:25 +1300 Subject: [PATCH 2/5] grouping: minor cleanup --- basis/grouping/authors.txt | 1 + basis/grouping/grouping.factor | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/basis/grouping/authors.txt b/basis/grouping/authors.txt index 1901f27a24..580f882c8d 100644 --- a/basis/grouping/authors.txt +++ b/basis/grouping/authors.txt @@ -1 +1,2 @@ Slava Pestov +Joe Groff diff --git a/basis/grouping/grouping.factor b/basis/grouping/grouping.factor index 304fd50fcc..1a7e267c90 100644 --- a/basis/grouping/grouping.factor +++ b/basis/grouping/grouping.factor @@ -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. USING: kernel math math.order strings arrays vectors sequences -sequences.private accessors fry combinators.short-circuit -combinators ; +sequences.private accessors fry combinators ; IN: grouping = [ - ] [ drop ] if ; inline : check-circular-clumps ( seq n -- seq n ) - 2dup { [ nip 0 <= ] [ swap length > ] } 2|| - [ "Invalid clump size" throw ] when ; inline + 2dup 1 - swap bounds-check 2drop ; inline PRIVATE> @@ -115,15 +113,18 @@ INSTANCE: sliced-clumps abstract-clumps : all-eq? ( seq -- ? ) [ eq? ] monotonic? ; -TUPLE: circular-slice - { from read-only } - { to read-only } - { seq read-only } ; +TUPLE: circular-slice { from read-only } { to read-only } { seq read-only } ; + INSTANCE: circular-slice virtual-sequence + M: circular-slice equal? over slice? [ sequence= ] [ 2drop f ] if ; + M: circular-slice hashcode* [ sequence-hashcode ] recursive-hashcode ; + M: circular-slice length [ to>> ] [ from>> ] bi - ; inline + M: circular-slice virtual-exemplar seq>> ; inline + M: circular-slice virtual@ [ from>> + ] [ seq>> ] bi [ length slice-mod ] keep ; inline @@ -155,4 +156,3 @@ M: circular-clumps nth : circular-clump ( seq n -- array ) { } like ; inline - From 6ff0393e2f7a4d701b9d7fdcad7335b7e6dcc6e4 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 17 Mar 2010 19:19:43 +1300 Subject: [PATCH 3/5] debugger: Untangle some dodgy dependencies that were loading locals before prettyprint, resulting in locals.prettyprint not being loaded --- basis/alien/debugger/authors.txt | 1 + basis/alien/debugger/debugger.factor | 9 +++++++++ basis/alien/parser/authors.txt | 3 +++ basis/alien/parser/parser.factor | 12 ++++++------ basis/bootstrap/compiler/compiler.factor | 1 + basis/debugger/debugger.factor | 21 +++++++++------------ 6 files changed, 29 insertions(+), 18 deletions(-) create mode 100644 basis/alien/debugger/authors.txt create mode 100644 basis/alien/debugger/debugger.factor create mode 100644 basis/alien/parser/authors.txt diff --git a/basis/alien/debugger/authors.txt b/basis/alien/debugger/authors.txt new file mode 100644 index 0000000000..f13c9c1e77 --- /dev/null +++ b/basis/alien/debugger/authors.txt @@ -0,0 +1 @@ +Joe Groff diff --git a/basis/alien/debugger/debugger.factor b/basis/alien/debugger/debugger.factor new file mode 100644 index 0000000000..4ac3174bb7 --- /dev/null +++ b/basis/alien/debugger/debugger.factor @@ -0,0 +1,9 @@ +! Copyright (C) 2010 Joe Groff. +! See http://factorcode.org/license.txt for BSD license. +USING: ; +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 ; diff --git a/basis/alien/parser/authors.txt b/basis/alien/parser/authors.txt new file mode 100644 index 0000000000..c299e0ac31 --- /dev/null +++ b/basis/alien/parser/authors.txt @@ -0,0 +1,3 @@ +Slava Pestov +Doug Coleman +Joe Groff diff --git a/basis/alien/parser/parser.factor b/basis/alien/parser/parser.factor index c9ec2c3889..4c5f5dbd6a 100644 --- a/basis/alien/parser/parser.factor +++ b/basis/alien/parser/parser.factor @@ -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. -USING: accessors alien alien.c-types alien.parser -alien.libraries arrays assocs classes combinators -combinators.short-circuit compiler.units effects grouping -kernel parser sequences splitting words fry locals lexer -namespaces summary math vocabs.parser ; +USING: accessors alien alien.c-types alien.libraries arrays +assocs classes combinators combinators.short-circuit +compiler.units effects grouping kernel parser sequences +splitting words fry locals lexer namespaces summary math +vocabs.parser ; IN: alien.parser : parse-c-type-name ( name -- word ) diff --git a/basis/bootstrap/compiler/compiler.factor b/basis/bootstrap/compiler/compiler.factor index edb0bdf2ae..0bdb2494f8 100644 --- a/basis/bootstrap/compiler/compiler.factor +++ b/basis/bootstrap/compiler/compiler.factor @@ -23,6 +23,7 @@ IN: bootstrap.compiler "prettyprint" vocab [ "stack-checker.errors.prettyprint" require "alien.prettyprint" require + "alien.debugger" require ] when "cpu." cpu name>> append require diff --git a/basis/debugger/debugger.factor b/basis/debugger/debugger.factor index b7ecc5acec..c34a50190f 100644 --- a/basis/debugger/debugger.factor +++ b/basis/debugger/debugger.factor @@ -1,15 +1,15 @@ ! Copyright (C) 2004, 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: slots alien.c-types alien.parser arrays definitions generic -hashtables summary io kernel math namespaces make prettyprint -prettyprint.config sequences assocs sequences.private strings -io.styles io.pathnames vectors words system splitting math.parser +USING: slots arrays definitions generic hashtables summary io +kernel math namespaces make prettyprint prettyprint.config +sequences assocs sequences.private strings io.styles +io.pathnames vectors words system splitting math.parser classes.mixin classes.tuple continuations continuations.private combinators generic.math classes.builtin classes compiler.units generic.standard generic.single vocabs init kernel.private -io.encodings accessors math.order destructors source-files parser -classes.tuple.parser effects.parser lexer generic.parser strings.parser -vocabs.loader vocabs.parser source-files.errors ; +io.encodings accessors math.order destructors source-files +parser classes.tuple.parser effects.parser lexer generic.parser +strings.parser vocabs.loader vocabs.parser source-files.errors ; IN: debugger GENERIC: error-help ( error -- topic ) @@ -328,8 +328,10 @@ M: lexer-error error-help M: bad-effect summary drop "Bad stack effect declaration" ; + M: invalid-row-variable summary drop "Stack effect row variables can only occur as the first input or output" ; + M: row-variable-can't-have-type summary 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: 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 unix? ] [ "debugger.unix" require ] } From fb06bbcae72af1b23f0ac634286cd74b84a850a9 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 17 Mar 2010 19:20:28 +1300 Subject: [PATCH 4/5] stack-checker.errors.prettyprint: give it some smart quotes lovin' --- .../errors/prettyprint/prettyprint.factor | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/basis/stack-checker/errors/prettyprint/prettyprint.factor b/basis/stack-checker/errors/prettyprint/prettyprint.factor index 90d12c6235..3d4480a4aa 100644 --- a/basis/stack-checker/errors/prettyprint/prettyprint.factor +++ b/basis/stack-checker/errors/prettyprint/prettyprint.factor @@ -27,23 +27,23 @@ M: recursive-quotation-error summary M: undeclared-recursion-error summary 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 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 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 word>> name>> - "The recursive word " - " calls itself with a different set of quotation parameters than were input" surround ; + "The recursive word “" + "” calls itself with a different set of quotation parameters than were input" surround ; 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. [ summary print ] @@ -52,14 +52,13 @@ M: transform-expansion-error error. tri ; M: do-not-compile summary - word>> name>> "Cannot compile call to " prepend ; + word>> name>> "Cannot compile call to “" "”" surround ; M: unbalanced-branches-error summary 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. dup summary print [ quots>> ] [ declareds>> ] [ actuals>> ] tri 3array flip { "Input" "Expected" "Got" } prefix simple-table. ; - From 75d0f51b305d4df0d03475267616927741e5c861 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 17 Mar 2010 19:35:12 +1300 Subject: [PATCH 5/5] alien.debugger: fix USING: form --- basis/alien/debugger/debugger.factor | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/basis/alien/debugger/debugger.factor b/basis/alien/debugger/debugger.factor index 4ac3174bb7..a04697155e 100644 --- a/basis/alien/debugger/debugger.factor +++ b/basis/alien/debugger/debugger.factor @@ -1,6 +1,7 @@ ! Copyright (C) 2010 Joe Groff. ! See http://factorcode.org/license.txt for BSD license. -USING: ; +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 ;