all repos — min @ cc510cf622179beda04ddffa62bb820fe86c77a0

A small but practical concatenative programming language.

Fixed compilation errors with Nim 0.19.0.
h3rald h3rald@h3rald.com
Sun, 18 Nov 2018 18:39:57 +0100
commit

cc510cf622179beda04ddffa62bb820fe86c77a0

parent

99056cf83d62b9de1928d5cca7cd375a82885823

6 files changed, 19 insertions(+), 18 deletions(-)

jump to
M core/interpreter.nimcore/interpreter.nim

@@ -13,8 +13,8 @@ scope,

parser type - MinTrappedException* = ref object of SystemError - MinRuntimeError* = ref object of SystemError + MinTrappedException* = ref object of Exception + MinRuntimeError* = ref object of Exception data*: MinValue proc raiseRuntime*(msg: string, data: MinValue) {.extern:"min_exported_symbol_$1".}=

@@ -95,13 +95,13 @@ result.scope = i.scope

result.currSym = MinValue(column: 1, line: 1, kind: minSymbol, symVal: "") proc formatError(sym: MinValue, message: string): string {.extern:"min_exported_symbol_$1".}= - if sym.filename.isNil or sym.filename == "": + if sym.filename == "": return "[$1]: $2" % [sym.symVal, message] else: return "$1($2,$3) [$4]: $5" % [sym.filename, $sym.line, $sym.column, sym.symVal, message] proc formatTrace(sym: MinValue): string {.extern:"min_exported_symbol_$1".}= - if sym.filename.isNil or sym.filename == "": + if sym.filename == "": return "<native> in symbol: $1" % [sym.symVal] else: return "$1($2,$3) in symbol: $4" % [sym.filename, $sym.line, $sym.column, sym.symVal]

@@ -158,7 +158,7 @@ for item in val.scope.symbols.pairs:

v.scope.symbols[item.key] = item.val for item in val.scope.sigils.pairs: v.scope.sigils[item.key] = item.val - if not val.objType.isNil: + if val.objType != "": v.objType = val.objType if not val.obj.isNil: v.obj = val.obj
M core/parser.nimcore/parser.nim

@@ -559,7 +559,7 @@ v = "<native>"

else: v = $i.val.val d = d & v & " :" & $i.key & " " - if not a.objType.isNil: + if a.objType != "": d = d & ";" & a.objType d = d.strip & "}" return d

@@ -591,7 +591,7 @@ v = "<native>"

else: v = $i.val.val d = d & v & " :" & $i.key & " " - if not a.objType.isNil: + if a.objType != "": d = d & ";" & a.objType d = d.strip & "}" return d

@@ -683,7 +683,7 @@ return q.kind == minDictionary

proc isTypedDictionary*(q: MinValue): bool {.extern:"min_exported_symbol_$1".}= if q.isDictionary: - return not q.objType.isNil + return q.objType != "" return false proc isTypedDictionary*(q: MinValue, t: string): bool {.extern:"min_exported_symbol_$1_2".}=

@@ -735,9 +735,9 @@ if v1.kind != v2.kind:

return false if v1.kind == minValOp: return v1.val == v2.val - if a.objType.isNil and b.objType.isNil: + if a.objType == "" and b.objType == "": return true - elif not a.objType.isNil and not b.objType.isNil: + elif a.objType != "" and b.objType != "": return a.objType == b.objType else: return false
M lib/min_http.nimlib/min_http.nim

@@ -16,7 +16,7 @@ result = newDict(i.scope)

for k, v in headers: result = i.dset(result, k, v.newVal) -type MinServerExit = ref object of SystemError +type MinServerExit = ref object of Exception # Http
M min.nimmin.nim

@@ -190,7 +190,7 @@ var contents = ""

try: fileLines = filename.readFile().splitLines() except: - fatal("Cannot read from file: "& filename) + fatal("Cannot read from file: " & filename) quit(3) if fileLines[0].len >= 2 and fileLines[0][0..1] == "#!":

@@ -202,7 +202,7 @@

proc minFile*(file: File, filename="stdin") = var stream = newFileStream(stdin) if stream == nil: - fatal("Cannot read from file: "& filename) + fatal("Cannot read from file: " & filename) quit(3) minStream(stream, filename)

@@ -225,7 +225,7 @@ v = "<native>"

else: v = $item.val.val echo " " & v & " :" & $item.key - if res.objType.isNil: + if res.objType == "": echo " ".repeat(n.len) & " }" else: echo " ".repeat(n.len) & " ;" & res.objType
M nifty.jsonnifty.json

@@ -65,8 +65,8 @@ "git": true

}, "niftylogger.nim": { "name": "niftylogger.nim", - "src": "https://raw.githubusercontent.com/h3rald/nifty/master/lib/niftylogger.nim", + "src": "https://raw.githubusercontent.com/h3rald/nifty/master/src/niftypkg/niftylogger.nim", "curl": true } } -}+}
M tests/http.mintests/http.min

@@ -3,7 +3,8 @@ 'test import

"http" describe - "http://postman-echo.com" :url + "postman-echo.com" :host + "http://$1" (host) => % :url ("$1/get" (url) => % get-content from-json /headers /user-agent "min http-module/$1" (version) => % ==) assert

@@ -51,7 +52,7 @@ {} (

("$1/delete" (url) => % %url) ("DELETE" %method) (request) - ) tap /body from-json /url "$1/delete" (url) => % == + ) tap /body from-json /url "https://$1/delete" (host) => % == ) assert report