Fixed compilation errors with Nim 0.18.0.
h3rald h3rald@h3rald.com
Sat, 03 Mar 2018 18:00:55 +0100
6 files changed,
25 insertions(+),
25 deletions(-)
M
core/utils.nim
→
core/utils.nim
@@ -14,7 +14,7 @@
proc reverse[T](xs: openarray[T]): seq[T] = result = newSeq[T](xs.len) for i, x in xs: - result[^i-1] = x + result[result.len-i-1] = x # Library methods@@ -137,11 +137,11 @@ case json.kind:
of JNull: result = newSeq[MinValue](0).newVal(i.scope) of JBool: - result = json.getBVal.newVal + result = json.getBool.newVal of JInt: - result = json.getNum.newVal + result = json.getBiggestInt.newVal of JFloat: - result = json.getFNum.newVal + result = json.getFloat.newVal of JString: let s = json.getStr if s.match("^;sym:"):
M
lib/min_fs.nim
→
lib/min_fs.nim
@@ -16,17 +16,17 @@
def.symbol("mtime") do (i: In): let vals = i.expect("'sym") let s = vals[0] - i.push s.getString.getLastModificationTime.toSeconds.newVal + i.push s.getString.getLastModificationTime.toUnix.newVal def.symbol("atime") do (i: In): let vals = i.expect("'sym") let s = vals[0] - i.push s.getString.getLastAccessTime.toSeconds.newVal + i.push s.getString.getLastAccessTime.toUnix.newVal def.symbol("ctime") do (i: In): let vals = i.expect("'sym") let s = vals[0] - i.push s.getString.getCreationTime.toSeconds.newVal + i.push s.getString.getCreationTime.toUnix.newVal def.symbol("hidden?") do (i: In): let vals = i.expect("'sym")@@ -50,9 +50,9 @@ info.qVal.add @["type".newVal, fi.kind.filetype.newVal].newVal(i.scope)
info.qVal.add @["size".newVal, fi.size.newVal].newVal(i.scope) info.qVal.add @["permissions".newVal, fi.permissions.unixPermissions.newVal].newVal(i.scope) info.qVal.add @["nlinks".newVal, fi.linkCount.newVal].newVal(i.scope) - info.qVal.add @["ctime".newVal, fi.creationTime.toSeconds.newVal].newVal(i.scope) - info.qVal.add @["atime".newVal, fi.lastAccessTime.toSeconds.newVal].newVal(i.scope) - info.qVal.add @["mtime".newVal, fi.lastWriteTime.toSeconds.newVal].newVal(i.scope) + info.qVal.add @["ctime".newVal, fi.creationTime.toUnix.newVal].newVal(i.scope) + info.qVal.add @["atime".newVal, fi.lastAccessTime.toUnix.newVal].newVal(i.scope) + info.qVal.add @["mtime".newVal, fi.lastWriteTime.toUnix.newVal].newVal(i.scope) i.push info def.symbol("ftype") do (i: In):
M
lib/min_lang.nim
→
lib/min_lang.nim
@@ -2,7 +2,7 @@ import
critbits, strutils, sequtils, - parseopt2, + parseopt, algorithm, json, os,
M
lib/min_num.nim
→
lib/min_num.nim
@@ -85,7 +85,7 @@
def.symbol("random") do (i: In): let vals = i.expect("int") let n = vals[0] - i.push n.intVal.int.random.newVal + i.push n.intVal.int.rand.newVal def.symbol("div") do (i: In): let vals = i.expect("int", "int")
M
lib/min_time.nim
→
lib/min_time.nim
@@ -24,10 +24,10 @@ let vals = i.expect("num")
let t = vals[0] var time: Time if t.kind == minInt: - time = t.intVal.fromSeconds + time = t.intVal.fromUnix else: - time = t.floatVal.fromSeconds - let tinfo = time.getLocalTime + time = t.floatVal.int64.fromUnix + let tinfo = time.local var info = newSeq[MinValue](0).newVal(i.scope) info.qVal.add @["year".newVal, tinfo.year.newVal].newVal(i.scope) info.qVal.add @["month".newVal, (tinfo.month.int+1).newVal].newVal(i.scope)@@ -38,7 +38,7 @@ info.qVal.add @["hour".newVal, tinfo.hour.newVal].newVal(i.scope)
info.qVal.add @["minute".newVal, tinfo.minute.newVal].newVal(i.scope) info.qVal.add @["second".newVal, tinfo.second.newVal].newVal(i.scope) info.qVal.add @["dst".newVal, tinfo.isDST.newVal].newVal(i.scope) - info.qVal.add @["timezone".newVal, tinfo.timezone.newVal].newVal(i.scope) + info.qVal.add @["timezone".newVal, tinfo.utcOffset.newVal].newVal(i.scope) i.push info def.symbol("to-timestamp") do (i: In):@@ -53,8 +53,8 @@ let minute = dict.dget("minute".newVal).intVal.int
let second = dict.dget("second".newVal).intVal.int let dst = dict.dget("dst".newVal).boolVal let timezone = dict.dget("timezone".newVal).intVal.int - let tinfo = TimeInfo(year: year, month: Month(month), monthday: monthday, hour: hour, minute: minute, second: second, isDST: dst, timezone: timezone) - i.push tinfo.toTime.toSeconds.int.newVal + let tinfo = Datetime(year: year, month: Month(month), monthday: monthday, hour: hour, minute: minute, second: second, isDST: dst, utcOffset: timezone) + i.push tinfo.toTime.toUnix.int.newVal except: raiseInvalid("An invalid timeinfo dictionary was provided.")@@ -63,10 +63,10 @@ let vals = i.expect("num")
let t = vals[0] var time: Time if t.kind == minInt: - time = t.intVal.fromSeconds + time = t.intVal.fromUnix else: - time = t.floatVal.fromSeconds - i.push time.getGMTime.format("yyyy-MM-dd'T'HH:mm:ss'Z'").newVal + time = t.floatVal.int64.fromUnix + i.push time.utc.format("yyyy-MM-dd'T'HH:mm:ss'Z'").newVal def.symbol("tformat") do (i: In): let vals = i.expect("string", "num")@@ -74,9 +74,9 @@ let s = vals[0]
let t = vals[1] var time: Time if t.kind == minInt: - time = t.intVal.fromSeconds + time = t.intVal.fromUnix else: - time = t.floatVal.fromSeconds - i.push time.getLocalTime.format(s.getString).newVal + time = t.floatVal.int64.fromUnix + i.push time.local.format(s.getString).newVal def.finalize("time")