diff --git a/basis/calendar/format/format-tests.factor b/basis/calendar/format/format-tests.factor index 6ad41f03c2..4b92c7dad7 100644 --- a/basis/calendar/format/format-tests.factor +++ b/basis/calendar/format/format-tests.factor @@ -1,131 +1,9 @@ USING: accessors calendar calendar.format io io.streams.string kernel math.order sequences tools.test ; - -{ 0 } [ - "Z" [ read1 read-rfc3339-gmt-offset ] with-string-reader duration>hours -] unit-test - -{ 1 } [ - "+01" [ read1 read-rfc3339-gmt-offset ] with-string-reader duration>hours -] unit-test - -{ -1 } [ - "-01" [ read1 read-rfc3339-gmt-offset ] with-string-reader duration>hours -] unit-test - -{ -1-1/2 } [ - "-01:30" [ read1 read-rfc3339-gmt-offset ] with-string-reader duration>hours -] unit-test - -{ 1+1/2 } [ - "+01:30" [ read1 read-rfc3339-gmt-offset ] with-string-reader duration>hours -] unit-test +IN: calendar.format.tests { } [ now timestamp>rfc3339 drop ] unit-test { } [ now timestamp>rfc822 drop ] unit-test -{ 8/1000 -4 } [ - "2008-04-19T04:56:00.008-04:00" rfc3339>timestamp - [ second>> ] [ gmt-offset>> hour>> ] bi -] unit-test - -{ T{ duration f 0 0 0 0 0 0 } } [ - "GMT" parse-rfc822-gmt-offset -] unit-test - -{ T{ duration f 0 0 0 -5 0 0 } } [ - "-0500" parse-rfc822-gmt-offset -] unit-test - -{ T{ duration f 0 0 0 -1 0 0 } } [ - "A" parse-rfc822-gmt-offset -] unit-test - -{ T{ duration f 0 0 0 12 0 0 } } [ - "Y" parse-rfc822-gmt-offset -] unit-test - -{ T{ duration f 0 0 0 -8 0 0 } } [ - "PST" parse-rfc822-gmt-offset -] unit-test - -{ T{ timestamp f 2008 4 22 14 36 12 T{ duration f 0 0 0 0 0 0 } } } [ - "Tue, 22 Apr 2008 14:36:12 GMT" rfc822>timestamp -] unit-test - -{ t } [ now dup timestamp>rfc822 rfc822>timestamp time- 1 seconds before? ] unit-test - -{ t } [ now dup timestamp>cookie-string cookie-string>timestamp time- 1 seconds before? ] unit-test - -{ "Sun, 4 May 2008 07:00:00" } [ - "Sun May 04 07:00:00 2008 GMT" cookie-string>timestamp - timestamp>string -] unit-test - -{ "20080504070000" } [ - "Sun May 04 07:00:00 2008 GMT" cookie-string>timestamp - timestamp>mdtm -] unit-test - -{ - T{ timestamp f - 2008 - 5 - 26 - 0 - 37 - 42+2469/20000 - T{ duration f 0 0 0 -5 0 0 } - } -} [ "2008-05-26T00:37:42.12345-05:00" rfc3339>timestamp ] unit-test - -{ - T{ timestamp - { year 2008 } - { month 10 } - { day 2 } - { hour 23 } - { minute 59 } - { second 59 } - { gmt-offset T{ duration f 0 0 0 0 0 0 } } - } -} [ "Thursday, 02-Oct-2008 23:59:59 GMT" cookie-string>timestamp ] unit-test - - { } [ { 2008 2009 } [ year. ] each ] unit-test - -{ - T{ timestamp - { year 2013 } - { month 4 } - { day 23 } - { hour 13 } - { minute 50 } - { second 24 } - } -} [ "2013-04-23T13:50:24" rfc3339>timestamp ] unit-test - -{ "2001-12-14T21:59:43.100000-05:00" } [ "2001-12-14T21:59:43.1-05:00" rfc3339>timestamp timestamp>rfc3339 ] unit-test - -{ - T{ timestamp - { year 2001 } - { month 12 } - { day 15 } - { hour 02 } - { minute 59 } - { second 43+1/10 } - } -} [ "2001-12-15 02:59:43.1Z" rfc3339>timestamp ] unit-test - -{ - T{ timestamp - { year 2001 } - { month 12 } - { day 15 } - { hour 02 } - { minute 59 } - { second 43+1/10 } - } -} [ "2001-12-15 02:59:43.1Z" rfc3339>timestamp ] unit-test diff --git a/basis/calendar/format/format.factor b/basis/calendar/format/format.factor index 2ec8942389..b721f360cd 100644 --- a/basis/calendar/format/format.factor +++ b/basis/calendar/format/format.factor @@ -1,11 +1,19 @@ ! Copyright (C) 2008, 2010 Slava Pestov, Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors arrays assocs calendar calendar.english -calendar.format.macros combinators io io.streams.string kernel math -math.functions math.order math.parser math.parser.private present -sequences typed ; +USING: accessors arrays calendar calendar.english combinators io +io.streams.string kernel macros math math.order math.parser +math.parser.private present quotations sequences typed words ; IN: calendar.format +MACRO: formatted ( spec -- quot ) + [ + { + { [ dup word? ] [ 1quotation ] } + { [ dup quotation? ] [ ] } + [ [ nip write ] curry [ ] like ] + } cond + ] map [ cleave ] curry ; + : pad-00 ( n -- str ) number>string 2 CHAR: 0 pad-head ; : pad-0000 ( n -- str ) number>string 4 CHAR: 0 pad-head ; @@ -38,20 +46,6 @@ IN: calendar.format : YYYYY ( time -- ) year>> write-00000 ; -: expect ( str -- ) - read1 swap member? [ "Parse error" throw ] unless ; - -: read-00 ( -- n ) 2 read string>number ; - -: read-000 ( -- n ) 3 read string>number ; - -: read-0000 ( -- n ) 4 read string>number ; - -: hhmm>timestamp ( hhmm -- timestamp ) - [ - 0 0 0 read-00 read-00 0 instant - ] with-string-reader ; - GENERIC: day. ( obj -- ) M: integer day. ( n -- ) @@ -161,162 +155,6 @@ M: timestamp year. ( timestamp -- ) : timestamp>rfc3339 ( timestamp -- str ) [ (timestamp>rfc3339) ] with-string-writer ; -: signed-gmt-offset ( dt ch -- dt' ) - { { CHAR: + [ 1 ] } { CHAR: - [ -1 ] } } case time* ; - -: read-rfc3339-gmt-offset ( ch -- dt ) - { - { f [ instant ] } - { CHAR: Z [ instant ] } - [ - [ - read-00 hours - read1 { { CHAR: : [ read-00 ] } { f [ 0 ] } } case minutes - time+ - ] dip signed-gmt-offset - ] - } case ; - -: read-ymd ( -- y m d ) - read-0000 "-" expect read-00 "-" expect read-00 ; - -: read-hms ( -- h m s ) - read-00 ":" expect read-00 ":" expect read-00 ; - -: read-rfc3339-seconds ( s -- s' ch ) - "+-Z" read-until [ - [ string>number ] [ length 10^ ] bi / + - ] dip ; - -: (rfc3339>timestamp) ( -- timestamp ) - read-ymd - "Tt \t" expect - read-hms - read1 { { CHAR: . [ read-rfc3339-seconds ] } [ ] } case - read-rfc3339-gmt-offset - ; - -: rfc3339>timestamp ( str -- timestamp ) - [ (rfc3339>timestamp) ] with-string-reader ; - -ERROR: invalid-timestamp-format ; - -: check-timestamp ( obj/f -- obj ) - [ invalid-timestamp-format ] unless* ; - -: read-token ( seps -- token ) - [ read-until ] keep member? check-timestamp drop ; - -: read-sp ( -- token ) " " read-token ; - -: checked-number ( str -- n ) - string>number check-timestamp ; - -CONSTANT: rfc822-named-zones H{ - { "EST" -5 } - { "EDT" -4 } - { "CST" -6 } - { "CDT" -5 } - { "MST" -7 } - { "MDT" -6 } - { "PST" -8 } - { "PDT" -7 } -} - -: parse-rfc822-military-offset ( string -- dt ) - first CHAR: A - { - -1 -2 -3 -4 -5 -6 -7 -8 -9 f -10 -11 -12 - 1 2 3 4 5 6 7 8 9 10 11 12 0 - } nth hours ; - -: parse-rfc822-gmt-offset ( string -- dt ) - { - { [ dup { "UTC" "GMT" } member? ] [ drop instant ] } - { [ dup length 1 = ] [ parse-rfc822-military-offset ] } - { [ dup rfc822-named-zones key? ] [ rfc822-named-zones at hours ] } - [ - unclip [ - 2 cut [ string>number ] bi@ [ hours ] [ minutes ] bi* time+ - ] dip signed-gmt-offset - ] - } cond ; - -: (rfc822>timestamp) ( -- timestamp ) - timestamp new - "," read-token day-abbreviations3 member? check-timestamp drop - read1 CHAR: \s assert= - read-sp checked-number >>day - read-sp month-abbreviations index 1 + check-timestamp >>month - read-sp checked-number >>year - ":" read-token checked-number >>hour - ":" read-token checked-number >>minute - read-sp checked-number >>second - readln parse-rfc822-gmt-offset >>gmt-offset ; - -: rfc822>timestamp ( str -- timestamp ) - [ (rfc822>timestamp) ] with-string-reader ; - -: check-day-name ( str -- ) - [ day-abbreviations3 member? ] [ day-names member? ] bi or - check-timestamp drop ; - -: (cookie-string>timestamp-1) ( -- timestamp ) - timestamp new - "," read-token check-day-name - read1 CHAR: \s assert= - "-" read-token checked-number >>day - "-" read-token month-abbreviations index 1 + check-timestamp >>month - read-sp checked-number >>year - ":" read-token checked-number >>hour - ":" read-token checked-number >>minute - read-sp checked-number >>second - readln parse-rfc822-gmt-offset >>gmt-offset ; - -: cookie-string>timestamp-1 ( str -- timestamp ) - [ (cookie-string>timestamp-1) ] with-string-reader ; - -: (cookie-string>timestamp-2) ( -- timestamp ) - timestamp new - read-sp check-day-name - read-sp month-abbreviations index 1 + check-timestamp >>month - read-sp checked-number >>day - ":" read-token checked-number >>hour - ":" read-token checked-number >>minute - read-sp checked-number >>second - read-sp checked-number >>year - readln parse-rfc822-gmt-offset >>gmt-offset ; - -: cookie-string>timestamp-2 ( str -- timestamp ) - [ (cookie-string>timestamp-2) ] with-string-reader ; - -: cookie-string>timestamp ( str -- timestamp ) - { - [ cookie-string>timestamp-1 ] - [ cookie-string>timestamp-2 ] - [ rfc822>timestamp ] - } attempt-all-quots ; - -: (ymdhms>timestamp) ( -- timestamp ) - read-ymd " " expect read-hms instant ; - -: ymdhms>timestamp ( str -- timestamp ) - [ (ymdhms>timestamp) ] with-string-reader ; - -: (hms>timestamp) ( -- timestamp ) - 0 0 0 read-hms instant ; - -: hms>timestamp ( str -- timestamp ) - [ (hms>timestamp) ] with-string-reader ; - -: hm>timestamp ( str -- timestamp ) - ":00" append hms>timestamp ; - -: (ymd>timestamp) ( -- timestamp ) - read-ymd ; - -: ymd>timestamp ( str -- timestamp ) - [ (ymd>timestamp) ] with-string-reader ; - : (timestamp>ymd) ( timestamp -- ) { YYYY "-" MM "-" DD } formatted ; diff --git a/basis/calendar/format/macros/macros-tests.factor b/basis/calendar/format/macros/macros-tests.factor deleted file mode 100644 index 5c95129cfc..0000000000 --- a/basis/calendar/format/macros/macros-tests.factor +++ /dev/null @@ -1,15 +0,0 @@ -USING: tools.test kernel accessors ; -IN: calendar.format.macros - -{ 2 } [ { [ 2 ] } attempt-all-quots ] unit-test - -{ 2 } [ { [ 1 throw ] [ 2 ] } attempt-all-quots ] unit-test - -[ { [ 1 throw ] } attempt-all-quots ] [ 1 = ] must-fail-with - -: compiled-test-1 ( -- n ) - { [ 1 throw ] [ 2 ] } attempt-all-quots ; - -\ compiled-test-1 def>> must-infer - -{ 2 } [ compiled-test-1 ] unit-test diff --git a/basis/calendar/format/macros/macros.factor b/basis/calendar/format/macros/macros.factor deleted file mode 100644 index 901fe2267c..0000000000 --- a/basis/calendar/format/macros/macros.factor +++ /dev/null @@ -1,19 +0,0 @@ -USING: macros kernel words quotations io sequences combinators -continuations ; -IN: calendar.format.macros - -MACRO: formatted ( spec -- quot ) - [ - { - { [ dup word? ] [ 1quotation ] } - { [ dup quotation? ] [ ] } - [ [ nip write ] curry [ ] like ] - } cond - ] map [ cleave ] curry ; - -MACRO: attempt-all-quots ( quots -- quot ) - dup length 1 = [ first ] [ - unclip swap - [ nip attempt-all-quots ] curry - [ recover ] 2curry - ] if ; diff --git a/basis/calendar/format/macros/summary.txt b/basis/calendar/format/macros/summary.txt deleted file mode 100644 index 92c347a875..0000000000 --- a/basis/calendar/format/macros/summary.txt +++ /dev/null @@ -1 +0,0 @@ -Implementation details for calendar.format diff --git a/basis/calendar/parser/parser-tests.factor b/basis/calendar/parser/parser-tests.factor new file mode 100644 index 0000000000..66f8596acc --- /dev/null +++ b/basis/calendar/parser/parser-tests.factor @@ -0,0 +1,151 @@ +USING: accessors calendar calendar.format calendar.parser io +io.streams.string kernel math.order tools.test ; +IN: calendar.parser.tests + +! attempt-all-quots +{ 2 } [ { [ 2 ] } attempt-all-quots ] unit-test + +{ 2 } [ { [ 1 throw ] [ 2 ] } attempt-all-quots ] unit-test + +[ { [ 1 throw ] } attempt-all-quots ] [ 1 = ] must-fail-with + +: compiled-test-1 ( -- n ) + { [ 1 throw ] [ 2 ] } attempt-all-quots ; + +\ compiled-test-1 def>> must-infer + +{ 2 } [ compiled-test-1 ] unit-test + +! cookie-string>timestamp +{ + T{ timestamp + { year 2008 } + { month 10 } + { day 2 } + { hour 23 } + { minute 59 } + { second 59 } + { gmt-offset T{ duration f 0 0 0 0 0 0 } } + } +} [ "Thursday, 02-Oct-2008 23:59:59 GMT" cookie-string>timestamp ] unit-test + +{ "Sun, 4 May 2008 07:00:00" } [ + "Sun May 04 07:00:00 2008 GMT" cookie-string>timestamp + timestamp>string +] unit-test + +{ "20080504070000" } [ + "Sun May 04 07:00:00 2008 GMT" cookie-string>timestamp + timestamp>mdtm +] unit-test + +{ t } [ + now dup timestamp>cookie-string cookie-string>timestamp + time- 1 seconds before? +] unit-test + +! parse-rfc822-gmt-offset +{ T{ duration f 0 0 0 0 0 0 } } [ + "GMT" parse-rfc822-gmt-offset +] unit-test + +{ T{ duration f 0 0 0 -5 0 0 } } [ + "-0500" parse-rfc822-gmt-offset +] unit-test + +{ T{ duration f 0 0 0 -1 0 0 } } [ + "A" parse-rfc822-gmt-offset +] unit-test + +{ T{ duration f 0 0 0 12 0 0 } } [ + "Y" parse-rfc822-gmt-offset +] unit-test + +{ T{ duration f 0 0 0 -8 0 0 } } [ + "PST" parse-rfc822-gmt-offset +] unit-test + +! read-rfc3339-gmt-offset +{ 1+1/2 } [ + "+01:30" [ read1 read-rfc3339-gmt-offset ] with-string-reader duration>hours +] unit-test + +{ -1-1/2 } [ + "-01:30" [ read1 read-rfc3339-gmt-offset ] with-string-reader duration>hours +] unit-test + +{ 0 } [ + "Z" [ read1 read-rfc3339-gmt-offset ] with-string-reader duration>hours +] unit-test + +{ 1 } [ + "+01" [ read1 read-rfc3339-gmt-offset ] with-string-reader duration>hours +] unit-test + +{ -1 } [ + "-01" [ read1 read-rfc3339-gmt-offset ] with-string-reader duration>hours +] unit-test + +! rfc3339>timestamp +{ + T{ timestamp + { year 2013 } + { month 4 } + { day 23 } + { hour 13 } + { minute 50 } + { second 24 } + } +} [ "2013-04-23T13:50:24" rfc3339>timestamp ] unit-test + +{ + T{ timestamp + { year 2001 } + { month 12 } + { day 15 } + { hour 02 } + { minute 59 } + { second 43+1/10 } + } +} [ "2001-12-15 02:59:43.1Z" rfc3339>timestamp ] unit-test + +{ + T{ timestamp + { year 2001 } + { month 12 } + { day 15 } + { hour 02 } + { minute 59 } + { second 43+1/10 } + } +} [ "2001-12-15 02:59:43.1Z" rfc3339>timestamp ] unit-test + +{ + T{ timestamp f + 2008 + 5 + 26 + 0 + 37 + 42+2469/20000 + T{ duration f 0 0 0 -5 0 0 } + } +} [ "2008-05-26T00:37:42.12345-05:00" rfc3339>timestamp ] unit-test + +{ 8/1000 -4 } [ + "2008-04-19T04:56:00.008-04:00" rfc3339>timestamp + [ second>> ] [ gmt-offset>> hour>> ] bi +] unit-test + +{ "2001-12-14T21:59:43.100000-05:00" } [ + "2001-12-14T21:59:43.1-05:00" rfc3339>timestamp timestamp>rfc3339 +] unit-test + +! rfc822>timestamp +{ t } [ + now dup timestamp>rfc822 rfc822>timestamp time- 1 seconds before? +] unit-test + +{ T{ timestamp f 2008 4 22 14 36 12 T{ duration f 0 0 0 0 0 0 } } } [ + "Tue, 22 Apr 2008 14:36:12 GMT" rfc822>timestamp +] unit-test diff --git a/basis/calendar/parser/parser.factor b/basis/calendar/parser/parser.factor new file mode 100644 index 0000000000..5ef80f2c62 --- /dev/null +++ b/basis/calendar/parser/parser.factor @@ -0,0 +1,183 @@ +! Copyright (C) 2008, 2010 Slava Pestov, Doug Coleman. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors assocs calendar calendar.english combinators +continuations io io.streams.string kernel macros math math.functions +math.parser sequences ; +IN: calendar.parser + +: read-00 ( -- n ) 2 read string>number ; + +: read-000 ( -- n ) 3 read string>number ; + +: read-0000 ( -- n ) 4 read string>number ; + +: expect ( str -- ) + read1 swap member? [ "Parse error" throw ] unless ; + +ERROR: invalid-timestamp-format ; + +: check-timestamp ( obj/f -- obj ) + [ invalid-timestamp-format ] unless* ; + +: checked-number ( str -- n ) + string>number check-timestamp ; + +: read-token ( seps -- token ) + [ read-until ] keep member? check-timestamp drop ; + +: read-sp ( -- token ) " " read-token ; + +: hhmm>timestamp ( hhmm -- timestamp ) + [ + 0 0 0 read-00 read-00 0 instant + ] with-string-reader ; + +: signed-gmt-offset ( dt ch -- dt' ) + { { CHAR: + [ 1 ] } { CHAR: - [ -1 ] } } case time* ; + +: read-rfc3339-gmt-offset ( ch -- dt ) + { + { f [ instant ] } + { CHAR: Z [ instant ] } + [ + [ + read-00 hours + read1 { { CHAR: : [ read-00 ] } { f [ 0 ] } } case minutes + time+ + ] dip signed-gmt-offset + ] + } case ; + +: read-ymd ( -- y m d ) + read-0000 "-" expect read-00 "-" expect read-00 ; + +: read-hms ( -- h m s ) + read-00 ":" expect read-00 ":" expect read-00 ; + +: read-rfc3339-seconds ( s -- s' ch ) + "+-Z" read-until [ + [ string>number ] [ length 10^ ] bi / + + ] dip ; + +: (rfc3339>timestamp) ( -- timestamp ) + read-ymd + "Tt \t" expect + read-hms + read1 { { CHAR: . [ read-rfc3339-seconds ] } [ ] } case + read-rfc3339-gmt-offset + ; + +: rfc3339>timestamp ( str -- timestamp ) + [ (rfc3339>timestamp) ] with-string-reader ; + +: parse-rfc822-military-offset ( string -- dt ) + first CHAR: A - { + -1 -2 -3 -4 -5 -6 -7 -8 -9 f -10 -11 -12 + 1 2 3 4 5 6 7 8 9 10 11 12 0 + } nth hours ; + +CONSTANT: rfc822-named-zones H{ + { "EST" -5 } + { "EDT" -4 } + { "CST" -6 } + { "CDT" -5 } + { "MST" -7 } + { "MDT" -6 } + { "PST" -8 } + { "PDT" -7 } +} + +: parse-rfc822-gmt-offset ( string -- dt ) + { + { [ dup { "UTC" "GMT" } member? ] [ drop instant ] } + { [ dup length 1 = ] [ parse-rfc822-military-offset ] } + { [ dup rfc822-named-zones key? ] [ rfc822-named-zones at hours ] } + [ + unclip [ + 2 cut [ string>number ] bi@ [ hours ] [ minutes ] bi* time+ + ] dip signed-gmt-offset + ] + } cond ; + +: (rfc822>timestamp) ( -- timestamp ) + timestamp new + "," read-token day-abbreviations3 member? check-timestamp drop + read1 CHAR: \s assert= + read-sp checked-number >>day + read-sp month-abbreviations index 1 + check-timestamp >>month + read-sp checked-number >>year + ":" read-token checked-number >>hour + ":" read-token checked-number >>minute + read-sp checked-number >>second + readln parse-rfc822-gmt-offset >>gmt-offset ; + +: rfc822>timestamp ( str -- timestamp ) + [ (rfc822>timestamp) ] with-string-reader ; + +: check-day-name ( str -- ) + [ day-abbreviations3 member? ] [ day-names member? ] bi or + check-timestamp drop ; + +: (cookie-string>timestamp-1) ( -- timestamp ) + timestamp new + "," read-token check-day-name + read1 CHAR: \s assert= + "-" read-token checked-number >>day + "-" read-token month-abbreviations index 1 + check-timestamp >>month + read-sp checked-number >>year + ":" read-token checked-number >>hour + ":" read-token checked-number >>minute + read-sp checked-number >>second + readln parse-rfc822-gmt-offset >>gmt-offset ; + +: cookie-string>timestamp-1 ( str -- timestamp ) + [ (cookie-string>timestamp-1) ] with-string-reader ; + +: (cookie-string>timestamp-2) ( -- timestamp ) + timestamp new + read-sp check-day-name + read-sp month-abbreviations index 1 + check-timestamp >>month + read-sp checked-number >>day + ":" read-token checked-number >>hour + ":" read-token checked-number >>minute + read-sp checked-number >>second + read-sp checked-number >>year + readln parse-rfc822-gmt-offset >>gmt-offset ; + +: cookie-string>timestamp-2 ( str -- timestamp ) + [ (cookie-string>timestamp-2) ] with-string-reader ; + +MACRO: attempt-all-quots ( quots -- quot ) + dup length 1 = [ first ] [ + unclip swap + [ nip attempt-all-quots ] curry + [ recover ] 2curry + ] if ; + +: cookie-string>timestamp ( str -- timestamp ) + { + [ cookie-string>timestamp-1 ] + [ cookie-string>timestamp-2 ] + [ rfc822>timestamp ] + } attempt-all-quots ; + +: (ymdhms>timestamp) ( -- timestamp ) + read-ymd " " expect read-hms instant ; + +: ymdhms>timestamp ( str -- timestamp ) + [ (ymdhms>timestamp) ] with-string-reader ; + +: (hms>timestamp) ( -- timestamp ) + 0 0 0 read-hms instant ; + +: hms>timestamp ( str -- timestamp ) + [ (hms>timestamp) ] with-string-reader ; + +: hm>timestamp ( str -- timestamp ) + ":00" append hms>timestamp ; + +: (ymd>timestamp) ( -- timestamp ) + read-ymd ; + +: ymd>timestamp ( str -- timestamp ) + [ (ymd>timestamp) ] with-string-reader ; diff --git a/basis/calendar/parser/summary.txt b/basis/calendar/parser/summary.txt new file mode 100644 index 0000000000..5fc7b1b819 --- /dev/null +++ b/basis/calendar/parser/summary.txt @@ -0,0 +1 @@ +Parsing dates and times diff --git a/basis/db/postgresql/lib/lib.factor b/basis/db/postgresql/lib/lib.factor index 7f350d17ee..a90bdf3783 100644 --- a/basis/db/postgresql/lib/lib.factor +++ b/basis/db/postgresql/lib/lib.factor @@ -1,12 +1,10 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: arrays continuations db io kernel math namespaces -quotations sequences db.postgresql.ffi alien alien.c-types -alien.data db.types tools.walker ascii splitting math.parser -combinators libc calendar.format byte-arrays destructors -prettyprint accessors strings serialize io.encodings.binary -io.encodings.utf8 alien.strings io.streams.byte-array summary -present urls specialized-arrays db.private ; +USING: accessors alien.c-types alien.data alien.strings arrays ascii +calendar.format calendar.parser combinators db db.postgresql.ffi +db.types destructors io.encodings.utf8 kernel libc math math.parser +namespaces present sequences serialize specialized-arrays splitting +strings summary urls ; SPECIALIZED-ARRAY: uint SPECIALIZED-ARRAY: void* IN: db.postgresql.lib diff --git a/basis/db/sqlite/lib/lib.factor b/basis/db/sqlite/lib/lib.factor index 862df5b8ed..f6c26f4d07 100644 --- a/basis/db/sqlite/lib/lib.factor +++ b/basis/db/sqlite/lib/lib.factor @@ -1,11 +1,9 @@ ! Copyright (C) 2008 Chris Double, Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.c-types alien.data arrays assocs kernel math math.parser -namespaces sequences db.sqlite.ffi db combinators -continuations db.types calendar.format serialize -io.streams.byte-array byte-arrays io.encodings.binary -io.backend db.errors present urls io.encodings.utf8 -io.encodings.string accessors shuffle io db.private ; +USING: accessors alien.c-types alien.data arrays calendar.format +calendar.parser combinators db db.errors db.sqlite.ffi db.types +io.backend io.encodings.string io.encodings.utf8 kernel math +namespaces present sequences serialize urls ; IN: db.sqlite.lib ERROR: sqlite-error < db-error n string ; diff --git a/basis/http/http.factor b/basis/http/http.factor index 7dde8a9ad6..45efd1f39b 100644 --- a/basis/http/http.factor +++ b/basis/http/http.factor @@ -1,11 +1,9 @@ ! Copyright (C) 2003, 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors kernel combinators math namespaces make assocs -sequences splitting sorting sets strings vectors hashtables -quotations arrays byte-arrays math.parser calendar -calendar.format present urls fry io io.encodings -io.encodings.iana io.encodings.binary io.encodings.utf8 io.crlf -ascii io.encodings.8-bit.latin1 http.parsers base64 mime.types ; +USING: accessors arrays assocs base64 calendar calendar.format +calendar.parser combinators fry hashtables http.parsers io io.crlf +io.encodings.iana io.encodings.utf8 kernel make math math.parser +mime.types present sequences sets sorting splitting urls ; IN: http CONSTANT: max-redirects 10 diff --git a/basis/http/server/static/static.factor b/basis/http/server/static/static.factor index 8469e90f32..ba794f047c 100644 --- a/basis/http/server/static/static.factor +++ b/basis/http/server/static/static.factor @@ -5,7 +5,7 @@ DEFER: file-responder ! necessary for cgi-docs DEFER: ! necessary for cgi-docs USING: calendar kernel math math.order math.parser namespaces parser sequences strings assocs hashtables debugger mime.types -sorting logging calendar.format accessors splitting io io.files +sorting logging calendar.parser accessors splitting io io.files io.files.info io.directories io.pathnames io.encodings.binary fry xml.entities destructors urls html xml.syntax html.templates.fhtml http http.server http.server.responses diff --git a/basis/logging/parser/parser.factor b/basis/logging/parser/parser.factor index a680ee42c7..6b23b7dd58 100644 --- a/basis/logging/parser/parser.factor +++ b/basis/logging/parser/parser.factor @@ -1,9 +1,9 @@ ! Copyright (C) 2008, 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors peg peg.parsers memoize kernel sequences -logging arrays words strings vectors io io.files -io.encodings.utf8 namespaces make combinators logging.server -calendar calendar.format assocs prettyprint ; +USING: accessors assocs calendar calendar.format calendar.parser +combinators io io.encodings.utf8 io.files kernel logging +logging.server make namespaces peg peg.parsers prettyprint sequences +strings vectors words ; IN: logging.parser TUPLE: log-entry date level word-name message ; diff --git a/basis/syndication/syndication.factor b/basis/syndication/syndication.factor index 86ab6db5fe..0961e50675 100644 --- a/basis/syndication/syndication.factor +++ b/basis/syndication/syndication.factor @@ -4,8 +4,8 @@ USING: xml.traversal kernel assocs math.order strings sequences xml.data xml.writer io.streams.string combinators xml xml.entities.html io.files io http.client namespaces make -xml.syntax hashtables calendar.format accessors continuations -urls present byte-arrays ; +xml.syntax hashtables calendar.format calendar.parser accessors +continuations urls present byte-arrays ; IN: syndication : any-tag-named ( tag names -- tag-inside ) diff --git a/extra/imap/imap-tests.factor b/extra/imap/imap-tests.factor index 79536c61ea..37faf12614 100644 --- a/extra/imap/imap-tests.factor +++ b/extra/imap/imap-tests.factor @@ -1,4 +1,4 @@ -USING: accessors arrays assocs calendar calendar.format +USING: accessors arrays assocs calendar calendar.format calendar.parser combinators continuations destructors formatting fry grouping.extras imap imap.private io.streams.duplex kernel math math.parser math.ranges namespaces random sequences sets sorting uuid diff --git a/extra/imap/imap.factor b/extra/imap/imap.factor index 21a9934dd8..b2db9b5d01 100644 --- a/extra/imap/imap.factor +++ b/extra/imap/imap.factor @@ -1,5 +1,5 @@ USING: accessors arrays assocs calendar calendar.english calendar.format -calendar.format.macros formatting fry grouping io io.crlf io.encodings.ascii +calendar.parser formatting fry grouping io io.crlf io.encodings.ascii io.encodings.binary io.encodings.string io.encodings.utf7 io.encodings.utf8 io.sockets io.sockets.secure io.streams.duplex io.streams.string kernel math math.parser sequences splitting strings ; diff --git a/extra/robots/robots.factor b/extra/robots/robots.factor index 33ac216f39..f1f93b8f44 100644 --- a/extra/robots/robots.factor +++ b/extra/robots/robots.factor @@ -1,10 +1,9 @@ ! Copyright (C) 2009 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors arrays assocs calendar.format combinators -combinators.short-circuit fry globs http.client kernel make -math.parser multiline namespaces present regexp -regexp.combinators sequences sets splitting splitting.monotonic -unicode urls ; +USING: accessors arrays assocs calendar.parser combinators +combinators.short-circuit fry globs http.client kernel math.parser +namespaces present regexp regexp.combinators sequences splitting +splitting.monotonic unicode urls ; IN: robots ! visit-time is GMT, request-rate is pages/second diff --git a/extra/subrip-subtitles/subrip-subtitles.factor b/extra/subrip-subtitles/subrip-subtitles.factor index 57d448b39e..e20cf91405 100644 --- a/extra/subrip-subtitles/subrip-subtitles.factor +++ b/extra/subrip-subtitles/subrip-subtitles.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2014 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors arrays calendar calendar.format +USING: accessors arrays calendar calendar.parser io.encodings.utf8 io.files io.streams.string kernel math math.parser sequences splitting ascii ; IN: subrip-subtitles diff --git a/extra/yaml/conversion/conversion.factor b/extra/yaml/conversion/conversion.factor index daee389da7..88d21c2ad2 100644 --- a/extra/yaml/conversion/conversion.factor +++ b/extra/yaml/conversion/conversion.factor @@ -3,7 +3,7 @@ USING: accessors assocs base64 byte-arrays combinators combinators.extras hash-sets kernel linked-assocs math math.parser regexp sequences strings yaml.ffi -calendar calendar.format ; +calendar calendar.format calendar.parser ; IN: yaml.conversion ! http://yaml.org/type/ diff --git a/extra/zeromq/examples/echo-client.factor b/extra/zeromq/examples/echo-client.factor index acc80ebba6..f691689fdf 100644 --- a/extra/zeromq/examples/echo-client.factor +++ b/extra/zeromq/examples/echo-client.factor @@ -1,9 +1,7 @@ ! Copyright (C) 2013 John Benediktsson. ! See http://factorcode.org/license.txt for BSD license. - -USING: byte-arrays calendar calendar.format destructors io -kernel present strings threads zeromq zeromq.ffi ; - +USING: byte-arrays calendar destructors io kernel present strings +threads zeromq zeromq.ffi ; IN: zeromq.examples.echo-client : echo-client ( -- )