use crate::rule::shape::{one_to_one, part_of};
use seesaw_tgg::rules::format::RuleFile;
const CATALOGUE_NAME: &str = "d";
pub const STRUCT_TO_STRUCT: &str = "struct-to-struct";
pub const MEMBER_TO_FIELD: &str = "member-to-field";
pub const ENUM_TO_ENUM: &str = "enum-to-enum";
pub const ENUMERATOR_TO_MEMBER: &str = "enumerator-to-member";
pub const ALIAS_TO_ALIAS: &str = "alias-to-alias";
pub const UNION_TO_STRUCT: &str = "union-to-struct";
pub const CASE_TO_FIELD: &str = "case-to-field";
pub const BITMASK_TO_ALIAS: &str = "bitmask-to-alias";
pub const BIT_TO_CONST: &str = "bit-to-const";
pub const BITSET_TO_STRUCT: &str = "bitset-to-struct";
pub const VALUETYPE_TO_STRUCT: &str = "valuetype-to-struct";
pub const MODULE_TO_PREFIX: &str = "module-to-prefix";
pub const CONST_TO_CONST: &str = "const-to-const";
pub const EXCEPTION_TO_STRUCT: &str = "exception-to-struct";
pub const NATIVE_TO_ALIAS: &str = "native-to-alias";
pub const INTERFACE_TO_INTERFACE: &str = "interface-to-interface";
#[must_use]
pub fn catalogue() -> RuleFile {
RuleFile {
format: 3,
name: CATALOGUE_NAME.to_string(),
rules: vec![
one_to_one(STRUCT_TO_STRUCT, "Structure", "DStruct", "DStructCorr"),
part_of(
MEMBER_TO_FIELD,
("Member", "Structure", "DStructCorr"),
("DField", "DStruct", "DFieldCorr"),
),
one_to_one(ENUM_TO_ENUM, "Enumeration", "DEnum", "DEnumCorr"),
part_of(
ENUMERATOR_TO_MEMBER,
("Enumerator", "Enumeration", "DEnumCorr"),
("DEnumMember", "DEnum", "DEnumMemberCorr"),
),
one_to_one(ALIAS_TO_ALIAS, "Alias", "DAlias", "DAliasCorr"),
one_to_one(UNION_TO_STRUCT, "Union", "DUnion", "DUnionCorr"),
part_of(
CASE_TO_FIELD,
("Case", "Union", "DUnionCorr"),
("DCase", "DUnion", "DCaseCorr"),
),
one_to_one(BITMASK_TO_ALIAS, "Bitmask", "DBitmask", "DBitmaskCorr"),
part_of(
BIT_TO_CONST,
("BitValue", "Bitmask", "DBitmaskCorr"),
("DBitConst", "DBitmask", "DBitCorr"),
),
one_to_one(BITSET_TO_STRUCT, "Bitset", "DBitset", "DBitsetCorr"),
one_to_one(VALUETYPE_TO_STRUCT, "Valuetype", "DValue", "DValueCorr"),
one_to_one(MODULE_TO_PREFIX, "Module", "DModule", "DModuleCorr"),
one_to_one(CONST_TO_CONST, "Const", "DConst", "DConstCorr"),
one_to_one(EXCEPTION_TO_STRUCT, "Exception", "DError", "DErrorCorr"),
one_to_one(NATIVE_TO_ALIAS, "Native", "DNative", "DNativeCorr"),
one_to_one(
INTERFACE_TO_INTERFACE,
"Interface",
"DInterface",
"DInterfaceCorr",
),
],
}
}