* Apply Namer to Dart.

- Also refactor idl_gen_dart a bit
  - to use more const and references
  - out parameters should be the last argument

* Add keyword test

* minor fixes

* fix merge

* extra 's'

* move dart keyord into dart dir

* Address comments

* Use $ for escaping keywords
* Outparameters for namespace_map

* Escape dollar in toString

* Escape dollar in toString2

* Use UpperCamelCase for types and variants

* try to fix ToString

* namer Type fixes

* Remove path prefixing in imports

* gen code

Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
Casper
2022-03-28 18:07:09 -04:00
committed by GitHub
parent ae4ce72651
commit a4cb1599d8
12 changed files with 600 additions and 332 deletions

View File

@@ -1416,6 +1416,8 @@ void UtilConvertCase() {
"the_quick_brown_fox" },
{ "the_quick_brown_fox", flatbuffers::Case::kKeep,
"the_quick_brown_fox" },
{ "the_quick_brown_fox", flatbuffers::Case::kSnake2,
"the_quick_brown_fox" },
// Tests for some snake_cases where the _ is oddly placed or missing.
{ "single", flatbuffers::Case::kUpperCamel, "Single" },
@@ -1468,6 +1470,12 @@ void UtilConvertCase() {
flatbuffers::Case::kSnake, "abctest" },
{ flatbuffers::Case::kUpperCamel, "tHe_qUiCk_BrOwN_fOx",
flatbuffers::Case::kKeep, "tHe_qUiCk_BrOwN_fOx" },
{ flatbuffers::Case::kLowerCamel, "theQuick12345Fox",
flatbuffers::Case::kSnake, "the_quick_12345fox" },
{ flatbuffers::Case::kLowerCamel, "a12b34c45",
flatbuffers::Case::kSnake, "a_12b_34c_45" },
{ flatbuffers::Case::kLowerCamel, "a12b34c45",
flatbuffers::Case::kSnake2, "a12_b34_c45" },
};
for (auto &test_case : cases) {