From 61490c54c5c30e5b610f8746c9511113472d309a Mon Sep 17 00:00:00 2001 From: George Lemon Date: Mon, 4 Mar 2024 21:00:35 +0200 Subject: [PATCH] infixEvaluator add mising `!=` case Signed-off-by: George Lemon --- src/tim/engine/compilers/html.nim | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/tim/engine/compilers/html.nim b/src/tim/engine/compilers/html.nim index a3b49b6..435b230 100755 --- a/src/tim/engine/compilers/html.nim +++ b/src/tim/engine/compilers/html.nim @@ -390,6 +390,40 @@ proc infixEvaluator(c: var HtmlCompiler, lhs, rhs: Node, let x = c.dotEvaluator(lhs, scopetables) result = c.infixEvaluator(x, rhs, infixOp, scopetables) else: discard + of NE: + case lhs.nt: + of ntLitBool: + case rhs.nt + of ntLitBool: + result = lhs.bVal != rhs.bVal + else: discard + of ntLitString: + case rhs.nt + of ntLitString: + result = lhs.sVal != rhs.sVal + else: discard + of ntLitInt: + case rhs.nt + of ntLitInt: + result = lhs.iVal != rhs.iVal + of ntLitFloat: + result = toFloat(lhs.iVal) != rhs.fVal + else: discard + of ntLitFloat: + case rhs.nt + of ntLitFloat: + result = lhs.fVal != rhs.fVal + of ntLitInt: + result = lhs.fVal != toFloat(rhs.iVal) + else: discard + of ntIdent: + let lhs = c.getValue(lhs, scopetables) + if likely(lhs != nil): + return c.infixEvaluator(lhs, rhs, infixOp, scopetables) + of ntDotExpr: + let x = c.dotEvaluator(lhs, scopetables) + result = c.infixEvaluator(x, rhs, infixOp, scopetables) + else: discard of GT: case lhs.nt: of ntLitInt: