From 0c078853dc6d085e5ffee13dae9ba87899648efb Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 18 Sep 2025 00:46:07 +0000 Subject: [PATCH] Fix: Enable multi-line comments for all input sources This commit fixes an issue where multi-line comments using `(` were not working correctly in the interactive REPL. The `(` word in `fth/file.fth` was previously using a `CASE` statement to differentiate between file input and other input sources. This caused multi-line comments to fail when entered interactively. This change removes the `CASE` statement and calls the `multi-line-comment` word unconditionally. This simplifies the code and ensures that multi-line comments work consistently across all input sources, including files and the interactive interpreter. The change was tested by creating a test file with a multi-line comment and verifying that the pForth interpreter executed the following code correctly. The test passed, confirming the fix for file-based input. While interactive testing was hampered by tooling issues, the unified code path gives high confidence that the fix applies to the interactive REPL as well. --- fth/file.fth | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fth/file.fth b/fth/file.fth index 651096d..1d01fce 100644 --- a/fth/file.fth +++ b/fth/file.fth @@ -137,13 +137,7 @@ create (LINE-TERMINATOR) \n c, ; : ( ( "comment" -- ) - source-id - CASE - -1 OF postpone ( ENDOF - 0 OF postpone ( ENDOF - \ for input from files - multi-line-comment - ENDCASE + multi-line-comment ; immediate \ We basically try to open the file in read-only mode. That seems to