use crate::rule::shape::{one_to_one, part_of};
use seesaw_tgg::rules::format::RuleFile;
const CATALOGUE_NAME: &str = "kotlin";
pub const STRUCT_TO_CLASS: &str = "struct-to-class";
pub const MEMBER_TO_PROPERTY: &str = "member-to-property";
pub const ENUM_TO_OBJECT: &str = "enum-to-object";
pub const ENUMERATOR_TO_CONSTANT: &str = "enumerator-to-constant";
pub const ALIAS_TO_ALIAS: &str = "alias-to-alias";
pub const UNION_TO_CLASS: &str = "union-to-class";
pub const CASE_TO_PROPERTY: &str = "case-to-property";
pub const BITMASK_TO_ALIAS: &str = "bitmask-to-alias";
pub const BIT_TO_CONST: &str = "bit-to-const";
pub const BITSET_TO_CLASS: &str = "bitset-to-class";
pub const VALUETYPE_TO_CLASS: &str = "valuetype-to-class";
pub const MODULE_TO_PREFIX: &str = "module-to-prefix";
pub const CONST_TO_CONST: &str = "const-to-const";
pub const EXCEPTION_TO_CLASS: &str = "exception-to-class";
pub const NATIVE_TO_ALIAS: &str = "native-to-alias";
pub const INTERFACE_TO_CLASS: &str = "interface-to-class";
#[must_use]
pub fn catalogue() -> RuleFile {
RuleFile {
format: 3,
name: CATALOGUE_NAME.to_string(),
rules: vec![
one_to_one(
STRUCT_TO_CLASS,
"Structure",
"KotlinStruct",
"KotlinStructCorr",
),
part_of(
MEMBER_TO_PROPERTY,
("Member", "Structure", "KotlinStructCorr"),
("KotlinProperty", "KotlinStruct", "KotlinPropertyCorr"),
),
one_to_one(
ENUM_TO_OBJECT,
"Enumeration",
"KotlinEnum",
"KotlinEnumCorr",
),
part_of(
ENUMERATOR_TO_CONSTANT,
("Enumerator", "Enumeration", "KotlinEnumCorr"),
("KotlinConstant", "KotlinEnum", "KotlinConstantCorr"),
),
one_to_one(ALIAS_TO_ALIAS, "Alias", "KotlinAlias", "KotlinAliasCorr"),
one_to_one(UNION_TO_CLASS, "Union", "KotlinUnion", "KotlinUnionCorr"),
part_of(
CASE_TO_PROPERTY,
("Case", "Union", "KotlinUnionCorr"),
("KotlinCase", "KotlinUnion", "KotlinCaseCorr"),
),
one_to_one(
BITMASK_TO_ALIAS,
"Bitmask",
"KotlinBitmask",
"KotlinBitmaskCorr",
),
part_of(
BIT_TO_CONST,
("BitValue", "Bitmask", "KotlinBitmaskCorr"),
("KotlinBitConst", "KotlinBitmask", "KotlinBitCorr"),
),
one_to_one(
BITSET_TO_CLASS,
"Bitset",
"KotlinBitset",
"KotlinBitsetCorr",
),
one_to_one(
VALUETYPE_TO_CLASS,
"Valuetype",
"KotlinValue",
"KotlinValueCorr",
),
one_to_one(
MODULE_TO_PREFIX,
"Module",
"KotlinModule",
"KotlinModuleCorr",
),
one_to_one(CONST_TO_CONST, "Const", "KotlinConst", "KotlinConstCorr"),
one_to_one(
EXCEPTION_TO_CLASS,
"Exception",
"KotlinError",
"KotlinErrorCorr",
),
one_to_one(
NATIVE_TO_ALIAS,
"Native",
"KotlinNative",
"KotlinNativeCorr",
),
one_to_one(
INTERFACE_TO_CLASS,
"Interface",
"KotlinInterface",
"KotlinInterfaceCorr",
),
],
}
}