From 30a44225cd0201d810b0bb5d497820345528ac89 Mon Sep 17 00:00:00 2001 From: Slava Pestov <slava@slava-pestovs-macbook-pro.local> Date: Tue, 14 Apr 2009 15:04:58 -0500 Subject: [PATCH 01/14] Fix code for floats syntax change --- basis/lcs/lcs.factor | 2 +- core/sequences/sequences-tests.factor | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/lcs/lcs.factor b/basis/lcs/lcs.factor index 8c67590697..d32b199873 100644 --- a/basis/lcs/lcs.factor +++ b/basis/lcs/lcs.factor @@ -8,7 +8,7 @@ IN: lcs 0 1 ? + [ [ 1+ ] bi@ ] dip min min ; : lcs-step ( insert delete change same? -- next ) - 1 -1./0. ? + max max ; ! -1./0. is -inf (float) + 1 -1/0. ? + max max ; ! -1/0. is -inf (float) :: loop-step ( i j matrix old new step -- ) i j 1+ matrix nth nth ! insertion diff --git a/core/sequences/sequences-tests.factor b/core/sequences/sequences-tests.factor index da495f410f..85f9d56596 100644 --- a/core/sequences/sequences-tests.factor +++ b/core/sequences/sequences-tests.factor @@ -227,7 +227,7 @@ unit-test [ -3 10 nth ] must-fail [ 11 10 nth ] must-fail -[ -1./0. 0 delete-nth ] must-fail +[ -1/0. 0 delete-nth ] must-fail [ "" ] [ "" [ CHAR: \s = ] trim ] unit-test [ "" ] [ "" [ CHAR: \s = ] trim-head ] unit-test [ "" ] [ "" [ CHAR: \s = ] trim-tail ] unit-test From 1c68b389cc0a07164137b09fb6d72797b78d48e0 Mon Sep 17 00:00:00 2001 From: Slava Pestov <slava@slava-pestovs-macbook-pro.local> Date: Tue, 14 Apr 2009 15:05:10 -0500 Subject: [PATCH 02/14] Document special float values --- core/math/parser/parser-docs.factor | 2 +- core/syntax/syntax-docs.factor | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/math/parser/parser-docs.factor b/core/math/parser/parser-docs.factor index bcc75a842a..ba0df3e357 100644 --- a/core/math/parser/parser-docs.factor +++ b/core/math/parser/parser-docs.factor @@ -25,7 +25,7 @@ $nl ABOUT: "number-strings" HELP: digits>integer -{ $values { "seq" "a sequence of integers" } { "radix" "an integer between 2 and 36" } { "n" integer } } +{ $values { "seq" "a sequence of integers" } { "radix" "an integer between 2 and 36" } { "n/f" { $maybe integer } } } { $description "Converts a sequence of digits (with most significant digit first) into an integer." } { $notes "This is one of the factors of " { $link string>number } "." } ; diff --git a/core/syntax/syntax-docs.factor b/core/syntax/syntax-docs.factor index bb8791df97..33a0096ff9 100644 --- a/core/syntax/syntax-docs.factor +++ b/core/syntax/syntax-docs.factor @@ -66,6 +66,12 @@ ARTICLE: "syntax-floats" "Float syntax" "7.e13" "1.0e-5" } +"There are three special float values:" +{ $table +{ "Positive infinity" { $snippet "1/0." } } +{ "Negative infinity" { $snippet "-1/0." } } +{ "Not-a-number" { $snippet "0/0." } } +} "More information on floats can be found in " { $link "floats" } "." ; ARTICLE: "syntax-complex-numbers" "Complex number syntax" From da38a259630ec91599030754680b92393d7882b5 Mon Sep 17 00:00:00 2001 From: Slava Pestov <slava@slava-pestovs-macbook-pro.local> Date: Tue, 14 Apr 2009 17:09:16 -0500 Subject: [PATCH 03/14] More float syntax fixes --- extra/math/analysis/analysis.factor | 4 ++-- extra/webapps/site-watcher/site-watcher.factor | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/extra/math/analysis/analysis.factor b/extra/math/analysis/analysis.factor index fa01b0376d..a1fc0bd07b 100755 --- a/extra/math/analysis/analysis.factor +++ b/extra/math/analysis/analysis.factor @@ -42,7 +42,7 @@ PRIVATE> #! gamma(x) = integral 0..inf [ t^(x-1) exp(-t) ] dt #! gamma(n+1) = n! for n > 0 dup { [ 0.0 <= ] [ 1.0 mod zero? ] } 1&& [ - drop 1./0. + drop 1/0. ] [ [ abs gamma-lanczos6 ] keep dup 0 > [ drop ] [ gamma-neg ] if ] if ; @@ -51,7 +51,7 @@ PRIVATE> #! gammaln(x) is an alternative when gamma(x)'s range #! varies too widely dup 0 < [ - drop 1./0. + drop 1/0. ] [ [ abs gammaln-lanczos6 ] keep dup 0 > [ drop ] [ gamma-neg ] if ] if ; diff --git a/extra/webapps/site-watcher/site-watcher.factor b/extra/webapps/site-watcher/site-watcher.factor index edd8104a7e..b60f1b1b6a 100644 --- a/extra/webapps/site-watcher/site-watcher.factor +++ b/extra/webapps/site-watcher/site-watcher.factor @@ -1,15 +1,16 @@ ! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors assocs db.sqlite furnace furnace.actions furnace.alloy -furnace.auth furnace.auth.features.deactivate-user +USING: accessors assocs db.sqlite furnace furnace.actions +furnace.alloy furnace.auth furnace.auth.features.deactivate-user furnace.auth.features.edit-profile furnace.auth.features.recover-password furnace.auth.features.registration furnace.auth.login furnace.boilerplate furnace.redirection html.forms http.server http.server.dispatchers kernel namespaces site-watcher site-watcher.db site-watcher.private urls validators io.sockets.secure.unix.debug -io.servers.connection db db.tuples sequences webapps.site-watcher.common -webapps.site-watcher.watching webapps.site-watcher.spidering ; +io.servers.connection io.files.temp db db.tuples sequences +webapps.site-watcher.common webapps.site-watcher.watching +webapps.site-watcher.spidering ; QUALIFIED: assocs IN: webapps.site-watcher From 9f09463d2f7eeacec7ff1766b647a7ed32a73991 Mon Sep 17 00:00:00 2001 From: Slava Pestov <slava@shill.internal.stack-effects.com> Date: Tue, 14 Apr 2009 19:24:32 -0500 Subject: [PATCH 04/14] help.html: workaround for cygwin not liking unicode path names --- basis/help/html/html.factor | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/basis/help/html/html.factor b/basis/help/html/html.factor index d880af5b55..3de8dae218 100644 --- a/basis/help/html/html.factor +++ b/basis/help/html/html.factor @@ -4,24 +4,26 @@ USING: io.encodings.utf8 io.encodings.ascii io.encodings.binary io.files io.files.temp io.directories html.streams help kernel assocs sequences make words accessors arrays help.topics vocabs tools.vocabs help.vocabs namespaces prettyprint io -vocabs.loader serialize fry memoize unicode.case math.order +vocabs.loader serialize fry memoize ascii unicode.case math.order sorting debugger html xml.syntax xml.writer ; IN: help.html : escape-char ( ch -- ) - dup H{ - { CHAR: " "__quo__" } - { CHAR: * "__star__" } - { CHAR: : "__colon__" } - { CHAR: < "__lt__" } - { CHAR: > "__gt__" } - { CHAR: ? "__que__" } - { CHAR: \\ "__back__" } - { CHAR: | "__pipe__" } - { CHAR: / "__slash__" } - { CHAR: , "__comma__" } - { CHAR: @ "__at__" } - } at [ % ] [ , ] ?if ; + dup ascii? [ + dup H{ + { CHAR: " "__quo__" } + { CHAR: * "__star__" } + { CHAR: : "__colon__" } + { CHAR: < "__lt__" } + { CHAR: > "__gt__" } + { CHAR: ? "__que__" } + { CHAR: \\ "__back__" } + { CHAR: | "__pipe__" } + { CHAR: / "__slash__" } + { CHAR: , "__comma__" } + { CHAR: @ "__at__" } + } at [ % ] [ , ] ?if + ] [ number>string "__" "__" surround ] if ; : escape-filename ( string -- filename ) [ [ escape-char ] each ] "" make ; From 8bbc3d577e58ffcf5813d591185df1cd5d77d887 Mon Sep 17 00:00:00 2001 From: Slava Pestov <slava@shill.internal.stack-effects.com> Date: Tue, 14 Apr 2009 19:57:25 -0500 Subject: [PATCH 05/14] Load fix --- basis/help/html/html.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/help/html/html.factor b/basis/help/html/html.factor index 3de8dae218..f4a8742486 100644 --- a/basis/help/html/html.factor +++ b/basis/help/html/html.factor @@ -5,7 +5,7 @@ io.files io.files.temp io.directories html.streams help kernel assocs sequences make words accessors arrays help.topics vocabs tools.vocabs help.vocabs namespaces prettyprint io vocabs.loader serialize fry memoize ascii unicode.case math.order -sorting debugger html xml.syntax xml.writer ; +sorting debugger html xml.syntax xml.writer math.parser ; IN: help.html : escape-char ( ch -- ) @@ -23,7 +23,7 @@ IN: help.html { CHAR: , "__comma__" } { CHAR: @ "__at__" } } at [ % ] [ , ] ?if - ] [ number>string "__" "__" surround ] if ; + ] [ number>string "__" "__" surround % ] if ; : escape-filename ( string -- filename ) [ [ escape-char ] each ] "" make ; From 8d0bc707039a506628418f4ed68113a0a5a849c8 Mon Sep 17 00:00:00 2001 From: Bruno Deferrari <utizoc@gmail.com> Date: Tue, 14 Apr 2009 23:13:21 -0300 Subject: [PATCH 06/14] irc.client: Fix NICK message declaration --- extra/irc/client/internals/internals.factor | 2 +- extra/irc/messages/messages.factor | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extra/irc/client/internals/internals.factor b/extra/irc/client/internals/internals.factor index 2081ae4510..5d7cca4bfa 100644 --- a/extra/irc/client/internals/internals.factor +++ b/extra/irc/client/internals/internals.factor @@ -91,7 +91,7 @@ M: irc-message handle-outgoing-irc irc-message>string irc-print t ; : handle-reader-message ( irc-message -- ) irc> in-messages>> mailbox-put ; : (handle-disconnect) ( -- ) - irc> in-messages>> irc-disconnected swap mailbox-put + irc-disconnected irc> in-messages>> mailbox-put irc> reconnect-time>> sleep (connect-irc) (do-login) ; diff --git a/extra/irc/messages/messages.factor b/extra/irc/messages/messages.factor index 2ea476e1b4..a6bf02f8a7 100755 --- a/extra/irc/messages/messages.factor +++ b/extra/irc/messages/messages.factor @@ -7,7 +7,7 @@ IN: irc.messages ! connection IRC: pass "PASS" password ; -IRC: nick "NICK" nickname ; +IRC: nick "NICK" : nickname ; IRC: user "USER" user mode _ : realname ; IRC: oper "OPER" name password ; IRC: mode "MODE" name mode parameter ; From dbb35d3500d36b8450d778f9598f0a27d38f830a Mon Sep 17 00:00:00 2001 From: Bruno Deferrari <utizoc@gmail.com> Date: Tue, 14 Apr 2009 23:16:31 -0300 Subject: [PATCH 07/14] irc.logbot: Initial version --- extra/irc/logbot/authors.txt | 1 + extra/irc/logbot/log-line/authors.txt | 1 + extra/irc/logbot/log-line/log-line.factor | 37 +++++++++++++++ extra/irc/logbot/log-line/summary.txt | 1 + extra/irc/logbot/logbot.factor | 56 +++++++++++++++++++++++ extra/irc/logbot/summary.txt | 1 + 6 files changed, 97 insertions(+) create mode 100644 extra/irc/logbot/authors.txt create mode 100644 extra/irc/logbot/log-line/authors.txt create mode 100644 extra/irc/logbot/log-line/log-line.factor create mode 100644 extra/irc/logbot/log-line/summary.txt create mode 100644 extra/irc/logbot/logbot.factor create mode 100644 extra/irc/logbot/summary.txt diff --git a/extra/irc/logbot/authors.txt b/extra/irc/logbot/authors.txt new file mode 100644 index 0000000000..f4a8cb1dc2 --- /dev/null +++ b/extra/irc/logbot/authors.txt @@ -0,0 +1 @@ +Bruno Deferrari diff --git a/extra/irc/logbot/log-line/authors.txt b/extra/irc/logbot/log-line/authors.txt new file mode 100644 index 0000000000..f4a8cb1dc2 --- /dev/null +++ b/extra/irc/logbot/log-line/authors.txt @@ -0,0 +1 @@ +Bruno Deferrari diff --git a/extra/irc/logbot/log-line/log-line.factor b/extra/irc/logbot/log-line/log-line.factor new file mode 100644 index 0000000000..6119e8e81c --- /dev/null +++ b/extra/irc/logbot/log-line/log-line.factor @@ -0,0 +1,37 @@ +! Copyright (C) 2009 Bruno Deferrari. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors irc.messages irc.messages.base kernel make ; +EXCLUDE: sequences => join ; +IN: irc.logbot.log-line + +: dot-or-parens ( string -- string ) + [ "." ] [ " (" prepend ")." append ] if-empty ; + +GENERIC: >log-line ( object -- line ) + +M: irc-message >log-line line>> ; + +M: privmsg >log-line + [ "<" % dup sender>> % "> " % text>> % ] "" make ; + +M: join >log-line + [ "* " % sender>> % " has entered the channel." % ] "" make ; + +M: part >log-line + [ "* " % dup sender>> % " has left the channel" % + comment>> dot-or-parens % ] "" make ; + +M: quit >log-line + [ "* " % dup sender>> % " has left IRC" % + comment>> dot-or-parens % ] "" make ; + +M: kick >log-line + [ "* " % dup sender>> % " has kicked " % dup user>> % + " from the channel" % comment>> dot-or-parens % ] "" make ; + +M: participant-mode >log-line + [ "* " % dup sender>> % " has set mode " % dup mode>> % + " to " % parameter>> % ] "" make ; + +M: nick >log-line + [ "* " % dup sender>> % " is now known as " % nickname>> % ] "" make ; diff --git a/extra/irc/logbot/log-line/summary.txt b/extra/irc/logbot/log-line/summary.txt new file mode 100644 index 0000000000..96ab2bf7a2 --- /dev/null +++ b/extra/irc/logbot/log-line/summary.txt @@ -0,0 +1 @@ +IRC message formatting for logs diff --git a/extra/irc/logbot/logbot.factor b/extra/irc/logbot/logbot.factor new file mode 100644 index 0000000000..a389304b14 --- /dev/null +++ b/extra/irc/logbot/logbot.factor @@ -0,0 +1,56 @@ +! Copyright (C) 2009 Bruno Deferrari. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors calendar calendar.format destructors fry io io.encodings.8-bit +io.files io.pathnames irc.client irc.client.chats irc.messages +irc.messages.base kernel make namespaces sequences threads +irc.logbot.log-line ; +IN: irc.logbot + +CONSTANT: bot-channel "#concatenative" +CONSTANT: log-directory "/tmp/logs" + +SYMBOL: current-day +SYMBOL: current-stream + +: bot-profile ( -- obj ) + "irc.freenode.org" 6667 "flogger" f <irc-profile> ; + +: add-timestamp ( string timestamp -- string ) + timestamp>hms "[" prepend "] " append prepend ; + +: timestamp-path ( timestamp -- path ) + timestamp>ymd ".log" append log-directory prepend-path ; + +: timestamp>stream ( timestamp -- stream ) + dup day-of-year current-day get = [ + drop + ] [ + current-stream get [ dispose ] when* + [ day-of-year current-day set ] + [ timestamp-path latin1 <file-writer> ] bi + current-stream set + ] if current-stream get ; + +: log-message ( string timestamp -- ) + [ add-timestamp ] [ timestamp>stream ] bi + [ stream-print ] [ stream-flush ] bi ; + +GENERIC: handle-message ( msg -- ) + +M: object handle-message drop ; +M: irc-message handle-message [ >log-line ] [ timestamp>> ] bi log-message ; + +: bot-loop ( chat -- ) dup hear handle-message bot-loop ; + +: start-bot ( -- ) + bot-profile <irc-client> + [ connect-irc ] + [ + [ bot-channel <irc-channel-chat> ] dip + '[ _ [ _ attach-chat ] [ bot-loop ] bi ] + "LogBot" spawn drop + ] bi ; + +: logbot ( -- ) start-bot ; + +MAIN: logbot diff --git a/extra/irc/logbot/summary.txt b/extra/irc/logbot/summary.txt new file mode 100644 index 0000000000..1e49fcb240 --- /dev/null +++ b/extra/irc/logbot/summary.txt @@ -0,0 +1 @@ +An IRC logging bot From 8f287b2c26a2f7dd99300ad8b4258a34d7c170f6 Mon Sep 17 00:00:00 2001 From: Bruno Deferrari <utizoc@gmail.com> Date: Tue, 14 Apr 2009 23:36:17 -0300 Subject: [PATCH 08/14] irc.client: Forward messages before processing for now. Change text for some log lines --- extra/irc/client/internals/internals.factor | 3 ++- extra/irc/logbot/log-line/log-line.factor | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/extra/irc/client/internals/internals.factor b/extra/irc/client/internals/internals.factor index 5d7cca4bfa..89c8423f51 100644 --- a/extra/irc/client/internals/internals.factor +++ b/extra/irc/client/internals/internals.factor @@ -112,9 +112,10 @@ M: f handle-input handle-disconnect ; ! Processing loops +! FIXME: should get forward channels, process the message, and then forward : in-multiplexer-loop ( -- ? ) irc> in-messages>> mailbox-get - [ process-message ] [ forward-message ] [ irc-end? not ] tri ; + [ forward-message ] [ process-message ] [ irc-end? not ] tri ; : strings>privmsg ( name string -- privmsg ) " :" prepend append "PRIVMSG " prepend string>irc-message ; diff --git a/extra/irc/logbot/log-line/log-line.factor b/extra/irc/logbot/log-line/log-line.factor index 6119e8e81c..b3af41ad3d 100644 --- a/extra/irc/logbot/log-line/log-line.factor +++ b/extra/irc/logbot/log-line/log-line.factor @@ -15,14 +15,14 @@ M: privmsg >log-line [ "<" % dup sender>> % "> " % text>> % ] "" make ; M: join >log-line - [ "* " % sender>> % " has entered the channel." % ] "" make ; + [ "* " % sender>> % " has joined the channel." % ] "" make ; M: part >log-line [ "* " % dup sender>> % " has left the channel" % comment>> dot-or-parens % ] "" make ; M: quit >log-line - [ "* " % dup sender>> % " has left IRC" % + [ "* " % dup sender>> % " has quit" % comment>> dot-or-parens % ] "" make ; M: kick >log-line From 777cb541f780a36d92d38d443cc8763bcab2a93d Mon Sep 17 00:00:00 2001 From: Bruno Deferrari <utizoc@gmail.com> Date: Wed, 15 Apr 2009 00:03:25 -0300 Subject: [PATCH 09/14] irc.client: Calculate message forwards before processing it (because participants may be deleted from channels) --- extra/irc/client/internals/internals.factor | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/extra/irc/client/internals/internals.factor b/extra/irc/client/internals/internals.factor index 89c8423f51..5bae054e18 100644 --- a/extra/irc/client/internals/internals.factor +++ b/extra/irc/client/internals/internals.factor @@ -45,11 +45,11 @@ M: sequence chat-put [ chat-put ] with each ; ! Server message handling -GENERIC: forward-message ( irc-message -- ) -M: irc-message forward-message +server-chat+ chat-put ; -M: to-one-chat forward-message dup chat> chat-put ; -M: to-all-chats forward-message chats> chat-put ; -M: to-many-chats forward-message dup sender>> participant-chats chat-put ; +GENERIC: message-forwards ( irc-message -- seq ) +M: irc-message message-forwards drop +server-chat+ ; +M: to-one-chat message-forwards chat> ; +M: to-all-chats message-forwards drop chats> ; +M: to-many-chats message-forwards sender>> participant-chats ; GENERIC: process-message ( irc-message -- ) M: object process-message drop ; @@ -112,10 +112,13 @@ M: f handle-input handle-disconnect ; ! Processing loops -! FIXME: should get forward channels, process the message, and then forward : in-multiplexer-loop ( -- ? ) - irc> in-messages>> mailbox-get - [ forward-message ] [ process-message ] [ irc-end? not ] tri ; + irc> in-messages>> mailbox-get { + [ message-forwards ] + [ process-message ] + [ swap chat-put ] + [ irc-end? not ] + } cleave ; : strings>privmsg ( name string -- privmsg ) " :" prepend append "PRIVMSG " prepend string>irc-message ; From 5c6bc3f85e9561e4b454699268019962f3b0d38b Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" <jao@gnu.org> Date: Wed, 15 Apr 2009 08:13:56 +0200 Subject: [PATCH 10/14] FUEL: Fixes for POSTPONE: forms font-lock. --- misc/fuel/fuel-font-lock.el | 21 +++++++++++---------- misc/fuel/fuel-syntax.el | 4 +++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/misc/fuel/fuel-font-lock.el b/misc/fuel/fuel-font-lock.el index bc1bb900ce..aa7d25ebbd 100644 --- a/misc/fuel/fuel-font-lock.el +++ b/misc/fuel/fuel-font-lock.el @@ -60,6 +60,7 @@ (declaration keyword "declaration words") (ebnf-form constant "EBNF: ... ;EBNF form") (parsing-word keyword "parsing words") + (postpone-body comment "postponed form") (setter-word function-name "setter words (>>foo)") (getter-word function-name "getter words (foo>>)") (stack-effect comment "stack effect specifications") @@ -76,20 +77,19 @@ (defun fuel-font-lock--syntactic-face (state) (if (nth 3 state) 'factor-font-lock-string (let ((c (char-after (nth 8 state)))) - (cond ((or (char-equal c ?\ ) - (char-equal c ?\n) - (char-equal c ?E)) + (cond ((memq c '(?\ ?\n ?E ?P)) (save-excursion (goto-char (nth 8 state)) (beginning-of-line) - (cond ((looking-at-p "USING: ") + (cond ((looking-at "E") 'factor-font-lock-ebnf-form) + ((looking-at "P") 'factor-font-lock-postpone-body) + ((looking-at-p "USING: ") 'factor-font-lock-vocabulary-name) - ((looking-at-p "\\(TUPLE\\|SYMBOLS\\|VARS\\|SINGLETONS\\):") + ((looking-at-p + "\\(TUPLE\\|SYMBOLS\\|VARS\\|SINGLETONS\\):") 'factor-font-lock-symbol) ((looking-at-p "C-ENUM:\\( \\|\n\\)") 'factor-font-lock-constant) - ((looking-at-p "E") - 'factor-font-lock-ebnf-form) (t 'default)))) ((or (char-equal c ?U) (char-equal c ?C)) 'factor-font-lock-parsing-word) @@ -102,9 +102,10 @@ (,fuel-syntax--alien-function-regex (1 'factor-font-lock-type-name) (2 'factor-font-lock-word)) (,fuel-syntax--vocab-ref-regexp 2 'factor-font-lock-vocabulary-name) - (,fuel-syntax--constructor-decl-regex (1 'factor-font-lock-word) - (2 'factor-font-lock-type-name) - (3 'factor-font-lock-invalid-syntax nil t)) + (,fuel-syntax--constructor-decl-regex + (1 'factor-font-lock-word) + (2 'factor-font-lock-type-name) + (3 'factor-font-lock-invalid-syntax nil t)) (,fuel-syntax--typedef-regex (1 'factor-font-lock-type-name) (2 'factor-font-lock-type-name) (3 'factor-font-lock-invalid-syntax nil t)) diff --git a/misc/fuel/fuel-syntax.el b/misc/fuel/fuel-syntax.el index 1c88989366..6b646511ca 100644 --- a/misc/fuel/fuel-syntax.el +++ b/misc/fuel/fuel-syntax.el @@ -247,12 +247,14 @@ ;; Strings and chars ("CHAR: \\(\"\\) [^\\\"]*?\\(\"\\)\\([^\\\"]\\|\\\\.\\)*?\\(\"\\)" (1 "w") (2 "\"") (4 "\"")) - ("\\(CHAR:\\|POSTPONE:\\|\\\\\\) \\(.\\)\\( \\|$\\)" (2 "w")) + ("\\(CHAR:\\|\\\\\\) \\(.\\)\\( \\|$\\)" (2 "w")) ("\\( \\|^\\)\\(DLL\\|P\\|SBUF\\)\\(\"\\)\\([^\n\r\f\\\"]\\|\\\\.\\)*?\\(\"\\)" (3 "\"") (5 "\"")) ("\\_<\\(\"\\)\\([^\n\r\f\\\"]\\|\\\\.\\)*?\\(\"\\)" (1 "\"") (3 "\"")) ("\\_<<\\(\"\\)\\_>" (1 "<b")) ("\\_<\\(\"\\)>\\_>" (1 ">b")) + ;; postpone + ("\\_<POSTPONE:\\( \\).*\\(\n\\)" (1 "<b") (2 ">b")) ;; Multiline constructs ("\\_<\\(E\\)BNF:\\( \\|\n\\)" (1 "<b")) ("\\_<;EBN\\(F\\)\\_>" (1 ">b")) From e0c57b68b62023a780d3e44238e0ba74a71b6da5 Mon Sep 17 00:00:00 2001 From: Bruno Deferrari <utizoc@gmail.com> Date: Wed, 15 Apr 2009 20:18:42 -0300 Subject: [PATCH 11/14] irc.messages: Fix test --- extra/irc/messages/messages-tests.factor | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extra/irc/messages/messages-tests.factor b/extra/irc/messages/messages-tests.factor index 218ed92018..539fba54eb 100644 --- a/extra/irc/messages/messages-tests.factor +++ b/extra/irc/messages/messages-tests.factor @@ -58,7 +58,8 @@ IN: irc.messages.tests { command "NICK" } { parameters { } } { trailing "someuser2" } - { sender "someuser" } } } + { sender "someuser" } + { nickname "someuser2" } } } [ ":someuser!n=user@some.where NICK :someuser2" string>irc-message f >>timestamp ] unit-test From aad7a8dc758fdd0140cad58a21081d94dc5f9ad1 Mon Sep 17 00:00:00 2001 From: Slava Pestov <slava@shill.internal.stack-effects.com> Date: Wed, 15 Apr 2009 19:04:50 -0500 Subject: [PATCH 12/14] Add unportable tag to windows.usp10 --- basis/windows/gdi32/tags.txt | 1 + basis/windows/usp10/tags.txt | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 basis/windows/usp10/tags.txt diff --git a/basis/windows/gdi32/tags.txt b/basis/windows/gdi32/tags.txt index 6bf68304bb..2320bdd648 100644 --- a/basis/windows/gdi32/tags.txt +++ b/basis/windows/gdi32/tags.txt @@ -1 +1,2 @@ unportable +bindings diff --git a/basis/windows/usp10/tags.txt b/basis/windows/usp10/tags.txt new file mode 100644 index 0000000000..2320bdd648 --- /dev/null +++ b/basis/windows/usp10/tags.txt @@ -0,0 +1,2 @@ +unportable +bindings From 53397f4f7c8024f2784a55760dd884ff49f8ffd1 Mon Sep 17 00:00:00 2001 From: Doug Coleman <erg@jobim.local> Date: Wed, 15 Apr 2009 19:31:02 -0500 Subject: [PATCH 13/14] update tar --- extra/tar/tar.factor | 79 +++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/extra/tar/tar.factor b/extra/tar/tar.factor index 37c022fe43..297157c08b 100755 --- a/extra/tar/tar.factor +++ b/extra/tar/tar.factor @@ -1,8 +1,10 @@ +! Copyright (C) 2009 Doug Coleman. +! See http://factorcode.org/license.txt for BSD license. USING: combinators io io.files io.files.links io.directories io.pathnames io.streams.string kernel math math.parser continuations namespaces pack prettyprint sequences strings system tools.hexdump io.encodings.binary summary accessors -io.backend byte-arrays ; +io.backend byte-arrays io.streams.byte-array splitting ; IN: tar CONSTANT: zero-checksum 256 @@ -10,37 +12,35 @@ CONSTANT: block-size 512 TUPLE: tar-header name mode uid gid size mtime checksum typeflag linkname magic version uname gname devmajor devminor prefix ; + ERROR: checksum-error ; -SYMBOLS: base-dir filename ; +: trim-string ( seq -- newseq ) [ "\0 " member? ] trim ; -: tar-trim ( seq -- newseq ) [ "\0 " member? ] trim ; - -: read-c-string* ( n -- str/f ) +: read-c-string ( n -- str/f ) read [ zero? ] trim-tail [ f ] when-empty ; : read-tar-header ( -- obj ) \ tar-header new - 100 read-c-string* >>name - 8 read-c-string* tar-trim oct> >>mode - 8 read-c-string* tar-trim oct> >>uid - 8 read-c-string* tar-trim oct> >>gid - 12 read-c-string* tar-trim oct> >>size - 12 read-c-string* tar-trim oct> >>mtime - 8 read-c-string* tar-trim oct> >>checksum - read1 >>typeflag - 100 read-c-string* >>linkname - 6 read >>magic - 2 read >>version - 32 read-c-string* >>uname - 32 read-c-string* >>gname - 8 read tar-trim oct> >>devmajor - 8 read tar-trim oct> >>devminor - 155 read-c-string* >>prefix ; + 100 read-c-string >>name + 8 read-c-string trim-string oct> >>mode + 8 read-c-string trim-string oct> >>uid + 8 read-c-string trim-string oct> >>gid + 12 read-c-string trim-string oct> >>size + 12 read-c-string trim-string oct> >>mtime + 8 read-c-string trim-string oct> >>checksum + read1 >>typeflag + 100 read-c-string >>linkname + 6 read >>magic + 2 read >>version + 32 read-c-string >>uname + 32 read-c-string >>gname + 8 read trim-string oct> >>devmajor + 8 read trim-string oct> >>devminor + 155 read-c-string >>prefix ; -: header-checksum ( seq -- x ) - 148 cut-slice 8 tail-slice - [ sum ] bi@ + 256 + ; +: checksum-header ( seq -- n ) + 148 cut-slice 8 tail-slice [ sum ] bi@ + 256 + ; : read-data-blocks ( tar-header -- ) dup size>> 0 > [ @@ -60,29 +60,34 @@ SYMBOLS: base-dir filename ; ] if ; : parse-tar-header ( seq -- obj ) - [ header-checksum ] keep over zero-checksum = [ + [ checksum-header ] keep over zero-checksum = [ 2drop \ tar-header new 0 >>size 0 >>checksum ] [ - [ read-tar-header ] with-string-reader + binary [ read-tar-header ] with-byte-reader [ checksum>> = [ checksum-error ] unless ] keep ] if ; ERROR: unknown-typeflag ch ; -M: unknown-typeflag summary ( obj -- str ) - ch>> 1string "Unknown typeflag: " prepend ; -: tar-prepend-path ( path -- newpath ) - base-dir get prepend-path ; +M: unknown-typeflag summary ( obj -- str ) + ch>> [ "Unknown typeflag: " ] dip prefix ; : read/write-blocks ( tar-header path -- ) binary [ read-data-blocks ] with-file-writer ; +: prepend-current-directory ( path -- path' ) + current-directory get prepend-path ; + ! Normal file : typeflag-0 ( header -- ) - dup name>> tar-prepend-path read/write-blocks ; + dup name>> dup "global_pax_header" = [ + drop [ read-data-blocks ] with-string-writer drop + ] [ + prepend-current-directory read/write-blocks + ] if ; ! Hard link : typeflag-1 ( header -- ) unknown-typeflag ; @@ -99,7 +104,7 @@ M: unknown-typeflag summary ( obj -- str ) ! Directory : typeflag-5 ( header -- ) - name>> tar-prepend-path make-directories ; + name>> prepend-current-directory make-directories ; ! FIFO : typeflag-6 ( header -- ) unknown-typeflag ; @@ -139,7 +144,7 @@ M: unknown-typeflag summary ( obj -- str ) drop ; ! <string-writer> [ read-data-blocks ] keep ! >string [ zero? ] trim-tail filename set - ! filename get tar-prepend-path make-directories ; + ! filename get prepend-current-directory make-directories ; ! Multi volume continuation entry : typeflag-M ( header -- ) unknown-typeflag ; @@ -157,7 +162,7 @@ M: unknown-typeflag summary ( obj -- str ) : typeflag-X ( header -- ) unknown-typeflag ; : (parse-tar) ( -- ) - block-size read dup length 512 = [ + block-size read dup length block-size = [ parse-tar-header dup typeflag>> { @@ -189,7 +194,7 @@ M: unknown-typeflag summary ( obj -- str ) drop ] if ; -: parse-tar ( path -- ) - normalize-path dup parent-directory base-dir [ +: untar ( path -- ) + normalize-path [ ] [ parent-directory ] bi [ binary [ (parse-tar) ] with-file-reader - ] with-variable ; + ] with-directory ; From d03621d435a2deb85b99d78f903d6bc82b4f79e0 Mon Sep 17 00:00:00 2001 From: Doug Coleman <erg@jobim.local> Date: Wed, 15 Apr 2009 19:36:44 -0500 Subject: [PATCH 14/14] Remove reference to GLU from factor.sh --- build-support/factor.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build-support/factor.sh b/build-support/factor.sh index 2fec39f14a..53aab9ad04 100755 --- a/build-support/factor.sh +++ b/build-support/factor.sh @@ -139,7 +139,6 @@ check_library_exists() { } check_X11_libraries() { - check_library_exists GLU check_library_exists GL check_library_exists X11 check_library_exists pango-1.0 @@ -491,7 +490,7 @@ make_boot_image() { } install_build_system_apt() { - sudo apt-get --yes install libc6-dev libpango1.0-dev libx11-dev xorg-dev glutg3-dev wget git-core git-doc rlwrap gcc make + sudo apt-get --yes install libc6-dev libpango1.0-dev libx11-dev xorg-dev wget git-core git-doc rlwrap gcc make check_ret sudo }