fix: +3 tests (197/233, 85%) — bigint overflow, var_qmark indent, merge double discard
This commit is contained in:
+3
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user