[darcs-users] darcs replace token complaint

Jason Dagit dagit at codersbase.com
Fri Aug 14 04:32:49 UTC 2009


On Thu, Aug 13, 2009 at 6:35 PM, Trent W. Buck <twb at cybersource.com.au>wrote:

> Eric Kow <kowey at darcs.net> writes:
>
> > Just forwarding a comment from Gwern on the bugtracker:
> > - http://bugs.darcs.net/issue1373
> > - http://bugs.darcs.net/msg7364
> >
> > | On a side note, does anyone know why this fails? I've read the manual
> but it
> > | doesn't help much:
> > |
> > | [10:31 AM] 1.2Mb$ darcs replace
> > | "https://secure.wikimedia.org/wikipedia/en/wiki/" "Wikipedia"
> Threats.page
> > | darcs failed:  'https://secure.wikimedia.org/wikipedia/en/wiki/' is
> not a valid
> > | token!
> >
> > It'd be good to work out what's going on.  I'm sure it's fairly
> straightforward,
> > perhaps room for documentation tweaks?
>
> Neither of the two (sigh) default tokenizers allow / within a token.
> I really do think that the "darcs replace" in its current form is too
> dangerous to use, because absolutely nothing has the exact lexical
> structure assumed by it.  Well... I suppose /etc/passwd would be lexable
> by darcs replace, but certainly not C or a CSV file, for example.


I seem to recall a conversation with David once where he mentioned haskell's
identifier syntax as being an inspiration for the token parser.

I think the error message should try to suggest why the token is not valid.
If it could, for example, identify at least one character to tell the user
about, that would help.  The the user could try different things until they
get it right.  It could also tell the user the full set of allowed things.

Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20090813/1c125d0b/attachment.htm>


More information about the darcs-users mailing list