* Fix go generator undefined Package, also throw exception in specific examples.
* Add test for go generator import problem
* Add new version of generated go file. Fix conflict.
* Add executable permission to generate_code.py script.
* Improve test quality, remove unwanted generated files, better naming
* Fix comments
* clang format
Co-authored-by: Derek Bailey <derekbailey@google.com>
* Fix import problem in dart generated files. (fixes#7609).
* Fix naming.
* Fix minor changes in generated files.
* Add some tests. Fix minor problems.
* Fix minor format problem plus import alias issue.
* Minor fix in dart code generator, remove java from examples
* remove java and go generated files
* Fix dart tests.
* Fix spell problem.
* Remove excessive tests :))
Co-authored-by: Derek Bailey <derekbailey@google.com>
* feat: Fixed the issue with nested unions relying on InitFromBuf.
Problem: Issue #7569
Nested Unions were broken with the introduction of parsing buffers with an initial encoding offset.
Fix:
Revert the InitFromBuf method to the previous version and introduction of InitFromPackedBuf that allows
users to read types from packed buffers applying the offset automatically.
Test:
Added in TestNestedUnionTables to test the encoding and decoding ability using a nested table with a
union field.
* fix: Uncommented generate code command
* Bfbs Nim Generator
* Remove commented out tests
* add missing line to idl.h
* Commit python reflection changes
* Commit python reflection changes and move tests
* Remove default string addition
* Move tests to python file
* Fix element size check when element is table
* remove whitespace changes
* add element_type docs and commit further to namer and remove kkeep
* Bfbs Nim Generator
* Remove commented out tests
* add missing line to idl.h
* Commit python reflection changes
* Commit python reflection changes and move tests
* Remove default string addition
* Move tests to python file
* Fix element size check when element is table
* remove whitespace changes
* add element_type docs and commit further to namer and remove kkeep
* remove unused variables
* added tests to ci
* added tests to ci
* fixes
* Added reflection type Field, Variable to namer
* Moved reflection namer impl to bfbsnamer
* Remove whitespace at end of line
* Added nim to generated code
* Revert whitespace removal
Co-authored-by: Derek Bailey <derekbailey@google.com>
* grpc/compiler: Respect filename suffix and extension during code generation
grpc compiler is not respecting filename suffix and extension passed to
flatc CLI. This causes compiler to spit out incorrect code, which then
cannot be compiled without modification.
Following patch fixes the problem.
Note, I ended up removing some code introduced #6954 ("Have grpc include
file with correct filename-suffix given to flatc") in favour of keeping
sanity of the generator code.
Signed-off-by: Aman Priyadarshi <aman.eureka@gmail.com>
* tests: Add filename-suffix and filename-ext test files
* Test 1: Filename extension changed to "hpp".
* Test 2: Filename suffix changed to "_suffix".
* Test 3: Filename extension changed to "hpp" and suffix changed to "_suffix"
Signed-off-by: Aman Priyadarshi <aman.eureka@gmail.com>
* grpc/compiler: Respect filename suffix and extension during code generation
grpc compiler is not respecting filename suffix and extension passed to
flatc CLI. This causes compiler to spit out incorrect code, which then
cannot be compiled without modification.
Following patch fixes the problem.
Note, I ended up removing some code introduced #6954 ("Have grpc include
file with correct filename-suffix given to flatc") in favour of keeping
sanity of the generator code.
Signed-off-by: Aman Priyadarshi <aman.eureka@gmail.com>
* tests: Add filename-suffix and filename-ext test files
* Test 1: Filename extension changed to "hpp".
* Test 2: Filename suffix changed to "_suffix".
* Test 3: Filename extension changed to "hpp" and suffix changed to "_suffix"
Signed-off-by: Aman Priyadarshi <aman.eureka@gmail.com>
* Implement optional scalars for Python
* Use == for integer comparison, remove empty line
* Fix optional type hint
Co-authored-by: Caleb Zulawski <caleb.zulawski@caci.com>
* [Java] Fix key lookup returning null clashing with default value
A field with key attribute must always be written on the message so it
can be looked up by key. There is a edge case where inserting a key
field with same value as default would prevent it to be written on
the message and later cannot be found when searched by key.
* [Kotlin] Fix key lookup returning null clashing with default value
A field with key attribute must always be written on the message so it
can be looked up by key. There is a edge case where inserting a key
field with same value as default would prevent it to be written on
the message and later cannot be found when searched by key.
Co-authored-by: Derek Bailey <derekbailey@google.com>
A field with key attribute must always be written on the message so it
can be looked up by key. There is a edge case where inserting a key
field with same value as default would prevent it to be written on
the message and later cannot be found when searched by key.
* Adds implementation flag for swift
Forces internal flag when using @_implementationOnly in swift
Fixes access type for verifier functions & encoder functions
Updates generated code
* Addresses PR comments & adds a code gen dir within the swift tests
* Adds test case for no-include
* Fixes code gen script
Removes prefix
* Fix C/C++ Create<Type>Direct with sorted vectors
If a struct has a key the vector has to be sorted. To sort the vector
you can't use "const".
* Changes due to code review
* Improve code readability
* Add generate of JSON schema to string to lib
* option indent_step is supported
* Remove unused variables
* Fix break in test
* Fix style to be consistent with rest of the code
* [TS] Fix reserved words as arguments (#6955)
* [TS] Fix generation of reserved words in object api (#7106)
* [TS] Fix generation of object api
* [TS] Fix MakeCamel -> ConvertCase
* [C#] Fix collision of field name and type name
* [TS] Add test for struct of struct of struct
* Update generated files
* Add missing files
* [TS] Fix query of null/undefined fields in object api
* Add example for type field name collision
* 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>
* Change Rust generated file defaults
After #6731, flatc changed its default behavior
for generating rust code to fix some importing issues.
This was a breaking change which invlidated the patch release,
`flatc 2.0.5` (#7081). This PR reverses the default so we can
release a patch update. However, does break Rust users who work at
HEAD.
* Bump flatc patch version (2.0.6)
Co-authored-by: Casper Neo <cneo@google.com>
We already have the reflection.fbs file and the flatbuffers
python language support.
Adding this feature would give the python developers the
ability to parse the flatbuffers schema and write some tools.
Co-authored-by: Derek Bailey <derekbailey@google.com>
* fix for rust build
* Rust: Implement Serialize on generated types
For debugging convenience it is really handy to be able to dump out
types as another format (ie: json). For example, if we are logging a
type to a structured logging system, or even printing it out in a
structured way to the console.
Right now we handle this by shelling out to `flatc` which is not ideal;
by implementing Serialize on the generated types we can use any of the
Serializer-implementing packages for our structured debug output.
* clang-format
* Make the flatbuffers Rust crate only have an optional dependency on the `serde` packages.
* fix warning
* fix rust test build
* Oh yeah this needs to be initialized
* fix toml syntax
* code review feedback
* rebuild test data
* Emit include for bfbs-gen-embed
* Use python3 explicitly
* bump min python version to 3.6
* Sort find_package for python
* try casting Path to string
* cast WindowsPath to string to please CI
* stringify the wrong thing
* another stringify path
* Enable --gen-onefile in Python
Made it possible to generate all python code in one file. Modified
py_test.py so that it can switch between the multi-file code and
the one-file code.
Updated PythonTest.sh and py_test.py so that the multi-file code
and the one-file code can be tested based on the same test code.
* Sync with google/flatbuffers
* Add --gen-onefile to generate_code.py
* initial hack to get new Lua generator into flatc
* Starting to output enum defs for Lua
* Continue to work on table generation for Lua
* Finished basic getter access for Lua
* Added ability to get object by index
* Finished struct builder
* aliased reflection to r
* finish table builder generation
* register requiring files
* better generated header info
* Tying up loose ends
* Updated reflection to handle struct padding
* Addd type sizes to reflection
* Fixed some vector indirect issues
* Lua tests passed
* Misc cleanup
* ci fixes 1
* ci fixes 2
* renaming
* up size of type sizes
* manually ran clang-format-11 -i src/idl_parser.cpp
* fixed some windows casting
* remove stupid auto import
* more static_casting
* remove std
* update other build environments
* remove scoped enums
* replaced std::to_string with NumToString
* more win fixes
* more win fixes
* replaced old lua with new
* removed auto import
* review responses
* more style fixes
* refactor bfbs_gen_len to use code +=
* added consts
* fix lambda capture for windows
* remove unused return type
* removed test/generate_code.{sh|bat}
remove c++0x from generate_code.py
added check generate code script in python
add windows specific call
added flags to generate_code.py
Set c++-0x on BUILD_LEGACY
Skip generating monster_extra if requested
* added option to skip monster extra
* add conditional to skip 2010 check gen
* added --bfbs-builtins
* update generate_code.bat
* forgot the .
* updated checking scripts
* added bypass for the monster_test.bfbs and arrays_test.bfbs diff issue
* removed check on windows for now
* Add the file a symbol is declared in to Reflection
If we move a code-generator to depend on Reflection,
it may need to know which file something was declared in
to properly name generated files.
* Doc comments in reflection, and more precise tests
* Add --project-root flag to flatc, normalize declaraion_file to this root
* fix --project-root stuff
* posixpath
* fix scripts
* format
* rename --project-root to --bfbs-filenames
Also, make it optional, rather than defaulting to `./`, if its not
specified, then don't serialize the filenames.
* bfbs generation
* fix some tests
* uncomment a thing
* add to project root directory conditionally
* fix
* git clang format
* Added help description and removed != nullptr
* "
* Remove accidental change to docs
* Remove accidental change to docs
* Pool strings
Co-authored-by: Casper Neo <cneo@google.com>