1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! # epsh — Embeddable POSIX Shell
//!
//! A non-interactive POSIX shell designed for embedding in Rust coding agents.
//! Executes scripts and commands in-process with full control over working
//! directory, output capture, cancellation, and timeouts.
//!
//! ## Quick start
//!
//! ```no_run
//! use epsh::eval::Shell;
//!
//! let mut shell = Shell::new();
//! let exit_code = shell.run_script("echo hello world");
//! ```
//!
//! ## Builder pattern
//!
//! ```no_run
//! use epsh::eval::Shell;
//! use std::sync::{Arc, Mutex};
//! use std::path::PathBuf;
//! use std::time::Duration;
//!
//! let stdout = Arc::new(Mutex::new(Vec::<u8>::new()));
//! let mut shell = Shell::builder()
//! .cwd(PathBuf::from("/project"))
//! .errexit(true)
//! .stdout_sink(stdout.clone())
//! .timeout(Duration::from_secs(120))
//! .build();
//! ```
/// Arithmetic expression evaluator for `$((expr))`.
/// AST types: [`ast::Command`], [`ast::Word`], [`ast::WordPart`], etc.
/// Shell builtins and [`builtins::BUILTIN_NAMES`].
/// Byte-preserving encoding for non-UTF-8 shell data.
/// Error types: [`error::ShellError`], [`error::ExitStatus`].
/// Shell interpreter: [`eval::Shell`], [`eval::ShellBuilder`].
/// Word expansion: tilde, parameter, arithmetic, field splitting, globbing.
/// Glob pattern matching and pathname expansion.
/// Lexer/tokenizer.
/// Recursive-descent parser producing [`ast::Program`].
/// Byte-preserving shell runtime values and OS/libc conversion helpers.
pub
pub
/// Variable storage with scope stack.