Bläddra i källkod

Fix compilation on older versions of Nim

Zed 3 år sedan
förälder
incheckning
5c08e6a774
1 ändrade filer med 2 tillägg och 1 borttagningar
  1. 2 1
      src/parserutils.nim

+ 2 - 1
src/parserutils.nim

@@ -36,7 +36,8 @@ template with*(ident, value, body): untyped =
 template with*(ident; value: JsonNode; body): untyped =
 template with*(ident; value: JsonNode; body): untyped =
   if true:
   if true:
     let ident {.inject.} = value
     let ident {.inject.} = value
-    if value.notNull: body
+    # value.notNull causes a compilation error for versions < 1.6.14
+    if notNull(value): body
 
 
 template getCursor*(js: JsonNode): string =
 template getCursor*(js: JsonNode): string =
   js{"content", "operation", "cursor", "value"}.getStr
   js{"content", "operation", "cursor", "value"}.getStr