Module decl_util

Module decl_util 

Source
Expand description

Items for parsing declaration utilities

This module re-exports utilities for parsing declaration utilities from the yash-env crate. See the documentation of the yash_env::decl_util module for details.

§Parser behavior

When the parser recognizes a command name as a declaration utility, command words that follow the command name are tested for the form of variable assignments. If a word is a variable assignment, it is parsed as such: the word is split into a variable name and a value, and tilde expansions are parsed with the parse_tilde_everywhere_after method in the value part. The result word is marked with ExpansionMode::Single in SimpleCommand::words to indicate that the word is not subject to field splitting and pathname expansion. If a word is not a variable assignment, it is parsed as a normal command word with parse_tilde_front and marked with ExpansionMode::Multiple.

The shell is expected to change the expansion behavior of the words based on the ExpansionMode of the words. In yash-rs, the semantics is implemented in the yash-semantics crate.

Re-exports§

pub use yash_env::decl_util::*;