From ccd5fd60a9a1653f3dd80613d6ed90781135995c Mon Sep 17 00:00:00 2001 From: AmjadHD Date: Wed, 24 Aug 2022 23:43:46 +0100 Subject: [PATCH] use case stmt --- compiler/jsgen.nim | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index bbc64a2f0e5a7..687ee11c96712 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -315,17 +315,19 @@ proc useMagic(p: PProc, name: string) = proc isSimpleExpr(p: PProc; n: PNode): bool = # calls all the way down --> can stay expression based - if n.kind in nkCallKinds+{nkBracketExpr, nkDotExpr, nkPar, nkTupleConstr} or - (n.kind in {nkObjConstr, nkBracket, nkCurly}): + case n.kind + of nkCallKinds, nkBracketExpr, nkDotExpr, nkPar, nkTupleConstr, + nkObjConstr, nkBracket, nkCurly: for c in n: if not p.isSimpleExpr(c): return false result = true - elif n.kind == nkStmtListExpr: + of nkStmtListExpr: for i in 0..