Skip to content

Commit 9e32f4e

Browse files
committed
Compatibility with newer nim
1 parent 3c366b5 commit 9e32f4e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

nimsl.nimble

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Package
2-
version = "0.3"
2+
version = "0.3.1"
33
author = "Yuriy Glukhov"
44
description = "Shaders in Nim"
55
license = "MIT"

nimsl/private/glsl_codegen.nim

+6-1
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,13 @@ proc genWhileStmt(ctx: var GLSLCompilerContext, n: NimNode, r: var string) =
345345
proc genConv(ctx: var GLSLCompilerContext, n: NimNode, r: var string) =
346346
gen(ctx, n[1], r)
347347

348+
proc skipConv(n: NimNode): NimNode =
349+
result = n
350+
while result.kind == nnkHiddenStdConv:
351+
result = result[^1]
352+
348353
proc genBracketExpr(ctx: var GLSLCompilerContext, n: NimNode, r: var string) =
349-
let indexVal = n[1].intVal
354+
let indexVal = n[1].skipConv.intVal
350355
gen(ctx, n[0], r)
351356
r &= "."
352357
case indexVal

0 commit comments

Comments
 (0)