anchor.diff:  ﻿namespace Paket
   
   module DependenciesFileParser =
  +    open System.Numerics
       open System
       open System.IO
       open Requirements
  
positive.code:         | PaketStrategy -> Some ResolverStrategy.Max
          | NoStrategy -> None
  
      let twiddle (minimum:string) =
          let promote index (values:string array) =
              let parsed, number = Int32.TryParse values.[index]
              if parsed then values.[index] <- (number + 1).ToString()
              if values.Length > 1 then values.[values.Length - 1] <- "0"
              values
  
          let parts = minimum.Split '.'
          let penultimateItem = Math.Max(parts.Length - 2, 0)
          let promoted = parts |> promote penultimateItem
          String.Join(".", promoted)
  
      let parseVersionRequirement (text : string) : VersionRequirement =
          try
              let inline parsePrerelease (versions:SemVerInfo list) (texts : string list) = 
                  match texts |> List.filter ((<>) "") with
                  | [] -> 
                      versions
                      |> List.collect (function { PreRelease = Some x } -> [x.Name] | _ -> [])
                      |> List.distinct
                      |> function [] -> PreReleaseStatus.No | xs -> PreReleaseStatus.Concrete xs
                  | [x] when String.equalsIgnoreCase x "prerelease" -> PreReleaseStatus.All
                  | _ -> PreReleaseStatus.Concrete texts
  
              if String.IsNullOrWhiteSpace text then VersionRequirement(VersionRange.AtLeast "0",PreReleaseStatus.No) else
  
  
negative.code:                 let v2 = SemVer.Parse v2
                  VersionRequirement(VersionRange.Range(VersionRangeBound.Including,v1,v2,VersionRangeBound.Including),parsePrerelease [v1; v2] rest)
              |  "~>" :: v1 :: ">=" :: v2 :: rest -> 
                  let v1 = SemVer.Parse(twiddle (SemVer.Parse v1))
                  let v2 = SemVer.Parse v2
                  VersionRequirement(VersionRange.Range(VersionRangeBound.Including,v2,v1,VersionRangeBound.Excluding),parsePrerelease [v1; v2] rest)
              |  "~>" :: v1 :: ">" :: v2 :: rest ->
                  let v1 = SemVer.Parse(twiddle (SemVer.Parse v1))
                  let v2 = SemVer.Parse v2
                  VersionRequirement(VersionRange.Range(VersionRangeBound.Excluding,v2,v1,VersionRangeBound.Excluding),parsePrerelease [v1; v2] rest)
              |  ">" :: v1 :: "<" :: v2 :: rest -> 
  