dshellInterpreter 0.2.13.16__tar.gz → 0.2.13.18__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.
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/_DshellParser/dshell_parser.py +35 -3
- {dshellinterpreter-0.2.13.16/dshellInterpreter.egg-info → dshellinterpreter-0.2.13.18}/PKG-INFO +1 -1
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18/dshellInterpreter.egg-info}/PKG-INFO +1 -1
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/setup.py +1 -1
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/DISCORD_COMMANDS/__init__.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/DISCORD_COMMANDS/dshell_channel.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/DISCORD_COMMANDS/dshell_interaction.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/DISCORD_COMMANDS/dshell_member.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/DISCORD_COMMANDS/dshell_message.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/DISCORD_COMMANDS/dshell_pastbin.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/DISCORD_COMMANDS/dshell_role.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/DISCORD_COMMANDS/utils/__init__.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/DISCORD_COMMANDS/utils/utils_message.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/DISCORD_COMMANDS/utils/utils_thread.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/_DshellInterpreteur/__init__.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/_DshellInterpreteur/dshell_interpreter.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/_DshellParser/__init__.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/_DshellParser/ast_nodes.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/_DshellTokenizer/__init__.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/_DshellTokenizer/dshell_keywords.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/_DshellTokenizer/dshell_token_type.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/_DshellTokenizer/dshell_tokenizer.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/__init__.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/_utils.py +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/LICENSE +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/README.md +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/dshellInterpreter.egg-info/SOURCES.txt +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/dshellInterpreter.egg-info/dependency_links.txt +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/dshellInterpreter.egg-info/requires.txt +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/dshellInterpreter.egg-info/top_level.txt +0 -0
- {dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/setup.cfg +0 -0
{dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/_DshellParser/dshell_parser.py
RENAMED
|
@@ -51,6 +51,8 @@ def parse(token_lines: list[list[Token]], start_node: ASTNode) -> tuple[list[AST
|
|
|
51
51
|
last_block = blocks[-1]
|
|
52
52
|
|
|
53
53
|
if first_token_line.type == DTT.COMMAND: # si le token est une comande
|
|
54
|
+
if len(tokens_by_line) <= 1:
|
|
55
|
+
raise Exception(f'[{first_token_line.value.upper()}] take one or more arguments on line {first_token_line.position} !')
|
|
54
56
|
body = tokens_by_line[1:] # on récupère ses arguments
|
|
55
57
|
last_block.body.append(CommandNode(first_token_line.value,
|
|
56
58
|
ArgsCommandNode(body))) # on ajoute la commande au body du dernier bloc
|
|
@@ -62,6 +64,7 @@ def parse(token_lines: list[list[Token]], start_node: ASTNode) -> tuple[list[AST
|
|
|
62
64
|
if first_token_line.value == 'if': # si c'est une condition
|
|
63
65
|
if len(tokens_by_line) <= 1:
|
|
64
66
|
raise SyntaxError(f'[IF] Take one or more arguments on line {first_token_line.position} !')
|
|
67
|
+
|
|
65
68
|
if_node = IfNode(condition=tokens_by_line[1:],
|
|
66
69
|
body=[]) # on crée la node avec les arguments de condition du if
|
|
67
70
|
last_block.body.append(if_node)
|
|
@@ -96,7 +99,6 @@ def parse(token_lines: list[list[Token]], start_node: ASTNode) -> tuple[list[AST
|
|
|
96
99
|
last_block.elif_nodes = [elif_node]
|
|
97
100
|
else:
|
|
98
101
|
last_block.elif_nodes.append(elif_node)
|
|
99
|
-
|
|
100
102
|
blocks.append(elif_node)
|
|
101
103
|
|
|
102
104
|
elif first_token_line.value == 'else':
|
|
@@ -107,7 +109,6 @@ def parse(token_lines: list[list[Token]], start_node: ASTNode) -> tuple[list[AST
|
|
|
107
109
|
raise SyntaxError(f'[ELSE] already define !')
|
|
108
110
|
|
|
109
111
|
else_node = ElseNode(body=[])
|
|
110
|
-
|
|
111
112
|
if isinstance(last_block, ElifNode): # si le dernier bloc est un elif
|
|
112
113
|
last_block.parent.else_body = else_node # on ajoute le bloc else à son parent (qui est le dernier if)
|
|
113
114
|
else:
|
|
@@ -133,6 +134,7 @@ def parse(token_lines: list[list[Token]], start_node: ASTNode) -> tuple[list[AST
|
|
|
133
134
|
elif first_token_line.value == '#loop': # si rencontré
|
|
134
135
|
if not isinstance(last_block, LoopNode):
|
|
135
136
|
raise SyntaxError(f'[#LOOP] No loop open on line {first_token_line.position} !')
|
|
137
|
+
|
|
136
138
|
blocks.pop()
|
|
137
139
|
return blocks, pointeur # on renvoie les informations parsé à la dernière loop ouverte
|
|
138
140
|
|
|
@@ -142,6 +144,7 @@ def parse(token_lines: list[list[Token]], start_node: ASTNode) -> tuple[list[AST
|
|
|
142
144
|
if tokens_by_line[1].type != DTT.IDENT:
|
|
143
145
|
raise TypeError(f'[VAR] the variable given must be a ident, '
|
|
144
146
|
f'not {tokens_by_line[1].type} in line {tokens_by_line[1].position}')
|
|
147
|
+
|
|
145
148
|
var_node = VarNode(name=tokens_by_line[1], body=[])
|
|
146
149
|
last_block.body.append(var_node)
|
|
147
150
|
result, status = parser_inline(tokens_by_line[
|
|
@@ -168,6 +171,7 @@ def parse(token_lines: list[list[Token]], start_node: ASTNode) -> tuple[list[AST
|
|
|
168
171
|
if tokens_by_line[1].type != DTT.IDENT:
|
|
169
172
|
raise TypeError(f'[PARAM] the variable given must be a ident, '
|
|
170
173
|
f'not {tokens_by_line[1].type} in line {tokens_by_line[1].position}')
|
|
174
|
+
|
|
171
175
|
param_node = ParamNode(body=[])
|
|
172
176
|
last_block.body.append(param_node)
|
|
173
177
|
_, p = parse(token_lines[pointeur + 1:], param_node)
|
|
@@ -176,6 +180,7 @@ def parse(token_lines: list[list[Token]], start_node: ASTNode) -> tuple[list[AST
|
|
|
176
180
|
elif first_token_line.value == '#param':
|
|
177
181
|
if not isinstance(last_block, ParamNode):
|
|
178
182
|
raise SyntaxError(f'[#PARAM] No parameters open on line {first_token_line.position} !')
|
|
183
|
+
|
|
179
184
|
blocks.pop() # on supprime le dernier bloc (le paramètre)
|
|
180
185
|
return blocks, pointeur # on renvoie les informations parsé à la dernière paramètre ouverte
|
|
181
186
|
|
|
@@ -184,10 +189,11 @@ def parse(token_lines: list[list[Token]], start_node: ASTNode) -> tuple[list[AST
|
|
|
184
189
|
last_block.body.append(end_node)
|
|
185
190
|
|
|
186
191
|
elif first_token_line.value in ('length', 'len'):
|
|
187
|
-
if len(tokens_by_line) !=
|
|
192
|
+
if len(tokens_by_line) != 3:
|
|
188
193
|
raise SyntaxError(f"[LENGTH] Take 2 arguments on line {first_token_line.position} !")
|
|
189
194
|
if first_token_line.type not in (DTT.IDENT, DTT.STR, DTT.LIST):
|
|
190
195
|
raise SyntaxError(f"[LENGTH] Take an ident, str or list on line {first_token_line.position}, not {first_token_line.type} !")
|
|
196
|
+
|
|
191
197
|
var_node = VarNode(tokens_by_line[1], body=[LengthNode(tokens_by_line[2])])
|
|
192
198
|
last_block.body.append(var_node)
|
|
193
199
|
|
|
@@ -196,6 +202,12 @@ def parse(token_lines: list[list[Token]], start_node: ASTNode) -> tuple[list[AST
|
|
|
196
202
|
elif first_token_line.type == DTT.DISCORD_KEYWORD:
|
|
197
203
|
|
|
198
204
|
if first_token_line.value == 'embed':
|
|
205
|
+
if len(tokens_by_line) <= 1:
|
|
206
|
+
raise SyntaxError(f'[EMBED] Take one or more arguments on line {first_token_line.position} !')
|
|
207
|
+
if tokens_by_line[1].type != DTT.IDENT:
|
|
208
|
+
raise TypeError(f'[EMBED] the variable given must be a ident, '
|
|
209
|
+
f'not {tokens_by_line[1].type} in line {tokens_by_line[1].position}')
|
|
210
|
+
|
|
199
211
|
embed_node = EmbedNode(body=[], fields=[])
|
|
200
212
|
var_node = VarNode(tokens_by_line[1], body=[embed_node])
|
|
201
213
|
last_block.body.append(var_node)
|
|
@@ -209,11 +221,20 @@ def parse(token_lines: list[list[Token]], start_node: ASTNode) -> tuple[list[AST
|
|
|
209
221
|
return blocks, pointeur
|
|
210
222
|
|
|
211
223
|
elif first_token_line.value == 'field':
|
|
224
|
+
if len(tokens_by_line) <= 1:
|
|
225
|
+
raise SyntaxError(f'[FIELD] Take one or more arguments on line {first_token_line.position} !')
|
|
212
226
|
if not isinstance(last_block, EmbedNode):
|
|
213
227
|
raise SyntaxError(f'[FIELD] No embed open on line {first_token_line.position} !')
|
|
228
|
+
|
|
214
229
|
last_block.fields.append(FieldEmbedNode(tokens_by_line[1:]))
|
|
215
230
|
|
|
216
231
|
elif first_token_line.value in ('perm', 'permission'):
|
|
232
|
+
if len(tokens_by_line) <= 1:
|
|
233
|
+
raise SyntaxError(f'[PERM] Take one argument on line {first_token_line.position} !')
|
|
234
|
+
if tokens_by_line[1].type != DTT.IDENT:
|
|
235
|
+
raise TypeError(f'[PERM] the variable given must be a ident, '
|
|
236
|
+
f'not {tokens_by_line[1].type} in line {tokens_by_line[1].position}')
|
|
237
|
+
|
|
217
238
|
perm_node = PermissionNode(body=[])
|
|
218
239
|
var_node = VarNode(tokens_by_line[1], body=[perm_node])
|
|
219
240
|
last_block.body.append(var_node)
|
|
@@ -227,6 +248,12 @@ def parse(token_lines: list[list[Token]], start_node: ASTNode) -> tuple[list[AST
|
|
|
227
248
|
return blocks, pointeur
|
|
228
249
|
|
|
229
250
|
elif first_token_line.value == 'ui':
|
|
251
|
+
if len(tokens_by_line) <= 1:
|
|
252
|
+
raise SyntaxError(f'[UI] Take one argument on line {first_token_line.position} !')
|
|
253
|
+
if tokens_by_line[1].type != DTT.IDENT:
|
|
254
|
+
raise TypeError(f'[UI] the variable given must be a ident, '
|
|
255
|
+
f'not {tokens_by_line[1].type} in line {tokens_by_line[1].position}')
|
|
256
|
+
|
|
230
257
|
ui_node = UiNode([])
|
|
231
258
|
var_node = VarNode(tokens_by_line[1], body=[ui_node])
|
|
232
259
|
last_block.body.append(var_node)
|
|
@@ -240,12 +267,17 @@ def parse(token_lines: list[list[Token]], start_node: ASTNode) -> tuple[list[AST
|
|
|
240
267
|
return blocks, pointeur
|
|
241
268
|
|
|
242
269
|
elif first_token_line.value == 'button':
|
|
270
|
+
if len(tokens_by_line) <= 1:
|
|
271
|
+
raise SyntaxError(f'[BUTTON] Take one or more arguments on line {first_token_line.position} !')
|
|
243
272
|
if not isinstance(last_block, UiNode):
|
|
244
273
|
raise SyntaxError(f'[BUTTON] No UI open on line {first_token_line.position} !')
|
|
274
|
+
|
|
245
275
|
button_node = UiButtonNode(tokens_by_line[1:])
|
|
246
276
|
last_block.buttons.append(button_node)
|
|
247
277
|
|
|
248
278
|
elif first_token_line.value == 'select':
|
|
279
|
+
if len(tokens_by_line) <= 1:
|
|
280
|
+
raise SyntaxError(f'[SELECT] Take one or more arguments on line {first_token_line.position} !')
|
|
249
281
|
if not isinstance(last_block, UiNode):
|
|
250
282
|
raise SyntaxError(f'[SELECT] No UI open on line {first_token_line.position} !')
|
|
251
283
|
select_node = UiSelectNode(tokens_by_line[1:])
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="dshellInterpreter",
|
|
8
|
-
version="0.2.13.
|
|
8
|
+
version="0.2.13.18",
|
|
9
9
|
author="Chronos",
|
|
10
10
|
author_email="vagabonwalybi@gmail.com",
|
|
11
11
|
description="A Discord bot interpreter for creating custom commands and automations.",
|
{dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/DISCORD_COMMANDS/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/DISCORD_COMMANDS/dshell_member.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/DISCORD_COMMANDS/dshell_role.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/_DshellInterpreteur/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/_DshellParser/__init__.py
RENAMED
|
File without changes
|
{dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/_DshellParser/ast_nodes.py
RENAMED
|
File without changes
|
{dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/Dshell/_DshellTokenizer/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/dshellInterpreter.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/dshellInterpreter.egg-info/requires.txt
RENAMED
|
File without changes
|
{dshellinterpreter-0.2.13.16 → dshellinterpreter-0.2.13.18}/dshellInterpreter.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|