Skip to content

Commit

Permalink
fix infixEvaluator
Browse files Browse the repository at this point in the history
Signed-off-by: George Lemon <[email protected]>
  • Loading branch information
georgelemon committed Mar 3, 2024
1 parent 4632a19 commit 5166a4a
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/tim/engine/compilers/html.nim
Original file line number Diff line number Diff line change
Expand Up @@ -477,26 +477,22 @@ proc infixEvaluator(c: var HtmlCompiler, lhs, rhs: Node,
of AND:
case lhs.nt
of ntInfixExpr:
var lh: bool = c.infixEvaluator(lhs.infixLeft, lhs.infixRight, lhs.infixOp, scopetables)
var rh: bool
if lh:
result = c.infixEvaluator(lhs.infixLeft, lhs.infixRight, lhs.infixOp, scopetables)
if result:
case rhs.nt
of ntInfixExpr:
rh = c.infixEvaluator(rhs.infixLeft, rhs.infixRight, rhs.infixOp, scopetables)
return c.infixEvaluator(rhs.infixLeft, rhs.infixRight, rhs.infixOp, scopetables)
else: discard # todo
if rh:
return lh and rh
else: discard
of OR:
case lhs.nt
of ntInfixExpr:
var lh: bool = c.infixEvaluator(lhs.infixLeft, lhs.infixRight, lhs.infixOp, scopetables)
var rh: bool
case rhs.nt
of ntInfixExpr:
rh = c.infixEvaluator(rhs.infixLeft, rhs.infixRight, rhs.infixOp, scopetables)
else: discard # todo
return lh or rh
result = c.infixEvaluator(lhs.infixLeft, lhs.infixRight, lhs.infixOp, scopetables)
if not result:
case rhs.nt
of ntInfixExpr:
return c.infixEvaluator(rhs.infixLeft, rhs.infixRight, rhs.infixOp, scopetables)
else: discard # todo
else: discard # todo
else: discard # todo

Expand Down

0 comments on commit 5166a4a

Please sign in to comment.