pyscript-programming-language 1.12.5__tar.gz → 1.12.6__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.
- {pyscript_programming_language-1.12.5/pyscript_programming_language.egg-info → pyscript_programming_language-1.12.6}/PKG-INFO +1 -1
- pyscript_programming_language-1.12.6/changelog.md +7 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyproject.toml +1 -1
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/__init__.pyi +2 -2
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/__main__.py +29 -6
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/analyzer.py +1 -1
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/buffer.py +2 -2
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/highlight.py +1 -1
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/interpreter.py +5 -1
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/pysbuiltins.py +6 -2
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/results.py +2 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/runner.py +7 -3
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/shell.py +34 -14
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/utils/debug.py +1 -1
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/version.py +2 -2
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/brainfuck.pys +3 -3
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6/pyscript_programming_language.egg-info}/PKG-INFO +1 -1
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/setup.py +1 -1
- pyscript_programming_language-1.12.5/changelog.md +0 -14
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/MANIFEST.in +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/README.md +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/__init__.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/__init__.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/bases.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/cache.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/checks.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/constants.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/context.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/editor/__init__.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/editor/bases.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/editor/gui.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/editor/terminal.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/exceptions.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/handlers.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/lexer.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/mapping.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/nodes.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/objects.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/parser.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/position.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/symtab.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/token.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/utils/__init__.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/utils/ansi.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/utils/decorators.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/utils/generic.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/utils/jsdict.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/utils/module.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/utils/path.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/utils/similarity.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/utils/string.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/__hello__.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/ansi.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/ast/__init__.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/ast/ast_dump.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/ast/ast_literal_eval.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/ast/ast_unparse.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/ast/ast_walk.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/dis.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/explorer.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/fpstimer/__init__.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/fpstimer/py_fpstimer.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/getch/__init__.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/getch/py_getch.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/inspect.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/jsdict.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/keyword.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/opcode.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/parser.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/pdisplay.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/site.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/symtable.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/token.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/tokenize/__init__.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/tokenize/tok_untokenize.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/other/.nomedia +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/other/PyScript.ico +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/other/copyright +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/other/credits +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/other/license +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/site-packages/this.pys +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/this.py +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript_programming_language.egg-info/SOURCES.txt +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript_programming_language.egg-info/dependency_links.txt +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript_programming_language.egg-info/requires.txt +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript_programming_language.egg-info/top_level.txt +0 -0
- {pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/setup.cfg +0 -0
{pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyproject.toml
RENAMED
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pyscript-programming-language"
|
|
7
|
-
version = "1.12.
|
|
7
|
+
version = "1.12.6"
|
|
8
8
|
description = "PyScript Programming Language"
|
|
9
9
|
readme = { file = "README.md", content-type = "text/markdown" }
|
|
10
10
|
requires-python = ">=3.10"
|
{pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/__main__.py
RENAMED
|
@@ -175,8 +175,6 @@ com_idx = argv.index('-c', 0, end_com) if '-c' in arg_com else \
|
|
|
175
175
|
args = parser.parse_args(argv if com_idx == -1 else argv[:com_idx + 2])
|
|
176
176
|
arg = args.arg if com_idx == -1 else argv[com_idx + 2:]
|
|
177
177
|
|
|
178
|
-
del argv, file_idx, end_idx, end_com, arg_com, com_idx
|
|
179
|
-
|
|
180
178
|
if args.terminal:
|
|
181
179
|
|
|
182
180
|
for fd in (sys.stdout, sys.stderr, sys.stdin):
|
|
@@ -229,6 +227,27 @@ if args.P:
|
|
|
229
227
|
|
|
230
228
|
pys_sys.argv = argv = ['', *arg]
|
|
231
229
|
|
|
230
|
+
# clean up
|
|
231
|
+
try:
|
|
232
|
+
if PYGMENTS:
|
|
233
|
+
del (
|
|
234
|
+
BBCodeFormatter, HtmlFormatter, LatexFormatter, TerminalFormatter, TerminalTrueColorFormatter,
|
|
235
|
+
Terminal256Formatter
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
del (
|
|
239
|
+
ENV_PYSCRIPT_NO_COLOR_PROMPT, ENV_PYSCRIPT_CLASSIC_LINE_SHELL, DEFAULT, DEBUG, NO_COLOR, CLASSIC_LINE_SHELL,
|
|
240
|
+
NO_COLOR_PROMPT, NOTEBOOK, GUI_SUPPORT, TERMINAL_SUPPORT, PYGMENTS, HLFMT_ANSI, HLFMT_HTML, HLFMT_BBCODE,
|
|
241
|
+
USE_NOTEBOOK, OPTIONAL, REMAINDER, file_idx, end_idx, end_com, arg_com, com_idx, arg, pys_sys, __version__,
|
|
242
|
+
is_environ, remove_python_path, getcwd, get_name_from_path, PysGUIEditor, PysTerminalEditor, ArgumentParser
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
del (
|
|
246
|
+
supported, name, class_editor, condition, flag, fd, kernel32, i
|
|
247
|
+
)
|
|
248
|
+
except:
|
|
249
|
+
pass
|
|
250
|
+
|
|
232
251
|
if args.file is not None:
|
|
233
252
|
argv[0] = args.file
|
|
234
253
|
path = normpath(args.file)
|
|
@@ -290,8 +309,10 @@ if args.file is not None:
|
|
|
290
309
|
|
|
291
310
|
code, _ = result.end_process()
|
|
292
311
|
|
|
293
|
-
if args.inspect
|
|
294
|
-
if sys.
|
|
312
|
+
if args.inspect:
|
|
313
|
+
if sys.stdout.closed or sys.stderr.closed:
|
|
314
|
+
code = 1
|
|
315
|
+
elif sys.stdin.closed:
|
|
295
316
|
print("Can't run interactive shell: sys.stdin closed", file=sys.stderr)
|
|
296
317
|
code = 1
|
|
297
318
|
else:
|
|
@@ -314,8 +335,10 @@ elif args.command is not None:
|
|
|
314
335
|
|
|
315
336
|
code, _ = result.end_process()
|
|
316
337
|
|
|
317
|
-
if args.inspect
|
|
318
|
-
if sys.
|
|
338
|
+
if args.inspect:
|
|
339
|
+
if sys.stdout.closed or sys.stderr.closed:
|
|
340
|
+
code = 1
|
|
341
|
+
elif sys.stdin.closed:
|
|
319
342
|
print("Can't run interactive shell: sys.stdin closed", file=sys.stderr)
|
|
320
343
|
code = 1
|
|
321
344
|
else:
|
|
@@ -477,7 +477,7 @@ class PysAnalyzer(Pys):
|
|
|
477
477
|
if self.in_loop == 0 and self.in_switch == 0:
|
|
478
478
|
self.throw("break outside of loop or switch case", node.position)
|
|
479
479
|
|
|
480
|
-
def visit_slice_SubscriptNode(self, node: PysNode | slice | tuple[PysNode | slice]) -> None:
|
|
480
|
+
def visit_slice_SubscriptNode(self, node: PysNode | slice | tuple[PysNode | slice, ...]) -> None:
|
|
481
481
|
type = node.__class__
|
|
482
482
|
|
|
483
483
|
if type is slice:
|
|
@@ -5,7 +5,7 @@ from .utils.string import normstr
|
|
|
5
5
|
|
|
6
6
|
from io import IOBase
|
|
7
7
|
from types import BuiltinMethodType
|
|
8
|
-
from typing import Iterable, Optional
|
|
8
|
+
from typing import Iterable, Optional, Union
|
|
9
9
|
|
|
10
10
|
@immutable
|
|
11
11
|
class PysBuffer(Pys):
|
|
@@ -17,7 +17,7 @@ class PysFileBuffer(PysBuffer):
|
|
|
17
17
|
|
|
18
18
|
def __new__(
|
|
19
19
|
cls,
|
|
20
|
-
text: str
|
|
20
|
+
text: Union[str, bytes, bytearray, Iterable, BuiltinMethodType, IOBase, 'PysFileBuffer'],
|
|
21
21
|
name: Optional[str | bytes] = None
|
|
22
22
|
) -> 'PysFileBuffer':
|
|
23
23
|
|
|
@@ -1316,7 +1316,11 @@ def visit_ContinueNode(node: PysContinueNode, context: PysContext) -> PysRunTime
|
|
|
1316
1316
|
def visit_BreakNode(node: PysBreakNode, context: PysContext) -> PysRunTimeResult:
|
|
1317
1317
|
return PysRunTimeResult().success_break()
|
|
1318
1318
|
|
|
1319
|
-
def visit_slice_SubscriptNode(
|
|
1319
|
+
def visit_slice_SubscriptNode(
|
|
1320
|
+
node: PysNode | slice | tuple[PysNode | slice, ...],
|
|
1321
|
+
context: PysContext
|
|
1322
|
+
) -> PysRunTimeResult:
|
|
1323
|
+
|
|
1320
1324
|
result = PysRunTimeResult()
|
|
1321
1325
|
|
|
1322
1326
|
register = result.register
|
|
@@ -8,7 +8,7 @@ from .handlers import handle_call
|
|
|
8
8
|
from .mapping import GET_ACOLORS, EMPTY_MAP
|
|
9
9
|
from .objects import PysFunction, PysPythonFunction, PysBuiltinFunction
|
|
10
10
|
from .results import PysRunTimeResult
|
|
11
|
-
from .shell import PysClassicLineShell, PysPromptToolkitLineShell
|
|
11
|
+
from .shell import PysClassicLineShell, PysPromptToolkitLineShell, ADVANCE_LINE_SHELL_SUPPORT
|
|
12
12
|
from .symtab import new_module_namespace
|
|
13
13
|
from .utils.debug import import_readline
|
|
14
14
|
from .utils.generic import dkeys, get_subscript, is_object_of as isobjectof
|
|
@@ -264,7 +264,11 @@ def breakpoint(pyfunc):
|
|
|
264
264
|
colored = not (flags & NO_COLOR)
|
|
265
265
|
colored_prompt = not (flags & NO_COLOR_PROMPT)
|
|
266
266
|
scopes = []
|
|
267
|
-
shell = (
|
|
267
|
+
shell = (
|
|
268
|
+
PysClassicLineShell
|
|
269
|
+
if not ADVANCE_LINE_SHELL_SUPPORT or flags & CLASSIC_LINE_SHELL else
|
|
270
|
+
PysPromptToolkitLineShell
|
|
271
|
+
)(
|
|
268
272
|
f'{GET_ACOLORS("bold-magenta")}(Pdb) {GET_ACOLORS("reset")}' if colored and colored_prompt else '(Pdb) ',
|
|
269
273
|
f'{GET_ACOLORS("bold-magenta")}... {GET_ACOLORS("reset")}' if colored and colored_prompt else '... ',
|
|
270
274
|
colored=colored
|
|
@@ -157,9 +157,11 @@ class PysExecuteResult(PysResult):
|
|
|
157
157
|
|
|
158
158
|
def success(self, value: Any) -> 'PysExecuteResult':
|
|
159
159
|
self.value = value
|
|
160
|
+
self.error = None
|
|
160
161
|
return self
|
|
161
162
|
|
|
162
163
|
def failure(self, error: PysTraceback) -> 'PysExecuteResult':
|
|
164
|
+
self.value = None
|
|
163
165
|
self.error = error
|
|
164
166
|
return self
|
|
165
167
|
|
|
@@ -14,7 +14,7 @@ from .parser import PysParser
|
|
|
14
14
|
from .position import PysPosition
|
|
15
15
|
from .pysbuiltins import require
|
|
16
16
|
from .results import PysRunTimeResult, PysExecuteResult
|
|
17
|
-
from .shell import PysClassicLineShell, PysPromptToolkitLineShell
|
|
17
|
+
from .shell import PysClassicLineShell, PysPromptToolkitLineShell, ADVANCE_LINE_SHELL_SUPPORT
|
|
18
18
|
from .symtab import PysSymbolTable, new_module_namespace
|
|
19
19
|
from .utils.debug import import_readline
|
|
20
20
|
from .utils.decorators import TYPECHECK_STACK, typechecked
|
|
@@ -303,7 +303,11 @@ def pys_shell(
|
|
|
303
303
|
symtab = _normalize_namespace(globals, file)
|
|
304
304
|
colored = not (flags & NO_COLOR)
|
|
305
305
|
colored_prompt = not (flags & NO_COLOR_PROMPT)
|
|
306
|
-
shell = (
|
|
306
|
+
shell = (
|
|
307
|
+
PysClassicLineShell
|
|
308
|
+
if not ADVANCE_LINE_SHELL_SUPPORT or flags & CLASSIC_LINE_SHELL else
|
|
309
|
+
PysPromptToolkitLineShell
|
|
310
|
+
)(colored=colored)
|
|
307
311
|
|
|
308
312
|
if colored:
|
|
309
313
|
reset = GET_ACOLORS('reset')
|
|
@@ -320,7 +324,7 @@ def pys_shell(
|
|
|
320
324
|
f'Python {sys.version}\n'
|
|
321
325
|
'Type "help", "copyright", "credits" or "license" for more information.\n'
|
|
322
326
|
'Type "quit", "exit" or "/exit" to exit the shell; "/clear" to clear the shell; "/clean" to clean up the '
|
|
323
|
-
'namespace'
|
|
327
|
+
'namespace.'
|
|
324
328
|
)
|
|
325
329
|
|
|
326
330
|
try:
|
{pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/shell.py
RENAMED
|
@@ -12,14 +12,6 @@ class PysIncompleteHandler(Pys):
|
|
|
12
12
|
self._brackets_stack = []
|
|
13
13
|
self.reset()
|
|
14
14
|
|
|
15
|
-
def is_multiline(self) -> bool:
|
|
16
|
-
return not self._must_break and (
|
|
17
|
-
len(self._brackets_stack) > 0 or
|
|
18
|
-
self._line_continuation or
|
|
19
|
-
self._is_triple_string or
|
|
20
|
-
self._in_decorator
|
|
21
|
-
)
|
|
22
|
-
|
|
23
15
|
def reset(self) -> None:
|
|
24
16
|
self._brackets_stack.clear()
|
|
25
17
|
self._in_string = False
|
|
@@ -30,6 +22,14 @@ class PysIncompleteHandler(Pys):
|
|
|
30
22
|
self._string_prefix = ''
|
|
31
23
|
self.text = ''
|
|
32
24
|
|
|
25
|
+
def _is_multiline(self) -> bool:
|
|
26
|
+
return not self._must_break and (
|
|
27
|
+
len(self._brackets_stack) > 0 or
|
|
28
|
+
self._line_continuation or
|
|
29
|
+
self._is_triple_string or
|
|
30
|
+
self._in_decorator
|
|
31
|
+
)
|
|
32
|
+
|
|
33
33
|
def _process_line(self, text: str) -> None:
|
|
34
34
|
self._in_decorator = False
|
|
35
35
|
self._line_continuation = False
|
|
@@ -55,7 +55,7 @@ class PysIncompleteHandler(Pys):
|
|
|
55
55
|
bind_3 = text[index:index+3]
|
|
56
56
|
|
|
57
57
|
if self._is_triple_string:
|
|
58
|
-
if
|
|
58
|
+
if self._string_prefix * 3 == bind_3:
|
|
59
59
|
self._in_string = False
|
|
60
60
|
self._is_triple_string = False
|
|
61
61
|
index += 2
|
|
@@ -77,6 +77,14 @@ class PysIncompleteHandler(Pys):
|
|
|
77
77
|
if character == '#':
|
|
78
78
|
break
|
|
79
79
|
|
|
80
|
+
elif character == '$':
|
|
81
|
+
index += 1
|
|
82
|
+
while index < len(text) and (character := text[index]).isspace():
|
|
83
|
+
index += 1
|
|
84
|
+
if not character.isidentifier():
|
|
85
|
+
self._must_break = True
|
|
86
|
+
break
|
|
87
|
+
|
|
80
88
|
elif is_space and character == '@':
|
|
81
89
|
self._in_decorator = True
|
|
82
90
|
index += 1
|
|
@@ -92,6 +100,10 @@ class PysIncompleteHandler(Pys):
|
|
|
92
100
|
True
|
|
93
101
|
)
|
|
94
102
|
|
|
103
|
+
elif character == '`':
|
|
104
|
+
self._must_break = True
|
|
105
|
+
break
|
|
106
|
+
|
|
95
107
|
if is_space and not character.isspace():
|
|
96
108
|
is_space = False
|
|
97
109
|
|
|
@@ -102,7 +114,7 @@ class PysIncompleteHandler(Pys):
|
|
|
102
114
|
if self._in_string and not (self._line_continuation or self._is_triple_string):
|
|
103
115
|
self._must_break = True
|
|
104
116
|
|
|
105
|
-
if self.
|
|
117
|
+
if self._is_multiline():
|
|
106
118
|
self.text += text + '\n'
|
|
107
119
|
else:
|
|
108
120
|
self.text += text
|
|
@@ -137,7 +149,7 @@ class PysLineShell(PysIncompleteHandler):
|
|
|
137
149
|
class PysClassicLineShell(PysLineShell):
|
|
138
150
|
|
|
139
151
|
def prompt(self) -> str | Literal[0, 1]:
|
|
140
|
-
is_multiline = self.
|
|
152
|
+
is_multiline = self._is_multiline
|
|
141
153
|
process_line = self._process_line
|
|
142
154
|
process_command = self._process_command
|
|
143
155
|
|
|
@@ -238,7 +250,7 @@ try:
|
|
|
238
250
|
buffer.validate_and_handle()
|
|
239
251
|
return
|
|
240
252
|
|
|
241
|
-
if not self.
|
|
253
|
+
if not self._is_multiline():
|
|
242
254
|
reset()
|
|
243
255
|
buffer.validate_and_handle()
|
|
244
256
|
return
|
|
@@ -307,5 +319,13 @@ try:
|
|
|
307
319
|
def ps2(self, value: str) -> None:
|
|
308
320
|
self._ps2 = ANSI(value) if self._colored else value
|
|
309
321
|
|
|
310
|
-
|
|
311
|
-
|
|
322
|
+
ADVANCE_LINE_SHELL_SUPPORT = True
|
|
323
|
+
|
|
324
|
+
except BaseException as e:
|
|
325
|
+
_error = e
|
|
326
|
+
|
|
327
|
+
class PysPromptToolkitLineShell(PysLineShell):
|
|
328
|
+
def __new__(cls, *args, **kwargs):
|
|
329
|
+
raise ImportError(f"cannot import module prompt_toolkit: {_error}") from _error
|
|
330
|
+
|
|
331
|
+
ADVANCE_LINE_SHELL_SUPPORT = False
|
|
@@ -2,7 +2,7 @@ from ..constants import ENV_PYSCRIPT_NO_EXCEPTHOOK, ENV_PYSCRIPT_NO_READLINE
|
|
|
2
2
|
from ..exceptions import PysTraceback, PysSignal
|
|
3
3
|
from .generic import is_environ
|
|
4
4
|
|
|
5
|
-
from os import system # <-- WARNING: Python>=3.14 deprecated
|
|
5
|
+
from os import system # <-- WARNING: Python>=3.14, this function is deprecated
|
|
6
6
|
from sys import excepthook
|
|
7
7
|
from types import TracebackType
|
|
8
8
|
from typing import Any, Literal
|
|
@@ -7,8 +7,8 @@ from types import MappingProxyType
|
|
|
7
7
|
|
|
8
8
|
version_match = re_compile(r'^(\d+)\.(\d+)\.(\d+)((?:a|b|rc)(\d+)|\.(dev|post)(\d+))?$').match
|
|
9
9
|
|
|
10
|
-
__version__ = '1.12.
|
|
11
|
-
__date__ = '
|
|
10
|
+
__version__ = '1.12.6'
|
|
11
|
+
__date__ = '14 March 2026, 12:30 UTC+7'
|
|
12
12
|
__author__ = ('azzammuhyala',)
|
|
13
13
|
|
|
14
14
|
version = pys_sys.version = f'{__version__} ({__date__})'
|
|
@@ -2,13 +2,13 @@ normstr = require('_pyscript>utils>string>normstr')
|
|
|
2
2
|
getch = require('getch')
|
|
3
3
|
sys = pyimport('sys')
|
|
4
4
|
|
|
5
|
-
func default_input()
|
|
5
|
+
func default_input() {
|
|
6
6
|
while (true) {
|
|
7
|
-
result
|
|
8
|
-
if (0 <= result <= 255) {
|
|
7
|
+
if (0 <= (result := ord(getch.getch())) <= 255) {
|
|
9
8
|
return result
|
|
10
9
|
}
|
|
11
10
|
}
|
|
11
|
+
}
|
|
12
12
|
|
|
13
13
|
func default_output(byte) {
|
|
14
14
|
sys.stdout.write(chr(byte))
|
|
@@ -9,7 +9,7 @@ with open('./README.md', 'r', encoding='utf-8') as file:
|
|
|
9
9
|
|
|
10
10
|
setup(
|
|
11
11
|
name='pyscript-programming-language',
|
|
12
|
-
version='1.12.
|
|
12
|
+
version='1.12.6',
|
|
13
13
|
description='PyScript Programming Language',
|
|
14
14
|
long_description=long_description,
|
|
15
15
|
long_description_content_type='text/markdown',
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
## [1.12.5] - 12/03/2026
|
|
4
|
-
|
|
5
|
-
### Added
|
|
6
|
-
- Type hints in almost all core implementations and built-in modules.
|
|
7
|
-
- _etc._
|
|
8
|
-
|
|
9
|
-
### Fixed
|
|
10
|
-
- **Fixed some bugs**.
|
|
11
|
-
- `return` statements will not consume the following line, including `as`, `assert`, and `throw`/`raise`.
|
|
12
|
-
- Changed the token type name separator `-` to `_`.
|
|
13
|
-
- Parser improvements.
|
|
14
|
-
- _etc._
|
|
File without changes
|
|
File without changes
|
{pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/bases.py
RENAMED
|
File without changes
|
{pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/cache.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
|
|
File without changes
|
|
File without changes
|
{pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/lexer.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/nodes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/core/token.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/ansi.pys
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/dis.pys
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/site.pys
RENAMED
|
File without changes
|
|
File without changes
|
{pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/lib/token.pys
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/other/credits
RENAMED
|
File without changes
|
{pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/other/license
RENAMED
|
File without changes
|
|
File without changes
|
{pyscript_programming_language-1.12.5 → pyscript_programming_language-1.12.6}/pyscript/this.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|