ed1b5bae7a
The `VirtualId` enum was imported but not used in the `macros.rs` file. This commit removes the unused import to clean up the code. Fix Zero Width Space handling in lexer The lexer incorrectly handled the Zero Width Space character (U+200B) when it appeared inside identifiers. This commit corrects the lexer to ignore this character in such contexts, ensuring that identifiers containing it are parsed correctly. Add REPL functionality to MCP server This commit introduces a REPL (Read-Eval-Print Loop) mode to the MCP server, allowing for interactive evaluation of Myc code with persistent state between calls. Key additions: - `REPL_ENV`: A thread-local static variable to hold the persistent `Environment` for the REPL session. It's necessary because `Environment` uses `Rc<RefCell<_>>` internally and is not `Send`/`Sync`, but the `rmcp` server requires its handler to be `Send + Sync`. This is safe as the underlying Tokio runtime is single-threaded. - `repl_eval`: A new tool that evaluates a given code string within the persistent REPL environment. Bindings (variables, functions, macros) are preserved across invocations. - `repl_reset`: A tool to reset the REPL session, clearing all accumulated bindings and starting with a fresh environment. - The main tool description in `mcp_server.rs` is updated to mention the new REPL functionalities.