darcs patch: Fix the version-range parser to allow arbitrary expres...

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Thu Sep 17 12:54:41 EDT 2009

On Fri, 2009-09-11 at 12:22 +0100, Malcolm Wallace wrote:
> > I attach a revised version of the patch, that fixes the typo,  
> > improves the parser by allowing parentheses in version range  
> > expressions, and adds a check that the new syntax is accepted only  
> > by cabal >= 1.8.
> Argh! That patch still contains a very obvious bug.  Here is yet  
> another revised version.


The scope for problems in this bit of the code seems quite high. I fixed
two more issues. :-)

The check on using the new syntax was not quite right. The problem is
how we represent >= in terms of UnionVersionRanges (EarlierVersion v)
(ThisVersion v). For example this dep violated the check: ">= 1 && < 2"

I also fixed the pretty printer to respect operator precedence.


More information about the cabal-devel mailing list