prepare Nimble for the upcoming compiler API (#489)
* prepare Nimble for the upcoming compiler API changes * attempt to make tests green * make some tests green with the upcoming compiler API
This commit is contained in:
parent
e2869714b8
commit
02945e57b5
2 changed files with 3 additions and 6 deletions
|
|
@ -269,7 +269,7 @@ proc getLibVersion(lib: string): Version =
|
||||||
return system.NimVersion.newVersion()
|
return system.NimVersion.newVersion()
|
||||||
|
|
||||||
when declared(ModuleGraph):
|
when declared(ModuleGraph):
|
||||||
var graph: ModuleGraph
|
var graph = newModuleGraph()
|
||||||
|
|
||||||
proc execScript(scriptName: string, flags: Flags, options: Options): PSym =
|
proc execScript(scriptName: string, flags: Flags, options: Options): PSym =
|
||||||
## Executes the specified script. Returns the script's module symbol.
|
## Executes the specified script. Returns the script's module symbol.
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ proc parseVersionRange*(s: string): VersionRange =
|
||||||
var i = 0
|
var i = 0
|
||||||
var op = ""
|
var op = ""
|
||||||
var version = ""
|
var version = ""
|
||||||
while true:
|
while i < s.len:
|
||||||
case s[i]
|
case s[i]
|
||||||
of '>', '<', '=':
|
of '>', '<', '=':
|
||||||
op.add(s[i])
|
op.add(s[i])
|
||||||
|
|
@ -189,10 +189,6 @@ proc parseVersionRange*(s: string): VersionRange =
|
||||||
of '0'..'9', '.':
|
of '0'..'9', '.':
|
||||||
version.add(s[i])
|
version.add(s[i])
|
||||||
|
|
||||||
of '\0':
|
|
||||||
result = makeRange(version, op)
|
|
||||||
break
|
|
||||||
|
|
||||||
of ' ':
|
of ' ':
|
||||||
# Make sure '0.9 8.03' is not allowed.
|
# Make sure '0.9 8.03' is not allowed.
|
||||||
if version != "" and i < s.len:
|
if version != "" and i < s.len:
|
||||||
|
|
@ -204,6 +200,7 @@ proc parseVersionRange*(s: string): VersionRange =
|
||||||
raise newException(ParseVersionError,
|
raise newException(ParseVersionError,
|
||||||
"Unexpected char in version range '" & s & "': " & s[i])
|
"Unexpected char in version range '" & s & "': " & s[i])
|
||||||
inc(i)
|
inc(i)
|
||||||
|
result = makeRange(version, op)
|
||||||
|
|
||||||
proc toVersionRange*(ver: Version): VersionRange =
|
proc toVersionRange*(ver: Version): VersionRange =
|
||||||
## Converts a version to either a verEq or verSpecial VersionRange.
|
## Converts a version to either a verEq or verSpecial VersionRange.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue