vimlrs/lib.rs
1//! vimlrs — a faithful Rust port of the Vimscript (VimL) interpreter, compiled
2//! to [`fusevm`] bytecode and run on its VM + Cranelift JIT.
3//!
4//! VimL is the **4th language frontend** on fusevm, after zshrs (zsh),
5//! strykelang (stryke), and awkrs (awk). Like zshrs, it has **no local VM and
6//! no local JIT**: source is lexed and parsed into an AST, lowered to fusevm
7//! bytecode, and executed by fusevm.
8//!
9//! ## Two-zone layout (the zshrs porting discipline)
10//!
11//! - [`ported`] — strict 1:1 ports of the Neovim eval C source under `vendor/`.
12//! Exact C names, `// c:NNN` citations, no invented helpers/structs. See
13//! `docs/PORT.md`.
14//! - **Crate-root carve-outs** — net-new synthesis with no C counterpart
15//! (Neovim's eval is a string-walking interpreter with no AST/bytecode):
16//! [`viml_lexer`], [`viml_ast`], [`viml_parser`], [`compile_viml`],
17//! [`fusevm_bridge`]. These mirror zshrs's `compile_zsh.rs`/`fusevm_bridge.rs`
18//! carve-outs and are clearly headed "EXTENSION — NO vendor/ counterpart".
19
20// The `ported` zone keeps Vim's exact C identifiers (e.g. `ufunc_T`,
21// `except_type_T`, `VAR_FLAVOUR_*`) for 1:1 fidelity, so the non-camel-case
22// lint is intentionally disabled crate-wide.
23#![allow(non_camel_case_types)]
24
25pub mod ported;
26
27// Synthesis carve-outs (no `vendor/` counterpart).
28pub mod aot;
29pub mod banner;
30pub mod builtin_docs;
31pub mod cli;
32pub mod compile_viml;
33pub mod dap;
34pub mod fusevm_bridge;
35pub mod fusevm_disasm;
36pub mod lsp;
37pub mod repl;
38pub mod script_cache;
39pub mod viml_ast;
40pub mod viml_lexer;
41pub mod viml_parser;
42pub mod viml_regex;
43
44pub use fusevm_bridge::{eval_expr, eval_source};
45pub use ported::eval::typval_defs_h::typval_T;