[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: CVS update: ADDED: subversion/libsvn_subr getdate.y

From: Branko Èibej <brane_at_xbc.nu>
Date: 2001-07-04 18:05:53 CEST

Greg Hudson wrote:

>Perhaps this situation is most easily resolved by someone writing a
>getdate parser which doesn't use yacc. Date parsing is, I think,
>right on the edge of where yacc is a big complexity-saver, given how
>many rough edges yacc has.
>
+1

>In the meantime, checking the .c file into CVS is probably
>best... assuming it will even build on Windows machines.
>
+0

Ben Collins-Sussman wrote:

>That would be a neat project... the .y file in our tree does some
>crazy stuff, though. It understands a whole bunch of "conventional"
>date/time formats, as well as magical ones like "last friday", "next
>week", etc. I wouldn't want to rewrite that myself. [:-)]
>

Conventional for whom?

    * Even ignoring the warnings you mentioned, the code isn't APRized,
      and I don't think it can be, if we keep generating the C file with
      yacc/byacc/bison.
    * Every one of these parser generators has its own quirks, and works
      a bit differently. Do we want to be tied to a particular version
      of a particular generator?
    * The parser tries to recognize notations that are ambiguous, like
      the famous x/y/z: it'll parse that either as y/m/d or m/d/y, but
      what if, being from Europe, I write d/m/y? Or more likely, d.m.y,
      which isn't supported at all. On top of that, it doesn't support
      ISO 8601 format -- only the date notation.
    * Which brings up my last (but not least) objection: the parser is
      not localizable. L10n is more than just providing translations for
      messages.

I think you may be taking the "supports all CVS features" promise a bit
too far here. By all means, let's support the features, but not the
misfeatures, please. When was the last time you told CVS to up -r 'last
friday'?

I don't think we should support any notation that's ambiguous. I'd even
say it's enough to support ISO 8601
(http://www.cl.cam.ac.uk/~mgk25/iso-time.html,
http://ano2000.kpnqwest.pt/gen_8601.htm), including interval notation.
Things like "today" and "yesterday" are nice, but if we support "last
friday," we might as well know when "granny's birthday" is.

    Brane

-- 
Brane �ibej
    home:   <brane_at_xbc.nu>             http://www.xbc.nu/brane/
    work:   <branko.cibej_at_hermes.si>   http://www.hermes-softlab.com/
     ACM :   <brane_at_acm.org>            http://www.acm.org/
Received on Sat Oct 21 14:36:32 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.