inscript-lang 1.7.3__tar.gz → 1.7.4__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.
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/PKG-INFO +1 -1
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/environment.py +7 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/inscript.py +1 -1
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/inscript_lang.egg-info/PKG-INFO +1 -1
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/pyproject.toml +1 -1
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/repl.py +1 -1
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/README.md +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/analyzer.py +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/ast_nodes.py +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/compiler.py +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/errors.py +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/inscript_fmt.py +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/inscript_lang.egg-info/SOURCES.txt +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/inscript_lang.egg-info/dependency_links.txt +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/inscript_lang.egg-info/entry_points.txt +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/inscript_lang.egg-info/requires.txt +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/inscript_lang.egg-info/top_level.txt +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/inscript_test.py +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/interpreter.py +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/lexer.py +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/parser.py +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/pygame_backend.py +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/setup.cfg +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/setup.py +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/stdlib.py +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/stdlib_extended.py +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/stdlib_extended_2.py +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/stdlib_game.py +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/stdlib_values.py +0 -0
- {inscript_lang-1.7.3 → inscript_lang-1.7.4}/vm.py +0 -0
|
@@ -16,9 +16,16 @@ class Environment:
|
|
|
16
16
|
self.name: str = name
|
|
17
17
|
self._store: Dict[str, Any] = {}
|
|
18
18
|
self._consts: set = set() # names that cannot be reassigned
|
|
19
|
+
# v1.7.4: when True, `let` re-declarations silently re-bind (REPL mode)
|
|
20
|
+
self._repl_mode: bool = False
|
|
19
21
|
|
|
20
22
|
# ── Define ────────────────────────────────────────────────────────────────
|
|
21
23
|
def define(self, name: str, value: Any, is_const: bool = False) -> None:
|
|
24
|
+
# v1.7.4: in REPL mode, re-declaring an existing non-const `let` just
|
|
25
|
+
# re-binds it. Attempting to re-declare a const is still an error.
|
|
26
|
+
if self._repl_mode and name in self._store and name in self._consts:
|
|
27
|
+
raise InScriptRuntimeError(
|
|
28
|
+
f"Cannot re-declare constant '{name}' in REPL", 0)
|
|
22
29
|
self._store[name] = value
|
|
23
30
|
if is_const:
|
|
24
31
|
self._consts.add(name)
|
|
@@ -24,7 +24,7 @@ from errors import (InScriptError, LexerError, ParseError,
|
|
|
24
24
|
SemanticError, InScriptRuntimeError,
|
|
25
25
|
MultiError, InScriptWarning)
|
|
26
26
|
|
|
27
|
-
VERSION = "1.7.
|
|
27
|
+
VERSION = "1.7.4"
|
|
28
28
|
LANG = "InScript"
|
|
29
29
|
PACKAGES_DIR = os.path.join(os.path.expanduser("~"), ".inscript", "packages")
|
|
30
30
|
REGISTRY_URL = "https://raw.githubusercontent.com/authorss81/inscript-packages/main/registry.json"
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "inscript-lang"
|
|
7
|
-
version = "1.7.
|
|
7
|
+
version = "1.7.4"
|
|
8
8
|
description = "InScript — a game-focused scripting language with 59 game modules and a bytecode VM"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -40,7 +40,7 @@ sys.path.insert(0, str(Path(__file__).parent))
|
|
|
40
40
|
|
|
41
41
|
HISTORY_FILE = Path.home() / ".inscript" / "history"
|
|
42
42
|
HISTORY_FILE.parent.mkdir(parents=True, exist_ok=True)
|
|
43
|
-
VERSION = "1.7.
|
|
43
|
+
VERSION = "1.7.4"
|
|
44
44
|
|
|
45
45
|
# ── ANSI colours ──────────────────────────────────────────────────────────────
|
|
46
46
|
def _c(code, text):
|
|
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
|
|
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
|