dshellInterpreter 0.1.0__tar.gz → 0.1.1__tar.gz

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.

Files changed (23) hide show
  1. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/Dshell/_DshellInterpreteur/dshell_interpreter.py +4 -4
  2. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/Dshell/_DshellParser/dshell_parser.py +6 -2
  3. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/PKG-INFO +1 -1
  4. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/dshellInterpreter.egg-info/PKG-INFO +1 -1
  5. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/setup.py +1 -1
  6. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/Dshell/DISCORD_COMMANDS/__init__.py +0 -0
  7. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/Dshell/DISCORD_COMMANDS/dshell_channel.py +0 -0
  8. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/Dshell/DISCORD_COMMANDS/dshell_message.py +0 -0
  9. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/Dshell/_DshellInterpreteur/__init__.py +0 -0
  10. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/Dshell/_DshellParser/__init__.py +0 -0
  11. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/Dshell/_DshellParser/ast_nodes.py +0 -0
  12. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/Dshell/_DshellTokenizer/__init__.py +0 -0
  13. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/Dshell/_DshellTokenizer/dshell_keywords.py +0 -0
  14. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/Dshell/_DshellTokenizer/dshell_token_type.py +0 -0
  15. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/Dshell/_DshellTokenizer/dshell_tokenizer.py +0 -0
  16. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/Dshell/__init__.py +0 -0
  17. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/LICENSE +0 -0
  18. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/README.md +0 -0
  19. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/dshellInterpreter.egg-info/SOURCES.txt +0 -0
  20. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/dshellInterpreter.egg-info/dependency_links.txt +0 -0
  21. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/dshellInterpreter.egg-info/requires.txt +0 -0
  22. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/dshellInterpreter.egg-info/top_level.txt +0 -0
  23. {dshellinterpreter-0.1.0 → dshellinterpreter-0.1.1}/setup.cfg +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, 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:
30
30
  print_ast(self.ast)
31
31
 
32
- async def execute(self, ast: Optional[list[All_nodes]] = None):
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.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.1
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dshellInterpreter
3
- Version: 0.1.0
3
+ Version: 0.1.1
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
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setup(
7
7
  name="dshellInterpreter",
8
- version="0.1.0",
8
+ version="0.1.1",
9
9
  author="Chronos",
10
10
  author_email="vagabonwalybi@gmail.com",
11
11
  description="A Discord bot interpreter for creating custom commands and automations.",