diff options
| author | 2023-09-27 22:10:55 +0800 | |
|---|---|---|
| committer | 2023-09-27 22:10:55 +0800 | |
| commit | 767459d17e031e96d09e533a2a53df896b3a57e1 (patch) | |
| tree | f7ed6952d85be703511f95e17c13824e0ffc33e8 /src/psi/execution.py | |
| parent | ba4129933cdb6d91e695b2de900b8753652ec385 (diff) | |
| download | TRPGNivis-767459d17e031e96d09e533a2a53df896b3a57e1.tar.gz TRPGNivis-767459d17e031e96d09e533a2a53df896b3a57e1.zip | |
feat(docstring): 添加PEP8规范的Docstring
Diffstat (limited to 'src/psi/execution.py')
| -rw-r--r-- | src/psi/execution.py | 35 |
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() |
