[darcs-users] darcs patch: Resolve issue1373: make --token-chars [^ \t\n] work as...

Trent W. Buck trentbuck at gmail.com
Mon Apr 6 09:52:12 UTC 2009


Tommy Pettersson <ptp at lysator.liu.se> writes:

> On Sat, Mar 28, 2009 at 09:43:50PM +1100, Trent W.Buck wrote:
>> Sat Mar 28 21:41:48 EST 2009  Trent W. Buck <trentbuck at gmail.com>
>>   * Resolve issue1373: make --token-chars [^ \t\n] work as advertised.
>
> The reason spaces are not allowed in token chars is that the
> replace patch format can not store tokens or token char
> specifiers that contains spaces.

Ugh!  The more I look at "darcs replace", the more I'm convinced that it
should never have been allowed into stable in the first place.  Symbolic
replacement is distinctly nontrivial, and that "darcs replace" ever
worked at all I attribute more to accident than good design.

I think the only safe way to have something like darcs replace is when
everybody agrees in advance EXACTLY what the file format is, and how it
is lexed (by "everybody" I mean everything that lexes the file,
including Darcs replace, compilers, interpreters, etc.).

I could just about see this happening for XML.  But for anything with a
preprocessor (like C and Haskell) or reader macros or read-time
compilation (like Lisp) I just can't see how you could do it reliably.
As for file formats based on "whatever the de facto standard compiler
does this week", like Perl or Ruby...

Even Emacs' rough-and-ready lexing uses a syntax table has more than two
kinds of entry for a character, but darcs replace only has "I'm part of
symbols" and "I'm whitespace between symbols".

-- 
Trent W. Buck, tired and grumpy



More information about the darcs-users mailing list