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
//! cmd.exe / batch AST parsing entry point.
//!
//! Mirrors the bash parser's approach: node-type whitelist traversal,
//! fail-closed for unknown structures.
//!
//! Port note: the `tree-sitter-batch` grammar dependency was stripped during
//! the port (pwsh/batch grammars are deferred to Phase 3 per the workspace
//! dependency plan). Without the grammar, batch commands cannot be
//! AST-analyzed, so [`parse_cmd`] fails closed with
//! [`ParseResult::ParseUnavailable`] and the parse-unavailable fallback decides
//! (regex match → Dangerous, clean → RequiresApproval). The function
//! signature is kept so callers (parse dispatch + fuzz baseline) keep
//! compiling unchanged.
use ParseResult;
/// Parse a cmd.exe/batch command for security analysis.
///
/// Always returns [`ParseResult::ParseUnavailable`] in this port because the
/// tree-sitter-batch grammar is not available (Phase 3). Fail-closed: the
/// decision path treats an unavailable AST + clean regex as
/// RequiresApproval, never Safe.