fix: +3 tests (197/233, 85%) — bigint overflow, var_qmark indent, merge double discard

This commit is contained in:
2026-05-09 20:34:26 +03:00
parent f391197524
commit fb13f15c39
3 changed files with 22 additions and 8 deletions
+3 -2
View File
@@ -621,7 +621,7 @@ proc emitSpecialForm(items: seq[CljVal], indent: int): string =
if bname.kind != ckSymbol:
raise newException(EmitterError, "let binding name must be a symbol")
addToScope(bname.symName)
lines.add(indentStr(indent + 1) & "let " & mangleName(bname.symName) & " = " & emitExpr(bval, 0))
lines.add(indentStr(indent + 1) & "let " & mangleName(bname.symName) & " = " & emitExpr(bval, indent + 1))
bi += 2
let body = items[2..^1]
for j, b in body:
@@ -1557,7 +1557,8 @@ proc emitBlock(items: seq[CljVal], indent: int, useResult: bool = false): string
let lastLine = if lastNl == -1: trimmed else: trimmed[lastNl+1..^1].strip()
# Prepend discard before the first non-empty line
if firstNl == -1:
if stripped.startsWith("let ") or stripped.startsWith("proc ") or stripped.startsWith("var "):
if stripped.startsWith("let ") or stripped.startsWith("proc ") or stripped.startsWith("var ") or
stripped.startsWith("discard "):
code = indentStr(indent) & stripped
else:
code = indentStr(indent) & "discard " & stripped