From 0378cb149566e795ede08f77ec4619f2b6305573 Mon Sep 17 00:00:00 2001 From: chenxinquan Date: Thu, 17 Nov 2022 17:52:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ExplorerSystem=E7=9A=84?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E4=BA=A4=E4=BA=92=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/genmai/ExplorerSystem.go | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/genmai/ExplorerSystem.go b/src/genmai/ExplorerSystem.go index 70f065b..80b6057 100644 --- a/src/genmai/ExplorerSystem.go +++ b/src/genmai/ExplorerSystem.go @@ -37,6 +37,13 @@ import ( // // go 有点拉 sandbox "main/genmai/Sandbox" + + // TODO: + // 应该写成相对路径,因为genmai应该是编译成库,所以包路径不 + // 是以main开头。 + // + // go 有点拉 + inter "main/genmai/Interpreter" ) type ExplorerConfigSystem struct { @@ -95,6 +102,45 @@ func (ek *ExplorerSystem)startWithPath(execpath string, args ...string) error { return rc } // if (nil != ... + for _, itr := range config.SiteRequests.Implement.Inter { + icmd := itr[ : inter.INTERPRETER_CMD_LEN] + icmd_len := len(icmd) + + switch (icmd) { + case inter.INTERPRETER_CMD_SEND: + interio.Send(itr[ icmd_len : ] + "\n") + + case inter.INTERPRETER_CMD_RECV: + // TODO + //out, rc_t := interio.Recv( icmd_len ) + interio.Recv( len(itr[ icmd_len :]) ) + + case inter.INTERPRETER_CMD_RECVUNTIL: + interio.RecvUntil( itr[ icmd_len : ] ) + + //case ">.": + // A_DEBUG_INFO(">.") + // + //case "