pyscript-programming-language 1.13.2__tar.gz → 1.13.3__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.13.2 → pyscript_programming_language-1.13.3}/PKG-INFO +4 -4
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/README.md +1 -1
- pyscript_programming_language-1.13.3/changelog.md +13 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyproject.toml +2 -2
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/__main__.py +11 -10
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/cache.py +5 -1
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/checks.py +3 -3
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/highlight.py +1 -1
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/interpreter.py +2 -13
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/lexer.py +15 -10
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/mapping.py +11 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/parser.py +37 -6
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/version.py +3 -3
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/ast/ast_literal_eval.py +2 -3
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/site.pys +2 -2
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript_programming_language.egg-info/PKG-INFO +4 -4
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/setup.py +2 -2
- pyscript_programming_language-1.13.2/changelog.md +0 -7
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/MANIFEST.in +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/__init__.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/__init__.pyi +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/__init__.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/analyzer.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/bases.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/buffer.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/constants.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/context.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/editor/__init__.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/editor/bases.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/editor/gui.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/editor/terminal.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/exceptions.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/handlers.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/nodes.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/position.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/pysbuiltins.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/pystypes.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/results.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/runner.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/shell.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/symtab.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/token.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/utils/__init__.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/utils/ansi.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/utils/debug.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/utils/decorators.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/utils/generic.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/utils/module.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/utils/path.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/utils/similarity.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/utils/string.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/__hello__.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/ansi.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/ast/__init__.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/ast/ast_dump.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/ast/ast_unparse.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/ast/ast_walk.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/brainfuck.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/code.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/dis.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/explorer.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/fpstimer/__init__.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/fpstimer/py_fpstimer.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/getch/__init__.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/getch/py_getch.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/history.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/inspect.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/jsdict.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/keyword.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/opcode.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/parser.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/pdisplay.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/symtable.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/token.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/tokenize/__init__.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/tokenize/tok_untokenize.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/other/.nomedia +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/other/PyScript.ico +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/other/copyright +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/other/credits +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/other/license +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/site-packages/this.pys +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/this.py +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript_programming_language.egg-info/SOURCES.txt +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript_programming_language.egg-info/dependency_links.txt +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript_programming_language.egg-info/requires.txt +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript_programming_language.egg-info/top_level.txt +0 -0
- {pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/setup.cfg +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyscript-programming-language
|
|
3
|
-
Version: 1.13.
|
|
3
|
+
Version: 1.13.3
|
|
4
4
|
Summary: PyScript Programming Language
|
|
5
5
|
Home-page: https://azzammuhyala.github.io/pyscript
|
|
6
|
-
Author:
|
|
7
|
-
Author-email:
|
|
6
|
+
Author: AzzamMuhyala
|
|
7
|
+
Author-email: AzzamMuhyala <azzammuhyala@gmail.com>
|
|
8
8
|
License-Expression: MIT
|
|
9
9
|
Project-URL: Homepage, https://azzammuhyala.github.io/pyscript
|
|
10
10
|
Project-URL: Documentation, https://azzammuhyala.github.io/pyscript
|
|
@@ -145,7 +145,7 @@ Familiar? There it is!
|
|
|
145
145
|
- **optional**: Not required, but if it is present, some features can be used without issue.
|
|
146
146
|
|
|
147
147
|
## Highlights 🎨
|
|
148
|
-
- [PyScript plugin for Acode (Ace Editor)](https://github.com/azzammuhyala/pyscript/releases/download/v1.13.
|
|
148
|
+
- [PyScript plugin for Acode (Ace Editor)](https://github.com/azzammuhyala/pyscript/releases/download/v1.13.3/plugin-1.0.2.zip)
|
|
149
149
|
- [PyScript nano for Linux](https://github.com/azzammuhyala/pyscript/tree/main/highlight/nano)
|
|
150
150
|
- [PyScript extension for VSCode](https://marketplace.visualstudio.com/items?itemName=azzammuhyala.pyslang)
|
|
151
151
|
|
|
@@ -113,7 +113,7 @@ Familiar? There it is!
|
|
|
113
113
|
- **optional**: Not required, but if it is present, some features can be used without issue.
|
|
114
114
|
|
|
115
115
|
## Highlights 🎨
|
|
116
|
-
- [PyScript plugin for Acode (Ace Editor)](https://github.com/azzammuhyala/pyscript/releases/download/v1.13.
|
|
116
|
+
- [PyScript plugin for Acode (Ace Editor)](https://github.com/azzammuhyala/pyscript/releases/download/v1.13.3/plugin-1.0.2.zip)
|
|
117
117
|
- [PyScript nano for Linux](https://github.com/azzammuhyala/pyscript/tree/main/highlight/nano)
|
|
118
118
|
- [PyScript extension for VSCode](https://marketplace.visualstudio.com/items?itemName=azzammuhyala.pyslang)
|
|
119
119
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Change Logs
|
|
2
|
+
|
|
3
|
+
## [1.13.3] - 31/05/2026
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Parsing of number literals, string literals, and identifiers is now interned and stored in `sys.interns`.
|
|
7
|
+
- Warning messages in the parser about the use of the `is` and `is not` operators on number and string literals.
|
|
8
|
+
- _etc._
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Improved lexer and highlighting on numbers.
|
|
12
|
+
- Fixed some bugs.
|
|
13
|
+
- _etc._
|
{pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyproject.toml
RENAMED
|
@@ -4,14 +4,14 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pyscript-programming-language"
|
|
7
|
-
version = "1.13.
|
|
7
|
+
version = "1.13.3"
|
|
8
8
|
description = "PyScript Programming Language"
|
|
9
9
|
readme = { file = "README.md", content-type = "text/markdown" }
|
|
10
10
|
requires-python = ">=3.10"
|
|
11
11
|
license = "MIT"
|
|
12
12
|
|
|
13
13
|
authors = [
|
|
14
|
-
{ name = "
|
|
14
|
+
{ name = "AzzamMuhyala", email = "azzammuhyala@gmail.com" }
|
|
15
15
|
]
|
|
16
16
|
|
|
17
17
|
keywords = [
|
{pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/__main__.py
RENAMED
|
@@ -13,7 +13,7 @@ from .core.runner import _namespace_to_symbol_table, pys_runner, pys_shell
|
|
|
13
13
|
from .core.utils.debug import USE_NOTEBOOK
|
|
14
14
|
from .core.utils.generic import is_environ
|
|
15
15
|
from .core.utils.module import find_module_path, remove_python_path
|
|
16
|
-
from .core.utils.path import getcwd, base
|
|
16
|
+
from .core.utils.path import getcwd, base, normpath
|
|
17
17
|
from .core.version import __version__
|
|
18
18
|
|
|
19
19
|
if PYGMENTS:
|
|
@@ -272,24 +272,25 @@ def clean_up() -> None:
|
|
|
272
272
|
continue
|
|
273
273
|
|
|
274
274
|
def load_file(path) -> PysFileBuffer:
|
|
275
|
+
normalized = normpath(path)
|
|
275
276
|
try:
|
|
276
|
-
with open(
|
|
277
|
-
return PysFileBuffer(file,
|
|
277
|
+
with open(normalized, 'r', encoding='utf-8') as file:
|
|
278
|
+
return PysFileBuffer(file, normalized)
|
|
278
279
|
except FileNotFoundError:
|
|
279
280
|
if not (EDITOR_MAP and args.editor):
|
|
280
|
-
argument_error('file', f"can't open file \"{
|
|
281
|
+
argument_error('file', f"can't open file \"{normalized}\": No such file or directory")
|
|
281
282
|
except PermissionError:
|
|
282
|
-
argument_error('file', f"can't open file \"{
|
|
283
|
+
argument_error('file', f"can't open file \"{normalized}\": Permission denied")
|
|
283
284
|
except IsADirectoryError:
|
|
284
|
-
argument_error('file', f"can't open file \"{
|
|
285
|
+
argument_error('file', f"can't open file \"{normalized}\": Path is not a file")
|
|
285
286
|
except NotADirectoryError:
|
|
286
|
-
argument_error('file', f"can't open file \"{
|
|
287
|
+
argument_error('file', f"can't open file \"{normalized}\": Attempting to access directory from file")
|
|
287
288
|
except (OSError, IOError):
|
|
288
|
-
argument_error('file', f"can't open file \"{
|
|
289
|
+
argument_error('file', f"can't open file \"{normalized}\": Attempting to access a system directory or file")
|
|
289
290
|
except UnicodeDecodeError:
|
|
290
|
-
argument_error('file', f"can't read file \"{
|
|
291
|
+
argument_error('file', f"can't read file \"{normalized}\": Bad file")
|
|
291
292
|
except BaseException as e:
|
|
292
|
-
argument_error('file', f"file \"{
|
|
293
|
+
argument_error('file', f"file \"{normalized}\": Unexpected error: {e}")
|
|
293
294
|
return PysFileBuffer('', path)
|
|
294
295
|
|
|
295
296
|
def execute(file: PysFileBuffer) -> None:
|
{pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/cache.py
RENAMED
|
@@ -6,7 +6,7 @@ from .utils.module import get_module_candidate
|
|
|
6
6
|
from .utils.path import base
|
|
7
7
|
|
|
8
8
|
from types import ModuleType
|
|
9
|
-
from typing import Literal
|
|
9
|
+
from typing import Any, Literal
|
|
10
10
|
|
|
11
11
|
import sys
|
|
12
12
|
import os
|
|
@@ -28,6 +28,7 @@ pys_sys.builtin_module_names = tuple(
|
|
|
28
28
|
pys_sys.path = [LIBRARIES_PATH, SITE_PACKAGES_PATH]
|
|
29
29
|
pys_sys.loading_modules = set()
|
|
30
30
|
pys_sys.modules = {}
|
|
31
|
+
pys_sys.interns = {}
|
|
31
32
|
pys_sys.singletons = {}
|
|
32
33
|
pys_sys.argv = ['']
|
|
33
34
|
pys_sys.flags = DEFAULT
|
|
@@ -56,6 +57,9 @@ for name in (
|
|
|
56
57
|
if hasattr(sys, name):
|
|
57
58
|
setattr(pys_sys, name, getattr(sys, name))
|
|
58
59
|
|
|
60
|
+
def intern_object(object: Any) -> Any:
|
|
61
|
+
return pys_sys.interns.setdefault((type(object), object), object)
|
|
62
|
+
|
|
59
63
|
# sentinel
|
|
60
64
|
@singleton
|
|
61
65
|
@inheritable
|
|
@@ -20,9 +20,9 @@ is_sequence = frozenset([
|
|
|
20
20
|
PysSetNode, PysListNode, PysTupleNode
|
|
21
21
|
]).__contains__
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
])
|
|
23
|
+
is_literal = frozenset([
|
|
24
|
+
PysNumberNode, PysStringNode
|
|
25
|
+
]).__contains__
|
|
26
26
|
|
|
27
27
|
is_keyword = frozenset(KEYWORDS).__contains__
|
|
28
28
|
is_constant_keyword = frozenset(CONSTANT_KEYWORDS).__contains__
|
|
@@ -204,7 +204,7 @@ try:
|
|
|
204
204
|
bygroups(Number.Affix, Number.Hex, Number.Affix)
|
|
205
205
|
),
|
|
206
206
|
(
|
|
207
|
-
rf'\
|
|
207
|
+
rf'(?<![\w.])((?:(?:{_integer})?\.{_integer}|{_integer}\.){_scientific}?)({_imaginary})(?![\w.])',
|
|
208
208
|
bygroups(Number.Float, Number.Affix)
|
|
209
209
|
),
|
|
210
210
|
(
|
|
@@ -6,7 +6,7 @@ from .checks import is_sequence, is_equal, is_public_attribute
|
|
|
6
6
|
from .context import PysContext, PysClassContext
|
|
7
7
|
from .exceptions import PysTraceback
|
|
8
8
|
from .handlers import handle_call
|
|
9
|
-
from .mapping import GET_BINARY_FUNCTION, GET_UNARY_FUNCTION
|
|
9
|
+
from .mapping import GET_BINARY_FUNCTION, GET_UNARY_FUNCTION, GET_VALUE_FROM_CONSTANT_KEYWORDS
|
|
10
10
|
from .nodes import *
|
|
11
11
|
from .pysbuiltins import ce, nce, increment, decrement
|
|
12
12
|
from .pystypes import PysFunction
|
|
@@ -28,17 +28,6 @@ T_OR = TOKENS['DOUBLE_PIPE']
|
|
|
28
28
|
T_CE = TOKENS['EQUAL_TILDE']
|
|
29
29
|
T_NCE = TOKENS['EXCLAMATION_TILDE']
|
|
30
30
|
|
|
31
|
-
get_value_from_keyword = {
|
|
32
|
-
'True': True,
|
|
33
|
-
'False': False,
|
|
34
|
-
'None': None,
|
|
35
|
-
'true': True,
|
|
36
|
-
'false': False,
|
|
37
|
-
'nil': None,
|
|
38
|
-
'none': None,
|
|
39
|
-
'null': None
|
|
40
|
-
}.__getitem__
|
|
41
|
-
|
|
42
31
|
def visit_NumberNode(node: PysNumberNode, context: PysContext) -> PysRunTimeResult:
|
|
43
32
|
return PysRunTimeResult().success(node.value.value)
|
|
44
33
|
|
|
@@ -46,7 +35,7 @@ def visit_StringNode(node: PysStringNode, context: PysContext) -> PysRunTimeResu
|
|
|
46
35
|
return PysRunTimeResult().success(node.value.value)
|
|
47
36
|
|
|
48
37
|
def visit_KeywordNode(node: PysKeywordNode, context: PysContext) -> PysRunTimeResult:
|
|
49
|
-
return PysRunTimeResult().success(
|
|
38
|
+
return PysRunTimeResult().success(GET_VALUE_FROM_CONSTANT_KEYWORDS(node.name.value))
|
|
50
39
|
|
|
51
40
|
def visit_DebugNode(node: PysDebugNode, context: PysContext) -> PysRunTimeResult:
|
|
52
41
|
return PysRunTimeResult().success(True if context.flags & DEBUG else False)
|
{pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/lexer.py
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from .bases import Pys
|
|
2
2
|
from .buffer import PysFileBuffer
|
|
3
|
+
from .cache import intern_object
|
|
3
4
|
from .checks import is_keyword
|
|
4
5
|
from .constants import DEFAULT, SILENT, LEXER_HIGHLIGHT, NO_COLOR
|
|
5
6
|
from .context import PysContext
|
|
@@ -299,6 +300,7 @@ class PysLexer(Pys):
|
|
|
299
300
|
if self.current_character == '_':
|
|
300
301
|
is_underscore = True
|
|
301
302
|
self.advance()
|
|
303
|
+
continue
|
|
302
304
|
|
|
303
305
|
elif self.current_character == '.' and not is_scientific and format is int:
|
|
304
306
|
format = float
|
|
@@ -334,7 +336,7 @@ class PysLexer(Pys):
|
|
|
334
336
|
|
|
335
337
|
break
|
|
336
338
|
|
|
337
|
-
|
|
339
|
+
if self.character_in('eE') and not is_scientific:
|
|
338
340
|
format = float
|
|
339
341
|
is_scientific = True
|
|
340
342
|
|
|
@@ -382,20 +384,23 @@ class PysLexer(Pys):
|
|
|
382
384
|
elif format is int:
|
|
383
385
|
result = int(number)
|
|
384
386
|
|
|
385
|
-
self.add_token(TOKENS['NUMBER'], start, complex(0, result) if is_complex else result)
|
|
387
|
+
self.add_token(TOKENS['NUMBER'], start, intern_object(complex(0, result) if is_complex else result))
|
|
386
388
|
|
|
387
389
|
except (ValueError, OverflowError):
|
|
388
|
-
integer_to_string_limit = (
|
|
389
|
-
|
|
390
|
+
integer_to_string_limit, other_message = (
|
|
391
|
+
(
|
|
392
|
+
f"({sys.get_int_max_str_digits()} digits) ",
|
|
393
|
+
"; use sys.set_int_max_str_digits() to increase the limit - Consider hexadecimal for huge integer "
|
|
394
|
+
"literals to avoid decimal conversion limits"
|
|
395
|
+
)
|
|
390
396
|
if hasattr(sys, 'get_int_max_str_digits') else
|
|
391
|
-
''
|
|
397
|
+
('', '')
|
|
392
398
|
)
|
|
393
399
|
|
|
394
400
|
self.throw(
|
|
395
401
|
start, self.index,
|
|
396
402
|
f"Exceeds the limit {integer_to_string_limit}for integer string conversion: "
|
|
397
|
-
f"value has {len(number)} digits
|
|
398
|
-
"Consider hexadecimal for huge integer literals to avoid decimal conversion limits."
|
|
403
|
+
f"value has {len(number)} digits{other_message}."
|
|
399
404
|
)
|
|
400
405
|
|
|
401
406
|
def make_string(self) -> None:
|
|
@@ -560,7 +565,7 @@ class PysLexer(Pys):
|
|
|
560
565
|
|
|
561
566
|
string += '\\' + character
|
|
562
567
|
self.warning(
|
|
563
|
-
f"{self.file.name}:{position.start_line}:{position.start_column
|
|
568
|
+
f"{self.file.name}:{position.start_line}:{position.start_column}: "
|
|
564
569
|
f"SyntaxWarning: \"\\{character}\" "
|
|
565
570
|
"is an invalid escape sequence. Such sequences will not work in the future. Did you mean "
|
|
566
571
|
f"\"\\\\{character}\"? A raw string is also an option.\n" +
|
|
@@ -602,7 +607,7 @@ class PysLexer(Pys):
|
|
|
602
607
|
except UnicodeEncodeError:
|
|
603
608
|
self.throw(start, self.index, "bytes can only contain ASCII literal characters", add_token=False)
|
|
604
609
|
|
|
605
|
-
self.add_token(TOKENS['STRING'], start, string)
|
|
610
|
+
self.add_token(TOKENS['STRING'], start, intern_object(string))
|
|
606
611
|
|
|
607
612
|
def make_identifier(self) -> None:
|
|
608
613
|
start = self.index
|
|
@@ -629,7 +634,7 @@ class PysLexer(Pys):
|
|
|
629
634
|
self.add_token(
|
|
630
635
|
TOKENS['KEYWORD'] if not identifier and is_keyword(name) else TOKENS['IDENTIFIER'],
|
|
631
636
|
start,
|
|
632
|
-
name
|
|
637
|
+
intern_object(name)
|
|
633
638
|
)
|
|
634
639
|
|
|
635
640
|
def make_plus(self) -> None:
|
|
@@ -65,6 +65,17 @@ GET_UNARY_FUNCTION = {
|
|
|
65
65
|
TOKENS['TILDE']: inv
|
|
66
66
|
}.__getitem__
|
|
67
67
|
|
|
68
|
+
GET_VALUE_FROM_CONSTANT_KEYWORDS = {
|
|
69
|
+
'True': True,
|
|
70
|
+
'False': False,
|
|
71
|
+
'None': None,
|
|
72
|
+
'true': True,
|
|
73
|
+
'false': False,
|
|
74
|
+
'nil': None,
|
|
75
|
+
'none': None,
|
|
76
|
+
'null': None
|
|
77
|
+
}.__getitem__
|
|
78
|
+
|
|
68
79
|
GET_ACOLOR = {
|
|
69
80
|
'reset': acolor('reset'),
|
|
70
81
|
'magenta': acolor('magenta'),
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
from .bases import Pys
|
|
2
|
-
from .
|
|
3
|
-
from .
|
|
2
|
+
from .cache import intern_object
|
|
3
|
+
from .checks import is_sequence, is_literal, is_left_bracket, is_right_bracket
|
|
4
|
+
from .constants import DEFAULT, NO_COLOR, SILENT, DICT_TO_JSDICT
|
|
4
5
|
from .context import PysContext
|
|
5
6
|
from .exceptions import PysTraceback
|
|
6
7
|
from .mapping import BRACKETS_MAP
|
|
7
8
|
from .nodes import *
|
|
8
|
-
from .position import PysPosition
|
|
9
|
+
from .position import PysPosition, format_error_arrow
|
|
9
10
|
from .pystypes import jsdict
|
|
10
11
|
from .results import PysParserResult
|
|
11
12
|
from .token import TOKENS, PysToken
|
|
12
13
|
from .utils.decorators import typecheck
|
|
13
14
|
from .utils.generic import setimuattr
|
|
15
|
+
from .utils.string import indent
|
|
14
16
|
|
|
15
17
|
from types import MappingProxyType
|
|
16
18
|
from typing import Any, Callable, Optional
|
|
17
19
|
|
|
20
|
+
import sys
|
|
21
|
+
|
|
18
22
|
SEQUENCES_MAP = MappingProxyType({
|
|
19
23
|
'dict': (TOKENS['LEFT_CURLY'], PysDictionaryNode),
|
|
20
24
|
'set': (TOKENS['LEFT_CURLY'], PysSetNode),
|
|
@@ -73,6 +77,10 @@ class PysParser(Pys):
|
|
|
73
77
|
self.token_index -= amount
|
|
74
78
|
self.update_current_token()
|
|
75
79
|
|
|
80
|
+
def warning(self, message: str) -> None:
|
|
81
|
+
if not (self.flags & SILENT):
|
|
82
|
+
print(message, file=sys.stderr)
|
|
83
|
+
|
|
76
84
|
def new_error(self, message: str, position: Optional[PysPosition] = None) -> PysTraceback:
|
|
77
85
|
return PysTraceback(
|
|
78
86
|
SyntaxError(message),
|
|
@@ -772,7 +780,7 @@ class PysParser(Pys):
|
|
|
772
780
|
token.position.start,
|
|
773
781
|
end
|
|
774
782
|
),
|
|
775
|
-
string
|
|
783
|
+
intern_object(string)
|
|
776
784
|
)
|
|
777
785
|
)
|
|
778
786
|
)
|
|
@@ -2403,7 +2411,11 @@ class PysParser(Pys):
|
|
|
2403
2411
|
|
|
2404
2412
|
operations[-1] = PysToken(
|
|
2405
2413
|
TOKENS['EXCLAMATION_GREATER_THAN'],
|
|
2406
|
-
|
|
2414
|
+
PysPosition(
|
|
2415
|
+
self.current_token.position.file,
|
|
2416
|
+
token.position.start,
|
|
2417
|
+
self.current_token.position.end
|
|
2418
|
+
)
|
|
2407
2419
|
)
|
|
2408
2420
|
|
|
2409
2421
|
last_token = self.current_token
|
|
@@ -2419,7 +2431,11 @@ class PysParser(Pys):
|
|
|
2419
2431
|
):
|
|
2420
2432
|
operations[-1] = PysToken(
|
|
2421
2433
|
TOKENS['IS_NOT'],
|
|
2422
|
-
|
|
2434
|
+
PysPosition(
|
|
2435
|
+
self.current_token.position.file,
|
|
2436
|
+
last_token.position.start,
|
|
2437
|
+
self.current_token.position.end
|
|
2438
|
+
)
|
|
2423
2439
|
)
|
|
2424
2440
|
|
|
2425
2441
|
result.register_advancement()
|
|
@@ -2430,6 +2446,21 @@ class PysParser(Pys):
|
|
|
2430
2446
|
if result.error:
|
|
2431
2447
|
return result
|
|
2432
2448
|
|
|
2449
|
+
if (
|
|
2450
|
+
membership and
|
|
2451
|
+
(is_literal(type((literal := expressions[-1]))) or is_literal(type((literal := expression)))) and
|
|
2452
|
+
(token := operations[-1]).type in (TOKENS['IS'], TOKENS['IS_NOT'])
|
|
2453
|
+
):
|
|
2454
|
+
position = token.position
|
|
2455
|
+
equal = token.type == TOKENS['IS']
|
|
2456
|
+
self.warning(
|
|
2457
|
+
f"{position.file.name}:{position.start_line}:{position.start_column}: "
|
|
2458
|
+
f"SyntaxWarning: \"{'is' if equal else 'is not'}\" "
|
|
2459
|
+
f"with '{type(literal.value.value).__name__}' literal. "
|
|
2460
|
+
f"Did you mean \"{'==' if equal else '!='}\"?\n" +
|
|
2461
|
+
indent(format_error_arrow(position, not (self.flags & NO_COLOR)), 2)
|
|
2462
|
+
)
|
|
2463
|
+
|
|
2433
2464
|
if operations:
|
|
2434
2465
|
expressions.append(expression)
|
|
2435
2466
|
|
|
@@ -6,9 +6,9 @@ from types import MappingProxyType
|
|
|
6
6
|
|
|
7
7
|
import re
|
|
8
8
|
|
|
9
|
-
__version__ = '1.13.
|
|
10
|
-
__date__ = '
|
|
11
|
-
__author__ = ('
|
|
9
|
+
__version__ = '1.13.3'
|
|
10
|
+
__date__ = '31 May 2026, 22:30 UTC+7'
|
|
11
|
+
__author__ = ('AzzamMuhyala',)
|
|
12
12
|
|
|
13
13
|
version = pys_sys.version = f'{__version__} ({__date__})'
|
|
14
14
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from pyscript.core.
|
|
1
|
+
from pyscript.core.mapping import GET_VALUE_FROM_CONSTANT_KEYWORDS
|
|
2
2
|
from pyscript.core.nodes import (
|
|
3
3
|
PysNode, PysNumberNode, PysStringNode, PysKeywordNode, PysIdentifierNode, PysDictionaryNode, PysSetNode,
|
|
4
4
|
PysListNode, PysTupleNode, PysCallNode, PysUnaryOperatorNode, PysBinaryOperatorNode, PysEllipsisNode
|
|
@@ -42,8 +42,7 @@ def visit_StringNode(node: PysStringNode) -> str | bytes:
|
|
|
42
42
|
return node.value.value
|
|
43
43
|
|
|
44
44
|
def visit_KeywordNode(node: PysKeywordNode) -> bool | None:
|
|
45
|
-
|
|
46
|
-
return get_value_from_keyword(node.name.value)
|
|
45
|
+
return GET_VALUE_FROM_CONSTANT_KEYWORDS(node.name.value)
|
|
47
46
|
|
|
48
47
|
def visit_IdentifierNode(node: PysIdentifierNode) -> Any:
|
|
49
48
|
name = node.name.value
|
{pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/site.pys
RENAMED
|
@@ -82,13 +82,13 @@ if (__name__ == '__main__') {
|
|
|
82
82
|
parser.add_argument(
|
|
83
83
|
'-a',
|
|
84
84
|
metavar='PATH',
|
|
85
|
-
help='add a package to site
|
|
85
|
+
help='add a package to site packages'
|
|
86
86
|
)
|
|
87
87
|
|
|
88
88
|
parser.add_argument(
|
|
89
89
|
'-r',
|
|
90
90
|
metavar='NAME',
|
|
91
|
-
help='remove a package from site
|
|
91
|
+
help='remove a package from site packages'
|
|
92
92
|
)
|
|
93
93
|
|
|
94
94
|
args = parser.parse_args(sys.argv[1:])
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyscript-programming-language
|
|
3
|
-
Version: 1.13.
|
|
3
|
+
Version: 1.13.3
|
|
4
4
|
Summary: PyScript Programming Language
|
|
5
5
|
Home-page: https://azzammuhyala.github.io/pyscript
|
|
6
|
-
Author:
|
|
7
|
-
Author-email:
|
|
6
|
+
Author: AzzamMuhyala
|
|
7
|
+
Author-email: AzzamMuhyala <azzammuhyala@gmail.com>
|
|
8
8
|
License-Expression: MIT
|
|
9
9
|
Project-URL: Homepage, https://azzammuhyala.github.io/pyscript
|
|
10
10
|
Project-URL: Documentation, https://azzammuhyala.github.io/pyscript
|
|
@@ -145,7 +145,7 @@ Familiar? There it is!
|
|
|
145
145
|
- **optional**: Not required, but if it is present, some features can be used without issue.
|
|
146
146
|
|
|
147
147
|
## Highlights 🎨
|
|
148
|
-
- [PyScript plugin for Acode (Ace Editor)](https://github.com/azzammuhyala/pyscript/releases/download/v1.13.
|
|
148
|
+
- [PyScript plugin for Acode (Ace Editor)](https://github.com/azzammuhyala/pyscript/releases/download/v1.13.3/plugin-1.0.2.zip)
|
|
149
149
|
- [PyScript nano for Linux](https://github.com/azzammuhyala/pyscript/tree/main/highlight/nano)
|
|
150
150
|
- [PyScript extension for VSCode](https://marketplace.visualstudio.com/items?itemName=azzammuhyala.pyslang)
|
|
151
151
|
|
|
@@ -9,11 +9,11 @@ with open('./README.md', 'r', encoding='utf-8') as file:
|
|
|
9
9
|
|
|
10
10
|
setup(
|
|
11
11
|
name='pyscript-programming-language',
|
|
12
|
-
version='1.13.
|
|
12
|
+
version='1.13.3',
|
|
13
13
|
description='PyScript Programming Language',
|
|
14
14
|
long_description=long_description,
|
|
15
15
|
long_description_content_type='text/markdown',
|
|
16
|
-
author='
|
|
16
|
+
author='AzzamMuhyala',
|
|
17
17
|
author_email='azzammuhyala@gmail.com',
|
|
18
18
|
url='https://azzammuhyala.github.io/pyscript',
|
|
19
19
|
project_urls={
|
|
File without changes
|
{pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/__init__.py
RENAMED
|
File without changes
|
{pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/__init__.pyi
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/bases.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.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/nodes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/core/shell.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/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.13.2 → pyscript_programming_language-1.13.3}/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.13.2 → pyscript_programming_language-1.13.3}/pyscript/lib/code.pys
RENAMED
|
File without changes
|
{pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/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
|
|
File without changes
|
|
File without changes
|
{pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/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.13.2 → pyscript_programming_language-1.13.3}/pyscript/other/credits
RENAMED
|
File without changes
|
{pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/other/license
RENAMED
|
File without changes
|
|
File without changes
|
{pyscript_programming_language-1.13.2 → pyscript_programming_language-1.13.3}/pyscript/this.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|