pub fn is_property_valid_for_condition(kind: &ConditionKind, prop: &str) -> bool {
    if matches!(
        prop,
        CONDITION_INJECTED_PROP
            | CONDITION_EXPORT_PROP
            | CONDITION_ABSTRACT_PROP
            | CONDITION_CONCRETE_PROP
            | CONDITION_DEACTIVATED_PROP
    ) {
        // Applicable everywhere.
        return true;
    }
    use crate::ast::ConditionKind::*;
    match kind {
        GlobalInvariant(..) | GlobalInvariantUpdate(..) => {
            matches!(
                prop,
                CONDITION_GLOBAL_PROP | CONDITION_ISOLATED_PROP | CONDITION_SUSPENDABLE_PROP
            )
        }
        SucceedsIf | AbortsIf => matches!(
            prop,
            CONDITION_ABORT_ASSERT_PROP | CONDITION_ABORT_ASSUME_PROP
        ),
        AbortsWith => matches!(prop, CONDITION_CHECK_ABORT_CODES_PROP),
        _ => {
            // every other condition can only take general properties
            false
        }
    }
}
/// A function which determines whether a property is valid for a given condition kind.
A function which determines whether a property is valid for a given condition kind.
A function which determines whether a property is valid for a given condition kind .
pub fn is_property_valid_for_condition(kind: &ConditionKind, prop: &str) -> bool {
    if matches!(
        prop,
        CONDITION_INJECTED_PROP
            | CONDITION_EXPORT_PROP
            | CONDITION_ABSTRACT_PROP
            | CONDITION_CONCRETE_PROP
            | CONDITION_DEACTIVATED_PROP
    ) {
        // Applicable everywhere.
        return true;
    }
    use crate::ast::ConditionKind::*;
    match kind {
        GlobalInvariant(..) | GlobalInvariantUpdate(..) => {
            matches!(
                prop,
                CONDITION_GLOBAL_PROP | CONDITION_ISOLATED_PROP | CONDITION_SUSPENDABLE_PROP
            )
        }
        SucceedsIf | AbortsIf => matches!(
            prop,
            CONDITION_ABORT_ASSERT_PROP | CONDITION_ABORT_ASSUME_PROP
        ),
        AbortsWith => matches!(prop, CONDITION_CHECK_ABORT_CODES_PROP),
        _ => {
            // every other condition can only take general properties
            false
        }
    }
}
pub fn is_property_valid_for_condition ( kind : & ConditionKind , prop : & str ) -> bool { if matches ! ( prop CONDITION_INJECTED_PROP CONDITION_EXPORT_PROP CONDITION_ABSTRACT_PROP CONDITION_CONCRETE_PROP CONDITION_DEACTIVATED_PROP ) { // Applicable everywhere. return true ; } use crate :: ast :: ConditionKind :: * ; match kind { GlobalInvariant ( .. ) | GlobalInvariantUpdate ( .. ) => { matches ! ( prop CONDITION_GLOBAL_PROP CONDITION_ISOLATED_PROP CONDITION_SUSPENDABLE_PROP ) } SucceedsIf | AbortsIf => matches ! ( prop CONDITION_ABORT_ASSERT_PROP CONDITION_ABORT_ASSUME_PROP ) , AbortsWith => matches ! ( prop CONDITION_CHECK_ABORT_CODES_PROP ) , _ => { // every other condition can only take general properties false } } }
A function which determines whether a property is valid for a given condition kind.
A function which determines whether a property is valid for a given condition kind .
kind
&ConditionKind
prop
&str