Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
flatbuffers
Commits
9b3d8b31
Commit
9b3d8b31
authored
Jan 27, 2017
by
Wouter van Oortmerssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tracking of order of types declared.
Change-Id: Iade313c99f119dcf1619674260648a33f61dc030
parent
87e29b25
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
idl.h
include/flatbuffers/idl.h
+1
-0
idl_parser.cpp
src/idl_parser.cpp
+4
-0
union_vector_generated.h
tests/union_vector/union_vector_generated.h
+2
-2
No files found.
include/flatbuffers/idl.h
View file @
9b3d8b31
...
...
@@ -578,6 +578,7 @@ private:
BaseType
baseType
);
public
:
SymbolTable
<
Type
>
types_
;
SymbolTable
<
StructDef
>
structs_
;
SymbolTable
<
EnumDef
>
enums_
;
SymbolTable
<
ServiceDef
>
services_
;
...
...
src/idl_parser.cpp
View file @
9b3d8b31
...
...
@@ -1314,6 +1314,8 @@ CheckedError Parser::ParseEnum(bool is_union, EnumDef **dest) {
}
}
if
(
dest
)
*
dest
=
&
enum_def
;
types_
.
Add
(
namespaces_
.
back
()
->
GetFullyQualifiedName
(
enum_def
.
name
),
new
Type
(
BASE_TYPE_UNION
,
nullptr
,
&
enum_def
));
return
NoError
();
}
...
...
@@ -1419,6 +1421,8 @@ CheckedError Parser::ParseDecl() {
ECHECK
(
CheckClash
(
fields
,
struct_def
,
"_byte_vector"
,
BASE_TYPE_STRING
));
ECHECK
(
CheckClash
(
fields
,
struct_def
,
"ByteVector"
,
BASE_TYPE_STRING
));
EXPECT
(
'}'
);
types_
.
Add
(
namespaces_
.
back
()
->
GetFullyQualifiedName
(
struct_def
->
name
),
new
Type
(
BASE_TYPE_STRUCT
,
struct_def
,
nullptr
));
return
NoError
();
}
...
...
tests/union_vector/union_vector_generated.h
View file @
9b3d8b31
...
...
@@ -266,8 +266,8 @@ inline bool VerifyCharacterVector(flatbuffers::Verifier &verifier, const flatbuf
if
(
values
->
size
()
!=
types
->
size
())
return
false
;
for
(
flatbuffers
::
uoffset_t
i
=
0
;
i
<
values
->
size
();
++
i
)
{
if
(
!
VerifyCharacter
(
verifier
,
values
->
Get
(
i
),
types
->
GetEnum
<
Character
>
(
i
)))
{
return
false
;
verifier
,
values
->
Get
(
i
),
types
->
GetEnum
<
Character
>
(
i
)))
{
return
false
;
}
}
return
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment