From 46f9ba5d8c295454381655e6ec02ad3cf8bd79db Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 6 Mar 2026 02:18:40 +0900 Subject: style: switch from tab to space indentation in frontend and worker/php Update biome.json indentStyle from "tab" to "space" and reformat all files in both workspaces. Co-Authored-By: Claude Opus 4.6 --- worker/php/lib.mjs | 118 ++++++++++++++++++++++++++--------------------------- 1 file changed, 59 insertions(+), 59 deletions(-) (limited to 'worker/php/lib.mjs') diff --git a/worker/php/lib.mjs b/worker/php/lib.mjs index 4a34733..d877856 100644 --- a/worker/php/lib.mjs +++ b/worker/php/lib.mjs @@ -10,70 +10,70 @@ const PRELUDE = ` const BUFFER_MAX = 10 * 1024; export function preprocessCode(originalCode) { - if (originalCode.startsWith(" { - if (stdinBuf.length <= stdinPos) { - return null; - } - return stdinBuf.readUInt8(stdinPos++); - }, - stdout: (asciiCode) => { - if (asciiCode === null) { - return; - } - if (BUFFER_MAX <= stdoutPos) { - return; - } - stdoutBuf.writeUInt8( - asciiCode < 0 ? asciiCode + 256 : asciiCode, - stdoutPos++, - ); - }, - stderr: (asciiCode) => { - if (asciiCode === null) { - return; - } - if (BUFFER_MAX <= stderrPos) { - return; - } - stderrBuf.writeUInt8( - asciiCode < 0 ? asciiCode + 256 : asciiCode, - stderrPos++, - ); - }, - getStdout: () => stdoutBuf.subarray(0, stdoutPos).toString(), - getStderr: () => stderrBuf.subarray(0, stderrPos).toString(), - }; + return { + stdin: () => { + if (stdinBuf.length <= stdinPos) { + return null; + } + return stdinBuf.readUInt8(stdinPos++); + }, + stdout: (asciiCode) => { + if (asciiCode === null) { + return; + } + if (BUFFER_MAX <= stdoutPos) { + return; + } + stdoutBuf.writeUInt8( + asciiCode < 0 ? asciiCode + 256 : asciiCode, + stdoutPos++, + ); + }, + stderr: (asciiCode) => { + if (asciiCode === null) { + return; + } + if (BUFFER_MAX <= stderrPos) { + return; + } + stderrBuf.writeUInt8( + asciiCode < 0 ? asciiCode + 256 : asciiCode, + stderrPos++, + ); + }, + getStdout: () => stdoutBuf.subarray(0, stdoutPos).toString(), + getStderr: () => stderrBuf.subarray(0, stderrPos).toString(), + }; } export function buildResult(err, ccallResult, getStdout, getStderr) { - if (err) { - return { - status: "runtime_error", - stdout: getStdout(), - stderr: `${getStderr()}\n${err.toString()}`, - }; - } - return { - status: ccallResult === 0 ? "success" : "runtime_error", - stdout: getStdout(), - stderr: getStderr(), - }; + if (err) { + return { + status: "runtime_error", + stdout: getStdout(), + stderr: `${getStderr()}\n${err.toString()}`, + }; + } + return { + status: ccallResult === 0 ? "success" : "runtime_error", + stdout: getStdout(), + stderr: getStderr(), + }; } -- cgit v1.3.1