mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-16 01:07:29 +00:00
ToCamelCase() when kLowerCamel now converts first char to lower. (#7838)
ToCamelCase(input, true) converts first char to upper case, but ToCamelCase(input, false) keeps the case of the first char. We are changing its behavior to force a lower case. Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
@@ -55,7 +55,7 @@ static Namer::Config KotlinDefaultConfig() {
|
||||
/*functions=*/Case::kKeep,
|
||||
/*fields=*/Case::kLowerCamel,
|
||||
/*variables=*/Case::kLowerCamel,
|
||||
/*variants=*/Case::kLowerCamel,
|
||||
/*variants=*/Case::kKeep,
|
||||
/*enum_variant_seperator=*/"", // I.e. Concatenate.
|
||||
/*escape_keywords=*/Namer::Config::Escape::BeforeConvertingCase,
|
||||
/*namespaces=*/Case::kKeep,
|
||||
@@ -301,7 +301,7 @@ class KotlinGenerator : public BaseGenerator {
|
||||
auto field_type = GenTypeBasic(enum_def.underlying_type.base_type);
|
||||
auto val = enum_def.ToString(ev);
|
||||
auto suffix = LiteralSuffix(enum_def.underlying_type.base_type);
|
||||
writer.SetValue("name", namer_.LegacyKotlinVariant(ev));
|
||||
writer.SetValue("name", namer_.Variant(ev.name));
|
||||
writer.SetValue("type", field_type);
|
||||
writer.SetValue("val", val + suffix);
|
||||
GenerateComment(ev.doc_comment, writer, &comment_config);
|
||||
|
||||
Reference in New Issue
Block a user