From a92f19180e5d30b0acef3038e4e26bbc9a7aeeeb Mon Sep 17 00:00:00 2001 From: Shautvast Date: Mon, 9 Dec 2024 22:44:10 +0100 Subject: [PATCH] console messages --- css/style.css | 7 ++++--- js/interpreter.js | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/css/style.css b/css/style.css index 8c28db6..e64de4b 100644 --- a/css/style.css +++ b/css/style.css @@ -12,9 +12,9 @@ html { background: rgb(255,241,219); position: fixed; right: 1px; - bottom: 4em; + bottom: 8em; width: 30em; - height: 90%; + height: 70%; border: 2px solid darkgray; border-radius: 10px; z-index: 0; @@ -51,10 +51,11 @@ html { right: 1px; bottom: 0; width: 40em; - height: 2em; + height: 6em; border: 2px solid darkgray; border-radius: 10px; z-index: 0; + overflow: auto; } .multiline { diff --git a/js/interpreter.js b/js/interpreter.js index ef29735..d56e948 100644 --- a/js/interpreter.js +++ b/js/interpreter.js @@ -77,7 +77,8 @@ export function interpret(init_env, code) { visitPrintStatement: (expression) => { let value = THIS.evaluate(expression); - log_console.innerText = THIS.stringify(value); + log_console.innerText += THIS.stringify(value) +"\n"; + log_console.scrollTop = log_console.scrollHeight; }, visitCallStatement: (fun, argList) => {