summaryrefslogtreecommitdiff
path: root/src/idl_parser.cpp
diff options
context:
space:
mode:
authormustiikhalil <mustii@mmk.one>2020-10-07 19:56:30 +0300
committerGitHub <noreply@github.com>2020-10-07 09:56:30 -0700
commit7b9e61fccffbaf9a673ae51f89c490508fd39670 (patch)
treee3a985a85a0cb8e10f06b026bc0d52d1f4dd1fa8 /src/idl_parser.cpp
parent3359e3042fd1dd947c4093b90ecce24d1839fbdd (diff)
downloadflatbuffers-7b9e61fccffbaf9a673ae51f89c490508fd39670.tar.gz
flatbuffers-7b9e61fccffbaf9a673ae51f89c490508fd39670.tar.bz2
flatbuffers-7b9e61fccffbaf9a673ae51f89c490508fd39670.zip
[TS] GRPC Implementation (#6141)
* GRPC implementation for Typescript * Fixes a couple of issues * Finished implementing the typescript support for grpc * Updated generated code * Fixes CI
Diffstat (limited to 'src/idl_parser.cpp')
-rw-r--r--src/idl_parser.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp
index 566482d2..d2c729a7 100644
--- a/src/idl_parser.cpp
+++ b/src/idl_parser.cpp
@@ -757,7 +757,8 @@ CheckedError Parser::ParseField(StructDef &struct_def) {
type.enum_def->name + "'.");
}
if (field->attributes.Lookup("key")) {
- return Error("only a non-optional scalar field can be used as a 'key' field");
+ return Error(
+ "only a non-optional scalar field can be used as a 'key' field");
}
if (!SupportsOptionalScalars()) {
return Error(
@@ -862,7 +863,7 @@ CheckedError Parser::ParseField(StructDef &struct_def) {
if (field->required && (struct_def.fixed || IsScalar(type.base_type)))
return Error("only non-scalar fields in tables may be 'required'");
- if(!IsScalar(type.base_type)) {
+ if (!IsScalar(type.base_type)) {
// For nonscalars, only required fields are non-optional.
// At least until https://github.com/google/flatbuffers/issues/6053
field->optional = !field->required;
@@ -1230,7 +1231,7 @@ CheckedError Parser::ParseTable(const StructDef &struct_def, std::string *value,
if (!struct_def.sortbysize ||
size == SizeOf(field_value.type.base_type)) {
switch (field_value.type.base_type) {
- // clang-format off
+// clang-format off
#define FLATBUFFERS_TD(ENUM, IDLTYPE, CTYPE, ...) \
case BASE_TYPE_ ## ENUM: \
builder_.Pad(field->padding); \
@@ -1369,7 +1370,7 @@ CheckedError Parser::ParseVector(const Type &type, uoffset_t *ovalue,
// start at the back, since we're building the data backwards.
auto &val = field_stack_.back().first;
switch (val.type.base_type) {
- // clang-format off
+// clang-format off
#define FLATBUFFERS_TD(ENUM, IDLTYPE, CTYPE,...) \
case BASE_TYPE_ ## ENUM: \
if (IsStruct(val.type)) SerializeStruct(*val.type.struct_def, val); \
@@ -2279,7 +2280,7 @@ CheckedError Parser::CheckClash(std::vector<FieldDef *> &fields,
return NoError();
}
-bool Parser::SupportsOptionalScalars(const flatbuffers::IDLOptions &opts){
+bool Parser::SupportsOptionalScalars(const flatbuffers::IDLOptions &opts) {
static FLATBUFFERS_CONSTEXPR unsigned long supported_langs =
IDLOptions::kRust | IDLOptions::kSwift | IDLOptions::kLobster |
IDLOptions::kKotlin | IDLOptions::kCpp;