summaryrefslogtreecommitdiff
path: root/src/idl_gen_text.cpp
diff options
context:
space:
mode:
authorrw <me@rwinslow.com>2014-07-11 16:12:35 -0700
committerWouter van Oortmerssen <wvo@google.com>2014-07-21 16:40:39 -0700
commit74d5f3701fd19ca13b8fe69d1cf54002e11416da (patch)
treebf29f7fb006f6286db1dcd56f03c7c4af5a7d89b /src/idl_gen_text.cpp
parent3fb6a86d020f7423553a4e2dbba637b56d7760f6 (diff)
downloadflatbuffers-74d5f3701fd19ca13b8fe69d1cf54002e11416da.tar.gz
flatbuffers-74d5f3701fd19ca13b8fe69d1cf54002e11416da.tar.bz2
flatbuffers-74d5f3701fd19ca13b8fe69d1cf54002e11416da.zip
Port FlatBuffers to Go.
Implement code generation and runtime library for Go, derived from the Java implementation. Additionally, the test suite verifies: - the exact bytes in the Builder buffer during object construction, - vtable deduplication, and - table construction, via a fuzzer derived from the C++ implementation. Change-Id: Ib95a019c684891def2b50281e570b4843fea7baa
Diffstat (limited to 'src/idl_gen_text.cpp')
-rw-r--r--src/idl_gen_text.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/idl_gen_text.cpp b/src/idl_gen_text.cpp
index e8759259..f35e8840 100644
--- a/src/idl_gen_text.cpp
+++ b/src/idl_gen_text.cpp
@@ -140,7 +140,7 @@ template<> void Print<const void *>(const void *val,
type = type.VectorType();
// Call PrintVector above specifically for each element type:
switch (type.base_type) {
- #define FLATBUFFERS_TD(ENUM, IDLTYPE, CTYPE, JTYPE) \
+ #define FLATBUFFERS_TD(ENUM, IDLTYPE, CTYPE, JTYPE, GTYPE) \
case BASE_TYPE_ ## ENUM: \
PrintVector<CTYPE>( \
*reinterpret_cast<const Vector<CTYPE> *>(val), \
@@ -207,7 +207,7 @@ static void GenStruct(const StructDef &struct_def, const Table *table,
OutputIdentifier(fd.name, opts, _text);
text += ": ";
switch (fd.value.type.base_type) {
- #define FLATBUFFERS_TD(ENUM, IDLTYPE, CTYPE, JTYPE) \
+ #define FLATBUFFERS_TD(ENUM, IDLTYPE, CTYPE, JTYPE, GTYPE) \
case BASE_TYPE_ ## ENUM: \
GenField<CTYPE>(fd, table, struct_def.fixed, \
opts, indent + opts.indent_step, _text); \
@@ -215,7 +215,7 @@ static void GenStruct(const StructDef &struct_def, const Table *table,
FLATBUFFERS_GEN_TYPES_SCALAR(FLATBUFFERS_TD)
#undef FLATBUFFERS_TD
// Generate drop-thru case statements for all pointer types:
- #define FLATBUFFERS_TD(ENUM, IDLTYPE, CTYPE, JTYPE) \
+ #define FLATBUFFERS_TD(ENUM, IDLTYPE, CTYPE, JTYPE, GTYPE) \
case BASE_TYPE_ ## ENUM:
FLATBUFFERS_GEN_TYPES_POINTER(FLATBUFFERS_TD)
#undef FLATBUFFERS_TD