yash_semantics/
lib.rs

1// This file is part of yash, an extended POSIX shell.
2// Copyright (C) 2021 WATANABE Yuki
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program.  If not, see <https://www.gnu.org/licenses/>.
16
17//! Semantics of the shell language.
18//!
19//! This crate defines the standard semantics for the shell language. The core
20//! of the semantics is command execution and word expansion.
21//! A command can be executed by calling
22//! [`Command::execute`](command::Command::execute).
23//! A word can be expanded by using functions and traits defined in
24//! [`expansion`].
25//!
26//! The [`read_eval_loop`] reads, parses, and executes commands from an input.
27//! It is a utility for running a shell script.
28
29pub mod assign;
30pub mod command;
31pub mod command_search;
32pub mod expansion;
33pub mod job;
34pub mod redir;
35pub mod trap;
36pub mod xtrace;
37
38#[doc(no_inline)]
39pub use yash_env::semantics::*;
40
41mod handle;
42pub use handle::Handle;
43
44mod runner;
45pub use runner::interactive_read_eval_loop;
46pub use runner::read_eval_loop;
47
48mod runner_legacy;
49#[allow(deprecated)]
50pub use runner_legacy::ReadEvalLoop;
51
52#[cfg(test)]
53pub(crate) mod tests;