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//!
29//! # Deprecation
30//!
31//! The re-export of [`yash_env::semantics::command::search`] as
32//! `command_search` is now deprecated. Please use `command::search` instead.
33
34pub mod assign;
35pub mod command;
36pub mod expansion;
37pub mod job;
38pub mod redir;
39pub mod trap;
40pub mod xtrace;
41
42#[doc(no_inline)]
43pub use yash_env::semantics::command::search as command_search;
44#[doc(no_inline)]
45pub use yash_env::semantics::*;
46
47mod handle;
48pub use handle::Handle;
49
50mod runner;
51pub use runner::interactive_read_eval_loop;
52pub use runner::read_eval_loop;
53
54mod runner_legacy;
55#[allow(deprecated)]
56pub use runner_legacy::ReadEvalLoop;
57
58#[cfg(test)]
59pub(crate) mod tests;