From 33ede4dc9a1cea8f7ef2983d1e5d1fa04da26359 Mon Sep 17 00:00:00 2001 From: "Aman Thapa Magar (PJ)" Date: Fri, 23 Aug 2024 16:01:14 +0100 Subject: [PATCH] cleaning unused functions --- src/interpreter.py | 11 +---------- web/static/css/style.css | 10 +++++----- web/static/js/script.js | 9 --------- 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/src/interpreter.py b/src/interpreter.py index 32e7744..9e5983e 100644 --- a/src/interpreter.py +++ b/src/interpreter.py @@ -847,16 +847,7 @@ def get_previous_value(self, var_name, index): return values[index - 1] else: return None - - def execute_function(self, node): - """ - Executes a function node. - - Args: - node (tuple): The function node. - """ - _, func_name, params, body = node - + def error(self, message): """ Raises an error with the given message. diff --git a/web/static/css/style.css b/web/static/css/style.css index 7214202..c23df2a 100644 --- a/web/static/css/style.css +++ b/web/static/css/style.css @@ -60,10 +60,10 @@ body { /* Editor and Output container styling */ .code-editor, .output { - height: 100%; /* Make sure the height is defined */ - max-height: calc(100% - 60px); /* Adjust the max-height as per your layout */ - overflow-y: auto; /* Enable vertical scroll if content exceeds height */ - overflow-x: hidden; /* Hide horizontal overflow */ + height: 100%; + max-height: calc(100% - 60px); + overflow-y: auto; + overflow-x: hidden; border: 1px solid #ccc; padding: 10px; border-radius: 5px; @@ -74,7 +74,7 @@ body { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 20px; - height: calc(80vh - 100px); /* Adjust height considering container padding and margins */ + height: calc(80vh - 100px); } .CodeMirror { diff --git a/web/static/js/script.js b/web/static/js/script.js index 1ec2586..1c7029d 100644 --- a/web/static/js/script.js +++ b/web/static/js/script.js @@ -1,18 +1,9 @@ -// Initialize CodeMirror editor var editor = CodeMirror.fromTextArea(document.getElementById('code'), { mode: 'python', lineNumbers: true, theme: 'default' }); -// Example codes -const exampleCodes = { - example1: `print('Hello, World!')`, - example2: `for i in range(5):\n print('This is loop iteration', i)`, - example3: `x = 10\nif x > 5:\n print('x is greater than 5')\nelse:\n print('x is not greater than 5')` -}; - -// Function to load example code into the editor function loadExampleCode(filename) { fetch('/load_example/' + filename) .then(response => response.text())