dshellInterpreter 0.1.0__py3-none-any.whl → 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dshellInterpreter might be problematic. Click here for more details.
- Dshell/_DshellInterpreteur/dshell_interpreter.py +4 -4
- Dshell/_DshellParser/dshell_parser.py +6 -2
- {dshellinterpreter-0.1.0.dist-info → dshellinterpreter-0.1.1.dist-info}/METADATA +1 -1
- {dshellinterpreter-0.1.0.dist-info → dshellinterpreter-0.1.1.dist-info}/RECORD +7 -7
- {dshellinterpreter-0.1.0.dist-info → dshellinterpreter-0.1.1.dist-info}/WHEEL +0 -0
- {dshellinterpreter-0.1.0.dist-info → dshellinterpreter-0.1.1.dist-info}/licenses/LICENSE +0 -0
- {dshellinterpreter-0.1.0.dist-info → dshellinterpreter-0.1.1.dist-info}/top_level.txt +0 -0
|
@@ -19,22 +19,22 @@ context = TypeVar('context', AutoShardedBot, GuildChannel, PrivateChannel)
|
|
|
19
19
|
|
|
20
20
|
class DshellInterpreteur:
|
|
21
21
|
|
|
22
|
-
def __init__(self, ast_or_code: Union[list[All_nodes], str], ctx: context,
|
|
22
|
+
def __init__(self, ast_or_code: Union[list[All_nodes], str], ctx: context, debug: bool = False):
|
|
23
23
|
"""
|
|
24
24
|
Interpreter Dshell code or AST.
|
|
25
25
|
"""
|
|
26
|
-
self.ast: StartNode = parse(DshellTokenizer(ast_or_code).start(), StartNode([]))[0]
|
|
26
|
+
self.ast: StartNode = parse(DshellTokenizer(ast_or_code).start(), StartNode([]))[0]
|
|
27
27
|
self.env: dict[str, Any] = {}
|
|
28
28
|
self.ctx: context = ctx
|
|
29
29
|
if debug:
|
|
30
30
|
print_ast(self.ast)
|
|
31
31
|
|
|
32
|
-
async def execute(self
|
|
32
|
+
async def execute(self):
|
|
33
33
|
"""
|
|
34
34
|
Execute l'arbre syntaxique.
|
|
35
35
|
"""
|
|
36
36
|
|
|
37
|
-
for node in ast:
|
|
37
|
+
for node in self.ast:
|
|
38
38
|
|
|
39
39
|
if isinstance(node, StartNode):
|
|
40
40
|
await self.execute(node.body)
|
|
@@ -20,7 +20,8 @@ from .ast_nodes import (ASTNode,
|
|
|
20
20
|
SleepNode,
|
|
21
21
|
IdentOperationNode,
|
|
22
22
|
EmbedNode,
|
|
23
|
-
FieldEmbedNode
|
|
23
|
+
FieldEmbedNode,
|
|
24
|
+
StartNode)
|
|
24
25
|
from .._DshellTokenizer.dshell_token_type import DshellTokenType as DTT
|
|
25
26
|
from .._DshellTokenizer.dshell_token_type import Token
|
|
26
27
|
|
|
@@ -271,7 +272,10 @@ def parse_postfix_expression(postfix_tokens: list[Token]) -> list[IdentOperation
|
|
|
271
272
|
|
|
272
273
|
|
|
273
274
|
def print_ast(ast: ASTNode, decalage: int = 0):
|
|
274
|
-
for i in ast
|
|
275
|
+
for i in ast:
|
|
276
|
+
|
|
277
|
+
if isinstance(i, StartNode):
|
|
278
|
+
print_ast(i.body, decalage)
|
|
275
279
|
|
|
276
280
|
if isinstance(i, LoopNode):
|
|
277
281
|
print(f"{' ' * decalage}LOOP -> {i.variable.name} : {i.variable.body}")
|
|
@@ -3,16 +3,16 @@ Dshell/DISCORD_COMMANDS/__init__.py,sha256=s58iMazDXNPDLZ3Hvymh__C5w7lcgEvaYfX0-
|
|
|
3
3
|
Dshell/DISCORD_COMMANDS/dshell_channel.py,sha256=IubzNzBtGEcbgkL_NJOWRY1oqE3Yb-ySDMUmoHKjGzM,2135
|
|
4
4
|
Dshell/DISCORD_COMMANDS/dshell_message.py,sha256=jgSGBeDDHVy8u9fX2WN6wzh7I9WqVkeySlpmbJsBZjs,1919
|
|
5
5
|
Dshell/_DshellInterpreteur/__init__.py,sha256=xy5-J-R3YmY99JF3NBHTRRLsComFxpjnCA5xacISctU,35
|
|
6
|
-
Dshell/_DshellInterpreteur/dshell_interpreter.py,sha256=
|
|
6
|
+
Dshell/_DshellInterpreteur/dshell_interpreter.py,sha256=0pFZAk5kA3vzExfhyuQ92amr1OUDqaLzuAxpdwDVezE,10731
|
|
7
7
|
Dshell/_DshellParser/__init__.py,sha256=ONDfhZMvClqP_6tE8SLjp-cf3pXL-auQYnfYRrHZxC4,56
|
|
8
8
|
Dshell/_DshellParser/ast_nodes.py,sha256=ArTyuk7AykJ3xKiW656BOdZg92YEwbfAlzZF1YQeZoA,5483
|
|
9
|
-
Dshell/_DshellParser/dshell_parser.py,sha256=
|
|
9
|
+
Dshell/_DshellParser/dshell_parser.py,sha256=PscOxBG2PXuoTJoKJhw1QRFSMyEMm4-aFxbEkoeXCwc,13241
|
|
10
10
|
Dshell/_DshellTokenizer/__init__.py,sha256=LIQSRhDx2B9pmPx5ADMwwD0Xr9ybneVLhHH8qrJWw_s,172
|
|
11
11
|
Dshell/_DshellTokenizer/dshell_keywords.py,sha256=NFa4VdfX26X5lU1Ps05hZkZg5IyBDpG9WgT9L1oTckM,3617
|
|
12
12
|
Dshell/_DshellTokenizer/dshell_token_type.py,sha256=Gp-Vg2P96oTaKpOEKGHAvER7l98mbcuwmapLVJgmoCI,937
|
|
13
13
|
Dshell/_DshellTokenizer/dshell_tokenizer.py,sha256=9ycZhz2X2uvZynE0illgi5AhtNyR_c5o1KX-pwCP1xM,5692
|
|
14
|
-
dshellinterpreter-0.1.
|
|
15
|
-
dshellinterpreter-0.1.
|
|
16
|
-
dshellinterpreter-0.1.
|
|
17
|
-
dshellinterpreter-0.1.
|
|
18
|
-
dshellinterpreter-0.1.
|
|
14
|
+
dshellinterpreter-0.1.1.dist-info/licenses/LICENSE,sha256=lNgcw1_xb7QENAQi3uHGymaFtbs0RV-ihiCd7AoLQjA,1082
|
|
15
|
+
dshellinterpreter-0.1.1.dist-info/METADATA,sha256=n60MdkJoCrlKgv_VD3w920Cejoi0iM7F5KwJY6LC2YM,1093
|
|
16
|
+
dshellinterpreter-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
17
|
+
dshellinterpreter-0.1.1.dist-info/top_level.txt,sha256=B4CMhtmchGwPQJLuqUy0GhRG-0cUGxKL4GqEbCiB_vE,7
|
|
18
|
+
dshellinterpreter-0.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|