[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: Paolo Bonzini
Subject: Re: [Help-smalltalk] Patch for parsing dates and time
Date: Mon, 23 Jul 2012 16:57:04 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

Il 23/07/2012 15:47, Maarten van Beek ha scritto:
> 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.

Ok, thanks.

> 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.

I think it's safe to consider this example ill-formed, and not care
about it.


reply via email to

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