Print a call's result in its own type: a FLOAT result 3.0 is not shown as 3
runPseudo wrote "F returned <value>" without the routine's return type, so a whole-valued FLOAT result printed as an INTEGER would. It now passes the type, as every other value the notation shows does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FgvbRdoEheAHqsRmr2WuKZ
This commit is contained in:
1 file changed
+1
-1
@@ -89,7 +89,7 @@ export function runPseudo(parsed: Parsed<Study>, options: RunOptions): Trace<Pse
|
|||||||
const call = text ? resolveCall(s.program, text) : null;
|
const call = text ? resolveCall(s.program, text) : null;
|
||||||
const tr = runProgram(s.program, { call, input: options.input || [], maxSteps: options.maxSteps ?? 20000, contracts: true, seed: 1 });
|
const tr = runProgram(s.program, { call, input: options.input || [], maxSteps: options.maxSteps ?? 20000, contracts: true, seed: 1 });
|
||||||
const output = tr.output.slice();
|
const output = tr.output.slice();
|
||||||
if (call && tr.result !== undefined && !tr.error) output.push(`${call.name} returned ${formatValue(tr.result)}`);
|
if (call && tr.result !== undefined && !tr.error) output.push(`${call.name} returned ${formatValue(tr.result, tr.resultType)}`);
|
||||||
return {
|
return {
|
||||||
lang: 'pseudo',
|
lang: 'pseudo',
|
||||||
steps: tr.steps,
|
steps: tr.steps,
|
||||||
|
|||||||
Reference in new issue
Block a user