forked from BigfootDev/flatbuffers
Compare commits
2 Commits
push-qpplq
...
push-lmlon
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
166f25f82b | ||
|
|
d74e2945f7 |
5
.github/workflows/build.yml
vendored
5
.github/workflows/build.yml
vendored
@@ -592,11 +592,16 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
# Explicitly use 8.5.1 until we can update or https://github.com/actions/runner-images/issues/13564 is fixed.
|
||||
- name: Set env
|
||||
run: >
|
||||
echo "USE_BAZEL_VERSION=8.5.1" >> $GITHUB_ENV
|
||||
- name: bazel build
|
||||
run: >
|
||||
bazel build
|
||||
//:flatc
|
||||
//:flatbuffers
|
||||
//tests:flatbuffers_test
|
||||
- name: bazel test
|
||||
run: >
|
||||
bazel test
|
||||
|
||||
@@ -7,7 +7,7 @@ module(
|
||||
|
||||
bazel_dep(
|
||||
name = "aspect_bazel_lib",
|
||||
version = "2.11.0",
|
||||
version = "2.14.0",
|
||||
)
|
||||
bazel_dep(
|
||||
name = "aspect_rules_esbuild",
|
||||
@@ -28,11 +28,11 @@ bazel_dep(
|
||||
)
|
||||
bazel_dep(
|
||||
name = "platforms",
|
||||
version = "0.0.10",
|
||||
version = "0.0.11",
|
||||
)
|
||||
bazel_dep(
|
||||
name = "rules_cc",
|
||||
version = "0.0.16",
|
||||
version = "0.1.1",
|
||||
)
|
||||
bazel_dep(
|
||||
name = "rules_go",
|
||||
|
||||
@@ -91,6 +91,14 @@ class Namer {
|
||||
std::string keyword_prefix;
|
||||
// Suffix used to escape keywords. It is usually "_".
|
||||
std::string keyword_suffix;
|
||||
// The casing used for keywords when escaping. For most languages, keywords
|
||||
// are case sensitive. PHP is an instance where some keywords are case
|
||||
// insensitive.
|
||||
enum class KeywordsCasing {
|
||||
CaseSensitive,
|
||||
CaseInsensitive,
|
||||
};
|
||||
KeywordsCasing keywords_casing;
|
||||
|
||||
// Files.
|
||||
|
||||
@@ -204,8 +212,16 @@ class Namer {
|
||||
return result;
|
||||
}
|
||||
|
||||
virtual std::string NormalizeKeywordCase(const std::string& name) const {
|
||||
if (config_.keywords_casing == Config::KeywordsCasing::CaseInsensitive) {
|
||||
return ConvertCase(name, Case::kAllLower);
|
||||
} else {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
virtual std::string EscapeKeyword(const std::string& name) const {
|
||||
if (keywords_.find(name) == keywords_.end()) {
|
||||
if (keywords_.find(NormalizeKeywordCase(name)) == keywords_.end()) {
|
||||
return name;
|
||||
} else {
|
||||
return config_.keyword_prefix + name + config_.keyword_suffix;
|
||||
|
||||
@@ -26,6 +26,7 @@ static const Namer::Config kConfig = {
|
||||
/*object_suffix=*/"T",
|
||||
/*keyword_prefix=*/"",
|
||||
/*keyword_suffix=*/"_",
|
||||
/*keywords_casing=*/Namer::Config::KeywordsCasing::CaseSensitive,
|
||||
/*filenames=*/Case::kKeep,
|
||||
/*directories=*/Case::kKeep,
|
||||
/*output_path=*/"",
|
||||
@@ -49,6 +50,7 @@ static const Namer::Config kStubConfig = {
|
||||
/*object_suffix=*/"T",
|
||||
/*keyword_prefix=*/"",
|
||||
/*keyword_suffix=*/"_",
|
||||
/*keywords_casing=*/Namer::Config::KeywordsCasing::CaseSensitive,
|
||||
/*filenames=*/Case::kKeep,
|
||||
/*directories=*/Case::kKeep,
|
||||
/*output_path=*/"",
|
||||
|
||||
@@ -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