sway_core/
compiler_generated.rsconst TUPLE_VAR_NAME_PREFIX: &str = "__tuple_";
pub(crate) fn generate_tuple_var_name(suffix: usize) -> String {
format!("{TUPLE_VAR_NAME_PREFIX}{suffix}")
}
pub fn is_generated_tuple_var_name(name: &str) -> bool {
name.starts_with(TUPLE_VAR_NAME_PREFIX)
}
const DESTRUCTURED_STRUCT_VAR_NAME_PREFIX: &str = "__destructured_struct_";
pub(crate) fn generate_destructured_struct_var_name(suffix: usize) -> String {
format!("{DESTRUCTURED_STRUCT_VAR_NAME_PREFIX}{suffix}")
}
pub fn is_generated_destructured_struct_var_name(name: &str) -> bool {
name.starts_with(DESTRUCTURED_STRUCT_VAR_NAME_PREFIX)
}
const MATCHED_VALUE_VAR_NAME_PREFIX: &str = "__matched_value_";
pub(crate) fn generate_matched_value_var_name(suffix: usize) -> String {
format!("{MATCHED_VALUE_VAR_NAME_PREFIX}{suffix}")
}
const MATCHED_OR_VARIANT_INDEX_VAR_NAME_PREFIX: &str = "__matched_or_variant_index_";
pub(crate) fn generate_matched_or_variant_index_var_name(suffix: usize) -> String {
format!("{MATCHED_OR_VARIANT_INDEX_VAR_NAME_PREFIX}{suffix}")
}
const MATCHED_OR_VARIANT_VARIABLES_VAR_NAME_PREFIX: &str = "__matched_or_variant_variables_";
pub(crate) fn generate_matched_or_variant_variables_var_name(suffix: usize) -> String {
format!("{MATCHED_OR_VARIANT_VARIABLES_VAR_NAME_PREFIX}{suffix}")
}
pub fn is_generated_any_match_expression_var_name(name: &str) -> bool {
name.starts_with(MATCHED_VALUE_VAR_NAME_PREFIX)
|| name.starts_with(MATCHED_OR_VARIANT_INDEX_VAR_NAME_PREFIX)
|| name.starts_with(MATCHED_OR_VARIANT_VARIABLES_VAR_NAME_PREFIX)
}
pub(crate) const INVALID_MATCHED_OR_VARIABLE_INDEX_SIGNAL: u64 = 0xcccc_cccc_cccc_0001;
pub(crate) const INVALID_DESUGARED_MATCHED_EXPRESSION_SIGNAL: u64 = 0xcccc_cccc_cccc_0002;