all repos — min @ d2c6764f0d0e36598183a20eae5b0f14d4cd0834

A small but practical concatenative programming language.

Fixes #61
h3rald h3rald@h3rald.com
Sat, 31 Oct 2020 22:40:08 +0100
commit

d2c6764f0d0e36598183a20eae5b0f14d4cd0834

parent

2bb6e6f101adf4e477495fdfa9708082ddda913b

3 files changed, 9 insertions(+), 10 deletions(-)

jump to
M lib/min_sys.nimlib/min_sys.nim

@@ -114,7 +114,7 @@ def.symbol("rm") do (i: In):

let vals = i.expect("'sym") let v = vals[0] let f = v.getString - if f.existsFile: + if f.fileExists: f.removeFile else: raiseInvalid("File '$1' does not exist." % f)
M lib/min_time.nimlib/min_time.nim

@@ -46,15 +46,14 @@ let vals = i.expect("dict:timeinfo")

let dict = vals[0] try: let year = i.dget(dict, "year").intVal.int - let month = i.dget(dict, "month").intVal.int - 1 + let month = Month(i.dget(dict, "month").intVal.int - 1) let monthday = i.dget(dict, "day").intVal.int - let hour = i.dget(dict, "hour").intVal.int - let minute = i.dget(dict, "minute").intVal.int - let second = i.dget(dict, "second").intVal.int - let dst = i.dget(dict, "dst").boolVal + let hour: HourRange = i.dget(dict, "hour").intVal.int + let minute: MinuteRange = i.dget(dict, "minute").intVal.int + let second: SecondRange = i.dget(dict, "second").intVal.int let timezone = i.dget(dict, "timezone").intVal.int - 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 + let tinfo = initDatetime(monthday, month, year, hour, minute, second, 00, utc()) + i.push (tinfo + timezone.seconds).toTime.toUnix.int.newVal except: raiseInvalid("An invalid timeinfo dictionary was provided.")
M min.nimmin.nim

@@ -367,7 +367,7 @@ minString(s)

elif file != "": minFile file elif INSTALL: - if not libfile.existsFile: + if not libfile.fileExists: fatal("Dynamic library file not found:" & libfile) quit(4) try:

@@ -378,7 +378,7 @@ quit(5)

notice("Dynamic linbrary installed successfully: " & libfile.extractFilename) quit(0) elif UNINSTALL: - if not (MINLIBS/libfile.extractFilename).existsFile: + if not (MINLIBS/libfile.extractFilename).fileExists: fatal("Dynamic library file not found:" & libfile) quit(4) try: