[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Patch for parsing dates and time

From: Maarten van Beek
Subject: Re: [Help-smalltalk] Patch for parsing dates and time
Date: Mon, 23 Jul 2012 15:47:08 +0200

Indeed I didn't realise negative dates where possible I thought it was
an error. I'll fix that. However the following code shows the bug:

        stream := '2011-02-01abcd' readStream.
        date := Date readFrom: stream.
        result := stream upToEnd.

        result printNl.

The suffix to the date is abcd, so after parsing the date the stream
should still contain abcd. However result only holds 'bcd'. This is
not tested in the current test cases. Time, Duration and DateTime have
the same bug.
Not being able to use position: is a problem though. When parsing this
time for example: '09:00::1234' you should read 09:00 as time and
leave ::1234 in the stream, but you have to look ahead 2 characters to
notice this.

Maarten van Beek

On Mon, Jul 23, 2012 at 9:16 AM, Holger Hans Peter Freyther
<address@hidden> wrote:
> On Mon, Jul 23, 2012 at 04:32:27AM +0200, Maarten van Beek wrote:
>> The following patch should fix this issue. It patches tests/
>> aswel as dates.ok as this contained some errors. Also it fixes bugs in
>>, and as they all contained a similar bug
>> that wouldn't leave the suffix intact.
> Hi,
> could you please explain why the output of dates.ok changes? E.g.
> explain why the previous output was wrong and the new one is correct. E.g.
> I think it should still be 1-Feb--2011 if it was B.C.?
> thanks
>         holger
>> _______________________________________________
>> help-smalltalk mailing list
>> address@hidden
> _______________________________________________
> help-smalltalk mailing list
> address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]