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
61
62
63
64
//! Control-flow modeling for the semantic command stream.
//!
//! The semantic builder first records shell syntax into a compact command stream, then this
//! module turns that stream into a control-flow graph (CFG). A command such as:
//!
//! ```sh
//! if prepare; then
//! deploy
//! else
//! rollback
//! fi
//! notify
//! ```
//!
//! becomes blocks for the condition and each branch, with `ConditionalTrue` and
//! `ConditionalFalse` edges from the condition and sequential edges from whichever branch can
//! continue into `notify`. The graph keeps shell-specific shape instead of pretending the script
//! is a simple list of statements: loops add back-edges for `continue`, `break` edges leave the
//! active loop, and `case` arms model fallthrough terminators separately from normal exits.
//!
//! Nested execution regions are represented too. For example, in:
//!
//! ```sh
//! echo "$(date)" | while read line; do
//! printf '%s\n' "$line"
//! done
//! ```
//!
//! the command substitution and pipeline segment bodies are attached as isolated regions. That
//! lets later analyses ask whether a reference occurs in the top-level flow, a function body, a
//! subshell-like context, or another nested region without having to re-walk the AST.
//!
//! The split here mirrors that pipeline:
//!
//! - `recorded` owns the compact command IR emitted by semantic traversal.
//! - `termination` reasons about function calls that always terminate script execution.
//! - `builder` constructs blocks and edges from recorded commands.
//! - `graph` exposes the finished CFG surface consumed by reachability and dataflow.
pub use build_control_flow_graph;
pub use ;
pub use ;
pub use ;
pub use ;
pub use recorded_command_span_for_call_site;