From 1da0517a8fbd809951737b62d85653d940c8a4ac Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Wed, 17 Sep 2025 15:58:16 -0400 Subject: [PATCH] auto-insert semicolons in repl --- lox/main.janet | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lox/main.janet b/lox/main.janet index 17ba543..f597b6c 100644 --- a/lox/main.janet +++ b/lox/main.janet @@ -16,6 +16,10 @@ :let [line (string res)] :unless (= res :cancel) :until (= line "")] + (var line (string/trim line)) + (unless (or (string/has-suffix? ";" line) + (string/has-suffix? "}" line)) + (set line (string/join [line ";"]))) (try (process line) ([err] (printf "error: %s" err))))) (defn main [_ &opt path & args] -- 2.51.2