aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/psi
diff options
context:
space:
mode:
Diffstat (limited to 'psi')
-rw-r--r--psi/Grammar/Token7
-rw-r--r--psi/__init__.py73
-rw-r--r--psi/psi.py69
3 files changed, 81 insertions, 68 deletions
diff --git a/psi/Grammar/Token b/psi/Grammar/Token
index 61dd757..0de3014 100644
--- a/psi/Grammar/Token
+++ b/psi/Grammar/Token
@@ -47,4 +47,9 @@ ELLIPSIS '...'
COLONEQUAL ':='
EXCLAMATION '!'
INTEGER 'INTEGER'
-EOF 'EOF' \ No newline at end of file
+EOF 'EOF'
+SPACE ' '
+
+
+AWAIT
+ASYNC
diff --git a/psi/__init__.py b/psi/__init__.py
index 330fcd3..b3e08df 100644
--- a/psi/__init__.py
+++ b/psi/__init__.py
@@ -3,71 +3,10 @@
@BODY 似乎要写的还蛮多的,所以先写几个TODO List
"""
-__all__ = ['psi']
-
-from psi.execution import Execution
-
-class psi:
- """
- A class representing a Psi object.
-
- Args:
- input: The input value for the Psi object.
-
- Returns:
- None
-
- Example:
- ```python
- obj = Psi("example")
- ```
- """
-
- def __init__(self, input):
- """
- Initializes a Psi object.
-
- Args:
- input: The input value for the Psi object.
-
- Returns:
- None
- """
- self.input = input
- self.execution = Execution(input)
- self.result = None
-
- def execute(self):
- """
- Executes the Psi object.
-
- Returns:
- The result of the execution.
- """
- self.result = self.execution.execute()
- return self.result
-
- def get_result(self):
- """
- Retrieves the result of the Psi object.
-
- Returns:
- The result of the execution.
- """
- return self.result
-
- def set_input(self, input):
- """
- Sets the input value for the Psi object.
-
- Args:
- input: The new input value.
-
- Returns:
- None
- """
- self.input = input
- self.execution = Execution(input)
- self.result = None
-
+__all__ = ['psi', 'Exception', 'interpreter', 'lexer', 'Parser']
+from .psi import psi
+from .execution import Execution
+from .interpreter import Interpreter
+from .lexer import Lexer
+from .parsers import Parser \ No newline at end of file
diff --git a/psi/psi.py b/psi/psi.py
new file mode 100644
index 0000000..8df0acd
--- /dev/null
+++ b/psi/psi.py
@@ -0,0 +1,69 @@
+
+from psi.execution import Execution
+
+__all__ = ['psi']
+
+class psi:
+ """
+ A class representing a Psi object.
+
+ Args:
+ input: The input value for the Psi object.
+
+ Returns:
+ None
+
+ Example:
+ ```python
+ obj = Psi("example")
+ ```
+ """
+
+ def __init__(self, input):
+ """
+ Initializes a Psi object.
+
+ Args:
+ input: The input value for the Psi object.
+
+ Returns:
+ None
+ """
+ self.input = input
+ self.execution = Execution(input)
+ self.result = None
+
+ def execute(self):
+ """
+ Executes the Psi object.
+
+ Returns:
+ The result of the execution.
+ """
+ self.result = self.execution.execute()
+ return self.result
+
+ def get_result(self):
+ """
+ Retrieves the result of the Psi object.
+
+ Returns:
+ The result of the execution.
+ """
+ return self.result
+
+ def set_input(self, input):
+ """
+ Sets the input value for the Psi object.
+
+ Args:
+ input: The new input value.
+
+ Returns:
+ None
+ """
+ self.input = input
+ self.execution = Execution(input)
+ self.result = None
+
+