mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-17 01:26:45 +00:00
[C++] Check for case insensitive keywords (#8420)
* chore(idl): Check for case insensitive keywords Most languages are not affected by this change. In PHP, some names such as Bool cannot be used because it is a reserved keyword for to the bool data type. The field `keywords_casing` in the configs enables checking all characters in lowercase against every keyword. This should be safe as flatbuffers does not allow non-ASCII characters in its grammar. * chore: Fix formatting to follow google's coding style for enums * chore: Extract convert case to lower when CaseInsensitive --------- Co-authored-by: Justin Davis <jtdavis777@gmail.com> Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
@@ -61,6 +61,7 @@ Namer::Config LuaDefaultConfig() {
|
||||
/*object_suffix=*/"",
|
||||
/*keyword_prefix=*/"",
|
||||
/*keyword_suffix=*/"_",
|
||||
/*keywords_casing=*/Namer::Config::KeywordsCasing::CaseSensitive,
|
||||
/*filenames=*/Case::kKeep,
|
||||
/*directories=*/Case::kKeep,
|
||||
/*output_path=*/"",
|
||||
|
||||
@@ -70,6 +70,7 @@ Namer::Config NimDefaultConfig() {
|
||||
/*object_suffix=*/"T",
|
||||
/*keyword_prefix=*/"",
|
||||
/*keyword_suffix=*/"_",
|
||||
/*keywords_casing=*/Namer::Config::KeywordsCasing::CaseSensitive,
|
||||
/*filenames=*/Case::kKeep,
|
||||
/*directories=*/Case::kKeep,
|
||||
/*output_path=*/"",
|
||||
|
||||
@@ -48,6 +48,7 @@ static Namer::Config DartDefaultConfig() {
|
||||
/*object_suffix=*/"T",
|
||||
/*keyword_prefix=*/"$",
|
||||
/*keyword_suffix=*/"",
|
||||
/*keywords_casing=*/Namer::Config::KeywordsCasing::CaseSensitive,
|
||||
/*filenames=*/Case::kKeep,
|
||||
/*directories=*/Case::kKeep,
|
||||
/*output_path=*/"",
|
||||
|
||||
@@ -75,6 +75,7 @@ static Namer::Config GoDefaultConfig() {
|
||||
/*object_suffix=*/"T",
|
||||
/*keyword_prefix=*/"",
|
||||
/*keyword_suffix=*/"_",
|
||||
/*keywords_casing=*/Namer::Config::KeywordsCasing::CaseSensitive,
|
||||
/*filenames=*/Case::kKeep,
|
||||
/*directories=*/Case::kKeep,
|
||||
/*output_path=*/"",
|
||||
|
||||
@@ -46,6 +46,7 @@ static Namer::Config JavaDefaultConfig() {
|
||||
/*object_suffix=*/"T",
|
||||
/*keyword_prefix=*/"",
|
||||
/*keyword_suffix=*/"_",
|
||||
/*keywords_casing=*/Namer::Config::KeywordsCasing::CaseSensitive,
|
||||
/*filenames=*/Case::kKeep,
|
||||
/*directories=*/Case::kKeep,
|
||||
/*output_path=*/"",
|
||||
|
||||
@@ -64,6 +64,7 @@ static Namer::Config KotlinDefaultConfig() {
|
||||
/*object_suffix=*/"T",
|
||||
/*keyword_prefix=*/"",
|
||||
/*keyword_suffix=*/"_",
|
||||
/*keywords_casing=*/Namer::Config::KeywordsCasing::CaseSensitive,
|
||||
/*filenames=*/Case::kKeep,
|
||||
/*directories=*/Case::kKeep,
|
||||
/*output_path=*/"",
|
||||
|
||||
@@ -62,6 +62,7 @@ static Namer::Config KotlinDefaultConfig() {
|
||||
/*object_suffix=*/"T",
|
||||
/*keyword_prefix=*/"",
|
||||
/*keyword_suffix=*/"E",
|
||||
/*keywords_casing=*/Namer::Config::KeywordsCasing::CaseSensitive,
|
||||
/*filenames=*/Case::kUpperCamel,
|
||||
/*directories=*/Case::kLowerCamel,
|
||||
/*output_path=*/"",
|
||||
|
||||
@@ -49,6 +49,7 @@ static Namer::Config RustDefaultConfig() {
|
||||
/*object_suffix=*/"T",
|
||||
/*keyword_prefix=*/"",
|
||||
/*keyword_suffix=*/"_",
|
||||
/*keywords_casing=*/Namer::Config::KeywordsCasing::CaseSensitive,
|
||||
/*filenames=*/Case::kSnake,
|
||||
/*directories=*/Case::kSnake,
|
||||
/*output_path=*/"",
|
||||
|
||||
@@ -47,6 +47,7 @@ static Namer::Config SwiftDefaultConfig() {
|
||||
/*object_suffix=*/"T",
|
||||
/*keyword_prefix=*/"",
|
||||
/*keyword_suffix=*/"_",
|
||||
/*keywords_casing=*/Namer::Config::KeywordsCasing::CaseSensitive,
|
||||
/*filenames=*/Case::kKeep,
|
||||
/*directories=*/Case::kKeep,
|
||||
/*output_path=*/"",
|
||||
|
||||
@@ -67,6 +67,7 @@ Namer::Config TypeScriptDefaultConfig() {
|
||||
/*object_suffix=*/"T",
|
||||
/*keyword_prefix=*/"",
|
||||
/*keyword_suffix=*/"_",
|
||||
/*keywords_casing=*/Namer::Config::KeywordsCasing::CaseSensitive,
|
||||
/*filenames=*/Case::kDasher,
|
||||
/*directories=*/Case::kDasher,
|
||||
/*output_path=*/"",
|
||||
|
||||
Reference in New Issue
Block a user