From 07e9fe4651975b86dbe9404803ceca655b8b8f26 Mon Sep 17 00:00:00 2001 From: Luxferre Date: Tue, 7 Jul 2026 08:27:15 +0300 Subject: [PATCH] =?UTF-8?q?v0.3.3:=20is=20lib=20word,=20UTF=E2=80=938=20st?= =?UTF-8?q?ring=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- clyx-go/clyx.go | 16 ---------------- clyx-python/clyx/clyx.py | 4 +--- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/clyx-go/clyx.go b/clyx-go/clyx.go index 5922035..c5af879 100644 --- a/clyx-go/clyx.go +++ b/clyx-go/clyx.go @@ -533,19 +533,3 @@ func NewClyx(libfname string, libCode string) *Clyx { } return c } - -func RunFile(filePath string, libCode string) { - content, err := os.ReadFile(filePath) - if err != nil { - fmt.Fprintf(os.Stderr, "Error executing %s: %v\n", filePath, err) - os.Exit(1) - } - defer func() { - if r := recover(); r != nil { fmt.Fprintf(os.Stderr, "Error executing %s: %v\n", filePath, r); os.Exit(1) } - }() - c := NewClyx("", libCode) - c.Run(string(content)) - if c.HasWord("_main") { - c.Run("_main") - } -} diff --git a/clyx-python/clyx/clyx.py b/clyx-python/clyx/clyx.py index 024b1d5..ea6168d 100755 --- a/clyx-python/clyx/clyx.py +++ b/clyx-python/clyx/clyx.py @@ -19,12 +19,10 @@ replpath = _fpath(f'{scriptdir}/clyx_repl.clx', f'{scriptdir}/../../clyx_repl.cl class Sock: def __init__(self, s): self.s = s - def write(self, d): - data = d.encode('utf-8') if isinstance(d, str) else d - return self.s.write(data) if hasattr(self.s, 'write') else self.send(data) def send(self, d): data = d.encode('utf-8') if isinstance(d, str) else d return self.s.send(data) if hasattr(self.s, 'send') else getattr(self.s, 'write', lambda *a: 0)(data) + def write(self, d): return self.send(d) def recv(self, n): b = bytearray(n); return bytes(b[:self.s.recv_into(b)]) if hasattr(self.s, 'recv_into') else getattr(self.s, 'read', lambda *a: b'')(n) def readline(self):