Skip to content

Commit

Permalink
Fix compilation on older versions of Nim
Browse files Browse the repository at this point in the history
  • Loading branch information
zedeus committed Aug 22, 2023
1 parent 30bdf3a commit 5c08e6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/parserutils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ template with*(ident, value, body): untyped =
template with*(ident; value: JsonNode; body): untyped =
if true:
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 =
js{"content", "operation", "cursor", "value"}.getStr
Expand Down

0 comments on commit 5c08e6a

Please sign in to comment.