Skip to content

Commit

Permalink
set the node to the bool value
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Dec 18, 2023
1 parent 53a88b8 commit 0f67710
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/pragmas.nim
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,10 @@ proc isTurnedOn(c: PContext, n: PNode): bool =
if n.kind in nkPragmaCallKinds and n.len == 2:
let ident = getPIdent(n[1])
if ident != nil and ident.id == ord(wOn):
n[1] = newIntTypeNode(1, getSysType(c.graph, n.info, tyBool))
return true
elif ident != nil and ident.id == ord(wOff):
n[1] = newIntTypeNode(0, getSysType(c.graph, n.info, tyBool))
return false
else:
let x = c.semConstBoolExpr(c, n[1])
Expand Down

0 comments on commit 0f67710

Please sign in to comment.