use crate::rule::shape::{one_to_one, part_of};
use seesaw_tgg::rules::format::RuleFile;
const CATALOGUE_NAME: &str = "go";
pub const STRUCT_TO_STRUCT: &str = "struct-to-struct";
pub const MEMBER_TO_FIELD: &str = "member-to-field";
pub const ENUM_TO_TYPE: &str = "enum-to-type";
pub const ENUMERATOR_TO_CONST: &str = "enumerator-to-const";
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_TYPE: &str = "bitmask-to-type";
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", "GoStruct", "GoStructCorr"),
part_of(
MEMBER_TO_FIELD,
("Member", "Structure", "GoStructCorr"),
("GoField", "GoStruct", "GoFieldCorr"),
),
one_to_one(ENUM_TO_TYPE, "Enumeration", "GoEnum", "GoEnumCorr"),
part_of(
ENUMERATOR_TO_CONST,
("Enumerator", "Enumeration", "GoEnumCorr"),
("GoEnumerator", "GoEnum", "GoEnumeratorCorr"),
),
one_to_one(ALIAS_TO_ALIAS, "Alias", "GoAlias", "GoAliasCorr"),
one_to_one(UNION_TO_STRUCT, "Union", "GoUnion", "GoUnionCorr"),
part_of(
CASE_TO_FIELD,
("Case", "Union", "GoUnionCorr"),
("GoCase", "GoUnion", "GoCaseCorr"),
),
one_to_one(BITMASK_TO_TYPE, "Bitmask", "GoBitmask", "GoBitmaskCorr"),
part_of(
BIT_TO_CONST,
("BitValue", "Bitmask", "GoBitmaskCorr"),
("GoBitConst", "GoBitmask", "GoBitCorr"),
),
one_to_one(BITSET_TO_STRUCT, "Bitset", "GoBitset", "GoBitsetCorr"),
one_to_one(VALUETYPE_TO_STRUCT, "Valuetype", "GoValue", "GoValueCorr"),
one_to_one(MODULE_TO_PREFIX, "Module", "GoModule", "GoModuleCorr"),
one_to_one(CONST_TO_CONST, "Const", "GoConst", "GoConstCorr"),
one_to_one(EXCEPTION_TO_STRUCT, "Exception", "GoError", "GoErrorCorr"),
one_to_one(NATIVE_TO_ALIAS, "Native", "GoNative", "GoNativeCorr"),
one_to_one(
INTERFACE_TO_INTERFACE,
"Interface",
"GoInterface",
"GoInterfaceCorr",
),
],
}
}