aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/psi/execution.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/psi/execution.py')
-rw-r--r--src/psi/execution.py35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/psi/execution.py b/src/psi/execution.py
index 052f7ab..0abdf2c 100644
--- a/src/psi/execution.py
+++ b/src/psi/execution.py
@@ -4,14 +4,43 @@ from psi.interpreter import Interpreter
__all__ = ['Execution']
class Execution:
+ """
+ A class representing the execution of Psi code.
+
+ Args:
+ input: The input code to be executed.
+
+ Returns:
+ None
+
+ Example:
+ ```python
+ execution = Execution("print('Hello, World!')")
+ execution.execute()
+ ```
+ """
+
def __init__(self, input):
+ """
+ Initializes an Execution object.
+
+ Args:
+ input: The input code to be executed.
+
+ Returns:
+ None
+ """
self.input = input
def execute(self):
+ """
+ Executes the input code.
+
+ Returns:
+ The result of the execution.
+ """
parser = Parser(self.input)
ast = parser.parse()
interpreter = Interpreter(ast)
- result = interpreter.interpret()
-
- return result
+ return interpreter.interpret()