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:
Andreas Rumpf 2018-05-14 12:35:30 +02:00 committed by Dominik Picheta
commit 02945e57b5
2 changed files with 3 additions and 6 deletions

View file

@ -269,7 +269,7 @@ proc getLibVersion(lib: string): Version =
return system.NimVersion.newVersion()
when declared(ModuleGraph):
var graph: ModuleGraph
var graph = newModuleGraph()
proc execScript(scriptName: string, flags: Flags, options: Options): PSym =
## Executes the specified script. Returns the script's module symbol.

View file

@ -166,7 +166,7 @@ proc parseVersionRange*(s: string): VersionRange =
var i = 0
var op = ""
var version = ""
while true:
while i < s.len:
case s[i]
of '>', '<', '=':
op.add(s[i])
@ -189,10 +189,6 @@ proc parseVersionRange*(s: string): VersionRange =
of '0'..'9', '.':
version.add(s[i])
of '\0':
result = makeRange(version, op)
break
of ' ':
# Make sure '0.9 8.03' is not allowed.
if version != "" and i < s.len:
@ -204,6 +200,7 @@ proc parseVersionRange*(s: string): VersionRange =
raise newException(ParseVersionError,
"Unexpected char in version range '" & s & "': " & s[i])
inc(i)
result = makeRange(version, op)
proc toVersionRange*(ver: Version): VersionRange =
## Converts a version to either a verEq or verSpecial VersionRange.