calendar.parser: fixing rfc822 so it doesn't break in trailing space

char-rename
Björn Lindqvist 2017-01-04 18:58:15 +01:00
parent b17590db24
commit 97a57f4041
2 changed files with 8 additions and 3 deletions

View File

@ -153,6 +153,11 @@ IN: calendar.parser.tests
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
{ "Tue, 22 Apr 2008 14:36:12 GMT" } [
"Tue, 22 Apr 2008 14:36:12 GMT" rfc822>timestamp timestamp>rfc822
] unit-test
{ "Tue, 22 Apr 2008 14:36:12 GMT" } [
"Tue, 22 Apr 2008 14:36:12 GMT "
rfc822>timestamp timestamp>rfc822
] unit-test

View File

@ -104,7 +104,7 @@ CONSTANT: rfc822-named-zones H{
":" read-token checked-number >>hour
":" read-token checked-number >>minute
read-sp checked-number >>second
readln parse-rfc822-gmt-offset >>gmt-offset ;
" " read-until drop parse-rfc822-gmt-offset >>gmt-offset ;
: rfc822>timestamp ( str -- timestamp )
[ (rfc822>timestamp) ] with-string-reader ;