Skip to content

Commit

Permalink
temp fix
Browse files Browse the repository at this point in the history
Signed-off-by: George Lemon <[email protected]>
  • Loading branch information
georgelemon committed Feb 15, 2025
1 parent 3819e17 commit 580c5ca
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions src/timpkg/engine/compilers/html.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1205,10 +1205,17 @@ proc infixEvaluator(c: var HtmlCompiler, lhs, rhs: Node,
return lhs.streamContent.fnum == toFloat(rhs.iVal)
else: discard
of ntLitBool:
case lhs.streamContent.kind
of JBool:
return lhs.streamContent.bval == rhs.bVal
else: discard
notnil lhs.streamContent:
case lhs.streamContent.kind
of JBool:
return lhs.streamContent.bval == rhs.bVal
of JString:
return true #fixme
# todo
# find a better way to handle conditional
# expressions that don't contain a rhs node.
# maybe we should not use a default rhs node in this case
else: discard
else: discard
else: discard
of NE:
Expand Down Expand Up @@ -1970,6 +1977,18 @@ proc typeCheck(c: var HtmlCompiler, node: Node, expect: NodeType,
if unlikely(node.nt != expect):
if node.nt == ntStmtList and expect == ntBlock:
return true
elif node.nt == ntStream:
notnil node.streamContent:
case expect:
of ntLitString:
return node.streamContent.kind == JString
of ntLitInt:
return node.streamContent.kind == JInt
of ntLitFloat:
return node.streamContent.kind == JFloat
of ntLitBool:
return node.streamContent.kind == JBool
else: discard
compileErrorWithArgs(typeMismatch, [$(node.nt), $(expect)], meta)
result = true

Expand Down

0 comments on commit 580c5ca

Please sign in to comment.