
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 7/31/10 15:57 , Vladimir Solmon wrote:
time :: Parser TimeOfDay time = choice [ tTimeHourMin, t24hrClock ]
If the parse of tTimeHourMin fails after reading some characters (most probably, at the oneOf because it has been fed a t24hrClock value), those characters remain read and t24hrClock will pick up where the oneOf failed, then itself fail because all the digits were read by the many1 in range. To prevent this, resetting to where tTimeHourMin started its parse, wrap it in a try:
time = choice [ try tTimeHourMin , t24hrClock ]
- -- brandon s. allbery [linux,solaris,freebsd,perl] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkxUg28ACgkQIn7hlCsL25WvWwCfd+a9hGc2iS/Gxph+SjDKOuIg L6cAoIbGGUojYjmruoo3vsiu9HGB8kMl =cndm -----END PGP SIGNATURE-----