@@ -26,7 +26,7 @@ abstract class BaseType(
26
26
val forwardDeclareList: MutableSet <String > = mutableSetOf ()
27
27
28
28
val simpleName = name.substringAfterLast(" ::" )
29
- val namespace = name.substringBeforeLast(" ::" , " ::" )
29
+ val namespace = name.substringBeforeLast(" ::" , " " ) + " ::"
30
30
val fullEscapeName = name.replace(" ::" , " _" )
31
31
val fullUpperEscapeName = fullEscapeName.uppercase(Locale .getDefault())
32
32
@@ -60,35 +60,20 @@ abstract class BaseType(
60
60
}
61
61
if (this is NamespaceType ) {
62
62
val namespaceRules = GeneratorConfig .getSortRules().namespace
63
- namespaceRules.find { this .name. startsWith(it.namespace) }
63
+ namespaceRules.find { this .name == it.namespace || this .name. startsWith(it.namespace + " :: " ) }
64
64
?.let {
65
65
return @run " $root /${it.dst} /${this .simpleName} .$HEADER_SUFFIX "
66
66
}
67
67
} else {
68
68
val namespaceRules = GeneratorConfig .getSortRules().namespace
69
- namespaceRules.find { this .namespace.startsWith(it.namespace) }
69
+ namespaceRules.find { this .namespace.startsWith(it.namespace + " :: " ) }
70
70
?.let {
71
71
return @run " $root /${it.dst} /${this .simpleName} .$HEADER_SUFFIX "
72
72
}
73
73
}
74
74
regexRules.filter { ! it.override }.find { this .name.matches(it.regex.toRegex()) }?.let {
75
75
return @run " $root /${it.dst} /${this .simpleName} .$HEADER_SUFFIX "
76
76
}
77
- if (this .isEnum()) {
78
- if (! this .name.contains(" ::" ))
79
- return @run " $root /enums/${this .simpleName} .$HEADER_SUFFIX "
80
- return @run " $root /enums/${
81
- this .name.replace(" ::" , " /" ).substringBeforeLast(" /" ).toSnakeCase()
82
- } /$simpleName .$HEADER_SUFFIX "
83
- }
84
- if (this .isUnion()) {
85
- if (! this .name.contains(" ::" ))
86
- return @run " $root /unions/${this .simpleName} .$HEADER_SUFFIX "
87
- return @run " $root /unions/${
88
- this .name.replace(" ::" , " /" ).substringBeforeLast(" /" ).toSnakeCase()
89
- } /$simpleName .$HEADER_SUFFIX "
90
- }
91
-
92
77
notSortedTypes.add(this .name)
93
78
return @run " $root /${name.replace(" ::" , " __" )} .$HEADER_SUFFIX "
94
79
}
0 commit comments