From 666d4abaee5739c989eb870a8f99b14957766edc Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 25 Jun 2008 04:06:18 -0500 Subject: [PATCH] More fixes --- core/parser/parser-tests.factor | 14 +++++++------- core/parser/parser.factor | 8 ++------ core/prettyprint/prettyprint-tests.factor | 6 ++++-- core/source-files/source-files.factor | 5 ++--- core/vocabs/loader/loader-tests.factor | 2 +- extra/http/http-tests.factor | 10 +++++----- extra/opengl/shaders/shaders.factor | 2 +- extra/unicode/collation/collation-tests.factor | 2 +- extra/webapps/wee-url/wee-url.factor | 2 +- 9 files changed, 24 insertions(+), 27 deletions(-) diff --git a/core/parser/parser-tests.factor b/core/parser/parser-tests.factor index eb37d556d0..074b3738ac 100755 --- a/core/parser/parser-tests.factor +++ b/core/parser/parser-tests.factor @@ -198,7 +198,7 @@ IN: parser.tests [ "IN: parser.tests : x ; : y 3 throw ; this is an error" "a" parse-stream - ] [ parse-error? ] must-fail-with + ] [ source-file-error? ] must-fail-with [ t ] [ "y" "parser.tests" lookup >boolean @@ -298,12 +298,12 @@ IN: parser.tests [ "IN: parser.tests TUPLE: another-pred-test ; GENERIC: another-pred-test?" "removing-the-predicate" parse-stream - ] [ error>> error>> redefine-error? ] must-fail-with + ] [ error>> error>> error>> redefine-error? ] must-fail-with [ "IN: parser.tests TUPLE: class-redef-test ; TUPLE: class-redef-test ;" "redefining-a-class-1" parse-stream - ] [ error>> error>> redefine-error? ] must-fail-with + ] [ error>> error>> error>> redefine-error? ] must-fail-with [ ] [ "IN: parser.tests TUPLE: class-redef-test ; SYMBOL: class-redef-test" @@ -313,7 +313,7 @@ IN: parser.tests [ "IN: parser.tests TUPLE: class-redef-test ; SYMBOL: class-redef-test : class-redef-test ;" "redefining-a-class-3" parse-stream drop - ] [ error>> error>> redefine-error? ] must-fail-with + ] [ error>> error>> error>> redefine-error? ] must-fail-with [ ] [ "IN: parser.tests TUPLE: class-fwd-test ;" @@ -323,7 +323,7 @@ IN: parser.tests [ "IN: parser.tests \\ class-fwd-test" "redefining-a-class-3" parse-stream drop - ] [ error>> error>> no-word-error? ] must-fail-with + ] [ error>> error>> error>> no-word-error? ] must-fail-with [ ] [ "IN: parser.tests TUPLE: class-fwd-test ; SYMBOL: class-fwd-test" @@ -333,12 +333,12 @@ IN: parser.tests [ "IN: parser.tests \\ class-fwd-test" "redefining-a-class-3" parse-stream drop - ] [ error>> error>> no-word-error? ] must-fail-with + ] [ error>> error>> error>> no-word-error? ] must-fail-with [ "IN: parser.tests : foo ; TUPLE: foo ;" "redefining-a-class-4" parse-stream drop - ] [ error>> error>> redefine-error? ] must-fail-with + ] [ error>> error>> error>> redefine-error? ] must-fail-with [ ] [ "IN: parser.tests : foo ( x y -- z ) 1 2 ; : bar ( a -- b ) ;" eval diff --git a/core/parser/parser.factor b/core/parser/parser.factor index 44708f11f3..601245c463 100755 --- a/core/parser/parser.factor +++ b/core/parser/parser.factor @@ -24,12 +24,8 @@ t parser-notes set-global : note. ( str -- ) parser-notes? [ - file get file. - lexer get [ - lexer-line number>string print - ] [ - nl - ] if* + file get [ file. ] when* + lexer get line>> number>string write ": " write "Note: " write dup print ] when drop ; diff --git a/core/prettyprint/prettyprint-tests.factor b/core/prettyprint/prettyprint-tests.factor index d5f4dd5906..9e11611f5b 100755 --- a/core/prettyprint/prettyprint-tests.factor +++ b/core/prettyprint/prettyprint-tests.factor @@ -167,9 +167,11 @@ unit-test "another-retain-layout" another-retain-layout-test check-see ] unit-test +DEFER: parse-error-file + : another-soft-break-test { - "USING: namespaces parser sequences ;" + "USING: namespaces sequences ;" "IN: prettyprint.tests" ": another-soft-break-layout ( node -- quot )" " parse-error-file" @@ -183,7 +185,7 @@ unit-test : string-layout { - "USING: io kernel parser ;" + "USING: io kernel lexer ;" "IN: prettyprint.tests" ": string-layout-test ( error -- )" " \"Expected \" write dup unexpected-want expected>string write" diff --git a/core/source-files/source-files.factor b/core/source-files/source-files.factor index 0577dacc85..2c5c19708e 100755 --- a/core/source-files/source-files.factor +++ b/core/source-files/source-files.factor @@ -82,11 +82,10 @@ TUPLE: source-file-error file error ; file get >>file swap >>error ; -: file. ( file -- ) path>> pprint ; +: file. ( file -- ) path>> . ; M: source-file-error error. - "Error while parsing " write - [ file>> file. nl ] [ error>> error. ] bi ; + [ file>> file. ] [ error>> error. ] bi ; M: source-file-error summary error>> summary ; diff --git a/core/vocabs/loader/loader-tests.factor b/core/vocabs/loader/loader-tests.factor index 45b0d6b019..5ed0b0a34c 100755 --- a/core/vocabs/loader/loader-tests.factor +++ b/core/vocabs/loader/loader-tests.factor @@ -68,7 +68,7 @@ IN: vocabs.loader.tests "resource:core/vocabs/loader/test/a/a.factor" parse-stream -] [ error>> error>> no-word-error? ] must-fail-with +] [ error>> error>> error>> no-word-error? ] must-fail-with 0 "count-me" set-global diff --git a/extra/http/http-tests.factor b/extra/http/http-tests.factor index a920d4e67a..2a02d2cc20 100755 --- a/extra/http/http-tests.factor +++ b/extra/http/http-tests.factor @@ -1,8 +1,8 @@ -USING: http tools.test multiline tuple-syntax -io.streams.string io.encodings.utf8 io.encodings.string -kernel arrays splitting sequences -assocs io.sockets db db.sqlite continuations urls hashtables -accessors ; +USING: http tools.test multiline tuple-syntax io.streams.string +io.encodings.utf8 io.encodings.8-bit io.encodings.binary +io.encodings.string kernel arrays splitting sequences assocs +io.sockets db db.sqlite continuations urls hashtables accessors +; IN: http.tests [ "text/plain" latin1 ] [ "text/plain" parse-content-type ] unit-test diff --git a/extra/opengl/shaders/shaders.factor b/extra/opengl/shaders/shaders.factor index 7c18736bde..c05e180c11 100755 --- a/extra/opengl/shaders/shaders.factor +++ b/extra/opengl/shaders/shaders.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: kernel opengl.gl alien.c-types continuations namespaces assocs alien alien.strings libc opengl math sequences combinators -macros arrays io.encodings.ascii ; +combinators.lib macros arrays io.encodings.ascii ; IN: opengl.shaders : with-gl-shader-source-ptr ( string quot -- ) diff --git a/extra/unicode/collation/collation-tests.factor b/extra/unicode/collation/collation-tests.factor index 5bc25de804..d523a15ada 100755 --- a/extra/unicode/collation/collation-tests.factor +++ b/extra/unicode/collation/collation-tests.factor @@ -17,7 +17,7 @@ IN: unicode.collation.tests : test-equality { primary= secondary= tertiary= quaternary= } - [ execute ] 2with each ; + [ execute ] with with each ; [ f f f f ] [ "hello" "hi" test-equality ] unit-test [ t f f f ] [ "hello" "h\u0000e9llo" test-equality ] unit-test diff --git a/extra/webapps/wee-url/wee-url.factor b/extra/webapps/wee-url/wee-url.factor index 5f354b2a19..27187c4352 100644 --- a/extra/webapps/wee-url/wee-url.factor +++ b/extra/webapps/wee-url/wee-url.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2007 Doug Coleman. ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: math.ranges sequences random accessors +USING: math.ranges sequences random accessors combinators.lib kernel namespaces fry db.types db.tuples urls validators html.components html.forms http http.server.dispatchers furnace furnace.actions furnace.boilerplate furnace.redirection ;