From dba74102e0f3f06b12fd2305059dab6aba9b0fe1 Mon Sep 17 00:00:00 2001 From: web3-developer <51288821+web3-developer@users.noreply.github.com> Date: Thu, 2 May 2024 12:10:57 +0800 Subject: [PATCH 1/2] Add support for nim version 2.0.4 --- nph.nimble | 2 +- src/nph.nim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nph.nimble b/nph.nimble index b533a21..d9b3bf0 100644 --- a/nph.nimble +++ b/nph.nimble @@ -12,7 +12,7 @@ bin = @["nph"] # TODO https://github.com/nim-lang/nimble/issues/1166 # Using exact version here and adding path manually :facepalm: # run `nimble setup -l` to hopefully make it work -requires "nim >= 2.0.0 & <= 2.0.2", +requires "nim >= 2.0.0 & <= 2.0.4", "compiler" proc build() = diff --git a/src/nph.nim b/src/nph.nim index 86b5b90..3f28d51 100644 --- a/src/nph.nim +++ b/src/nph.nim @@ -13,7 +13,7 @@ import "$nim"/compiler/idents import std/[parseopt, strutils, os, sequtils] static: - doAssert (NimMajor, NimMinor, NimPatch) in [(2, 0, 0), (2, 0, 2)], + doAssert (NimMajor, NimMinor, NimPatch) in [(2, 0, 0), (2, 0, 4)], "nph needs a specific version of Nim" const From 3683d1e448740192d63ece68c42f8c39a8d0305b Mon Sep 17 00:00:00 2001 From: web3-developer <51288821+web3-developer@users.noreply.github.com> Date: Fri, 10 May 2024 23:17:12 +0800 Subject: [PATCH 2/2] Updates based on PR feedback. --- nph.nimble | 6 ++++-- src/nph.nim | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/nph.nimble b/nph.nimble index d9b3bf0..29319a3 100644 --- a/nph.nimble +++ b/nph.nimble @@ -12,8 +12,10 @@ bin = @["nph"] # TODO https://github.com/nim-lang/nimble/issues/1166 # Using exact version here and adding path manually :facepalm: # run `nimble setup -l` to hopefully make it work -requires "nim >= 2.0.0 & <= 2.0.4", - "compiler" +# Note that the parser used by the formatter and the parser used by the verifier +# might disagree if syntax changes are included in a Nim patch version. +# TODO: nph should learn how to check formatting with any nim version +requires "nim >= 2.0.0 & < 2.1", "compiler" proc build() = exec "nim c --debuginfo -o:nph src/nph" diff --git a/src/nph.nim b/src/nph.nim index 3f28d51..ca61ebb 100644 --- a/src/nph.nim +++ b/src/nph.nim @@ -13,8 +13,7 @@ import "$nim"/compiler/idents import std/[parseopt, strutils, os, sequtils] static: - doAssert (NimMajor, NimMinor, NimPatch) in [(2, 0, 0), (2, 0, 4)], - "nph needs a specific version of Nim" + doAssert NimMajor == 2 and NimMinor == 0, "nph needs a specific version of Nim" const Version = gorge("git describe --long --dirty --always --tags")