Enum conch_parser::ast::builder::ParameterSubstitutionKind [] [src]

pub enum ParameterSubstitutionKind<W, C> {
    Command(CommandGroup<C>),
    Len(DefaultParameter),
    Arith(Option<DefaultArithmetic>),
    Default(boolDefaultParameterOption<W>),
    Assign(boolDefaultParameterOption<W>),
    Error(boolDefaultParameterOption<W>),
    Alternative(boolDefaultParameterOption<W>),
    RemoveSmallestSuffix(DefaultParameterOption<W>),
    RemoveLargestSuffix(DefaultParameterOption<W>),
    RemoveSmallestPrefix(DefaultParameterOption<W>),
    RemoveLargestPrefix(DefaultParameterOption<W>),
}

Represents the type of parameter that was parsed

Variants

Returns the standard output of running a command, e.g. $(cmd)

Returns the length of the value of a parameter, e.g. ${#param}

Returns the resulting value of an arithmetic subsitution, e.g. $(( x++ ))

Use a provided value if the parameter is null or unset, e.g. ${param:-[word]}. The boolean indicates the presence of a :, and that if the parameter has a null value, that situation should be treated as if the parameter is unset.

Assign a provided value to the parameter if it is null or unset, e.g. ${param:=[word]}. The boolean indicates the presence of a :, and that if the parameter has a null value, that situation should be treated as if the parameter is unset.

If the parameter is null or unset, an error should result with the provided message, e.g. ${param:?[word]}. The boolean indicates the presence of a :, and that if the parameter has a null value, that situation should be treated as if the parameter is unset.

If the parameter is NOT null or unset, a provided word will be used, e.g. ${param:+[word]}. The boolean indicates the presence of a :, and that if the parameter has a null value, that situation should be treated as if the parameter is unset.

Remove smallest suffix pattern, e.g. ${param%pattern}

Remove largest suffix pattern, e.g. ${param%%pattern}

Remove smallest prefix pattern, e.g. ${param#pattern}

Remove largest prefix pattern, e.g. ${param##pattern}

Trait Implementations

impl<W: Debug, C: Debug> Debug for ParameterSubstitutionKind<W, C>
[src]

Formats the value using the given formatter.

impl<W: PartialEq, C: PartialEq> PartialEq for ParameterSubstitutionKind<W, C>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<W: Eq, C: Eq> Eq for ParameterSubstitutionKind<W, C>
[src]

impl<W: Clone, C: Clone> Clone for ParameterSubstitutionKind<W, C>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more