[darcs-users] darcs replace token complaint
Max Battcher
me at worldmaker.net
Sun Aug 16 09:46:16 UTC 2009
Trent W. Buck wrote:
> It has to do understand lexing.
> ===============================
>
> I gave examples upthread of how treating files as ATOMs separated by
> folding WHITESPACE is simply unacceptable even for relatively trivial
> file formats like sexprs, mexprs or csv.
Um, I'm not entirely convinced that your examples were valid problems,
at least not how I've seen darcs work... That is, given a proper "token"
regex I think all of your examples can be avoided/worked-around, for the
most part. I haven't had a chance yet to verify this, so I've been slow
to respond, but I don't think darcs replace is entirely as bad (as it
exists) as you say it is.
Also, before you go overboard with ideas for lexing, I've participated
in large dialogs here on the subject that may be good to review.
(To summarize, however: my most recent insight was that the amount of
lexing that would be perfect, or at least most pragmatic, for creating
usefully "semantic" patches based on the syntax of a language can be
suitably performed with the sort of lexing that a syntax highlighting
tool performs, like pygments (Python) or text editors, such as vim or
emacs. That becomes the easy part because such tools already have rich
libraries of syntaxes and ideas on how to determine which one a file
belongs to... (Plus such benefits as syntax highlighters are already
designed to be fast, to be non-lossy, and to handle error states and
partial documents well...) The hard part is still someone actually
writing the darcs primitive patch operations and figuring out all of the
commutation possibilities and what have you. So far, to my knowledge, no
one has yet to volunteer to tackle the hard part.)
--
--Max Battcher--
http://worldmaker.net
More information about the darcs-users
mailing list