[darcs-users] Re: Darcs 0.9.20 bug

Eric S. Johansson esj at harvee.org
Sat May 22 13:59:47 UTC 2004

David Roundy wrote:
> Hmmmm.  Making darcs' output parseable is definitely a good idea, but it's
> awkward because there is so much output, and making it machine-parseable
> will always be a secondary goal to making the output human-parseable.  Some
> commands have the --xml-output option, which obviously is intended to be
> machine-parseable, but those are all "repo-viewing" commands, and I think
> you are referring to "repo-modifying" commands?

I don't see this is being a huge challenge, only a difficult one.  I 
would recommend instead keeping your grammar (i.e. definition output) 
relatively simple and consistent.  If there are things were you want 
free format or program content defined output, the limit those regions 
with some consistent pattern like """ content goes here """.

Then, you can feed the output of darcs into a separate parser which can 
generate machine friendly information in a consistent way.

darcs get ... | hungarian_phrasebook --dictionary_in darcs 
--dictionary_out xml

the advantage of this technique is that it separates the general case 
grammar/parsing problem from both darcs and the downstream application.


More information about the darcs-users mailing list