Skip to main content

Module ast

Module ast 

Source

Enums§

RedirectOp
The operator used in a file redirect.

Functions§

command_args
Extract command arguments from a Command node.
command_args_from_words
Extract command arguments from a word slice (all words after the name).
command_name
Extract the command name from a Command node.
command_name_from_words
Extract the command name from a word slice.
has_expansions
Check whether a node contains command or process substitutions.
has_expansions_in_slices
Check for expansions in word and redirect slices.
has_shell_expansion_pattern
Check if a string contains shell expansion patterns ($(, `, ${, or $ + identifier).
has_unsafe_file_redirect
Check if a command node has file output redirects (>, >>) to targets other than safe ones.
is_expansion_node
Returns true if the node kind is itself a shell expansion.
is_harmless_fallback
Check if a node is a harmless fallback command (for || true patterns).
is_safe_heredoc_substitution
Returns true when a node is a safe heredoc data-passing idiom: a single SIMPLE_SAFE command whose only redirects are quoted heredocs, with no word-level expansions.
is_safe_redirect_target
Check if a redirect target is inherently safe (e.g., /dev/null).
redirect_info
Extract the redirect operator and target from a Redirect node.