dshellInterpreter 0.1.0__py3-none-any.whl → 0.1.2__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.

@@ -19,11 +19,11 @@ 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, auto=False, debug: bool = False):
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][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:
@@ -34,7 +34,7 @@ class DshellInterpreteur:
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.body:
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}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dshellInterpreter
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: A Discord bot interpreter for creating custom commands and automations.
5
5
  Home-page: https://github.com/BOXERRMD/Dshell_Interpreter
6
6
  Author: Chronos
@@ -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=bjeSkdLw6dJucNnf-bISDT_vHCOvQ_qRl_-9GJ1rbjM,10780
6
+ Dshell/_DshellInterpreteur/dshell_interpreter.py,sha256=Vs5tojqiI0QMSrc3Ze2MQCojAvqWag7S2biTMnaYxF0,10770
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=iSlrSwoLz_yL4nXHMnPvycRik9iJ-cRzkXZMHRZw5qo,13129
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.0.dist-info/licenses/LICENSE,sha256=lNgcw1_xb7QENAQi3uHGymaFtbs0RV-ihiCd7AoLQjA,1082
15
- dshellinterpreter-0.1.0.dist-info/METADATA,sha256=hkfhSw9LZKtUrbxV9xF-tow1leliffWOpaz_ijj94To,1093
16
- dshellinterpreter-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
- dshellinterpreter-0.1.0.dist-info/top_level.txt,sha256=B4CMhtmchGwPQJLuqUy0GhRG-0cUGxKL4GqEbCiB_vE,7
18
- dshellinterpreter-0.1.0.dist-info/RECORD,,
14
+ dshellinterpreter-0.1.2.dist-info/licenses/LICENSE,sha256=lNgcw1_xb7QENAQi3uHGymaFtbs0RV-ihiCd7AoLQjA,1082
15
+ dshellinterpreter-0.1.2.dist-info/METADATA,sha256=lNxkmuQIfqCTn9vb9dn3_WdYkzhlZXfST5h2Z4maa3o,1093
16
+ dshellinterpreter-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ dshellinterpreter-0.1.2.dist-info/top_level.txt,sha256=B4CMhtmchGwPQJLuqUy0GhRG-0cUGxKL4GqEbCiB_vE,7
18
+ dshellinterpreter-0.1.2.dist-info/RECORD,,