small update

This commit is contained in:
IgorCielniak
2025-12-21 13:41:34 +01:00
parent bfbbebf034
commit 852c55a768
2 changed files with 13 additions and 1 deletions

View File

@@ -2543,9 +2543,16 @@ class Compiler:
except FileNotFoundError as exc:
raise ParseError(f"cannot import {path}: {exc}") from exc
lines: List[str] = []
in_py_block = False
for idx, line in enumerate(contents.splitlines()):
stripped = line.strip()
if stripped.startswith("import "):
# Detect :py block start/end
if stripped.startswith(":py") and "{" in stripped:
in_py_block = True
if in_py_block and "}" in stripped:
in_py_block = False
# Only process import as file import if not in :py block
if not in_py_block and stripped.startswith("import "):
target = stripped.split(None, 1)[1].strip()
if not target:
raise ParseError(f"empty import target in {path}:{idx + 1}")

View File

@@ -1,3 +1,8 @@
:asm int3 {
int3
}
;
# : c@ ( addr -- byte )
:asm c@ {
mov rax, [r12]